« first day (4413 days earlier)      last day (435 days later) » 
00:00 - 18:0019:00 - 00:00

7:51 PM
0
Q: Multibase Numbers!

Infigon(Similar: Through the bases) Normally, our number system is base ten, with the digits 0123456789. However, we can increase or decrease the base count (so hexadecimal uses 0123456789abcdef and octal uses 01234567. You goal, is given a string, find the sum of all bases that can be represented from ...

 
8:29 PM
@AidenChow i feel like taking my own stab at this now
CMM: should we consolidate the builtin answers to this?
 
8:51 PM
Bit late for that, isn't it?
Would've been better if ATaco had posted a single answer at the very start
Now there's 51 answers in total, many of which are builtins
 
Yeah, I'm inclined to say "We probably should have, but now we shouldn't"
 
Cool
 
@user ...Probably should've had a community wiki for "Builtins"
 
LDQ: In a language with modules that are somewhat similar to Rust modules, if a module A contains a module B, should I consider A to be dependent on B, B to dependent on A, or neither of them to be dependent on the other unless explicitly stated?
@ATaco I guess, but it's not a big deal
I can't treat A and B as both depending on each other because that'll be a cycle and it complicates things
 
9:00 PM
It is important though that Builtins are allowed, even if they're not interesting.
@user B depends on A, A Only depends on B if it requires any component of B
Sub-library vs Submodule
 
Thing is, in Java, the classes in an outer packages are often the ones relying on classes in a more deeply nested package
 
Ideally though, you'd detect if either B or A uses code from the other, and act accordingly.
 
Well, detecting is a bit hard, but I can assume neither depends on the other and have users explicitly state when they want to use B from A or A from B
 
@user A depends on B, B depends on A only if it uses A items
 
Explicit works where implicit is hard
 
9:04 PM
^
 
Just error when a user tries to use Code from the other without explicitly depending it
 
Sounds good
So they'll be treated like more or less unrelated modules
 
As a young aspiring dev, I didn't really understand the value of the invalid parts of a language.
But code that explicitly fails even when intended behaviour can be assumed can make writing longer code so much easier
 
LDQ: Should I have two different sort of module imports? One that lets you do something like Stdlib.Math.Random.foo (qualified) and another that lets you do Random.foo (no prefix needed). Or should I only have one kind of import?
 
Just don't fall for the Java problem of having to import every single class individually
 
9:07 PM
@ATaco By fail, do you mean a compile-time error or a runtime error?
@ATaco Honestly, I don't hate that
You usually don't need to worry about the imports section anyway
 
@user Compile time error, usually IDEs can show them before needing to compile.
 
@user how do you determine a prefix
@user me neither
 
@Seggan Just where the module is
 
@user Yeah but it gets needlessly long and cluttered. If the IDE can assume your imports for you, why shouldn't your compiler?
 
Stdlib.Math.Random is inside Stdlib.Math, which is inside Stdlib
@ATaco IDEs often show you multiple options for your imports, though
 
9:09 PM
"That just sounds like Namespaces with extra steps"
 
Yeah they're basically just namespaces
Different name, more or less the same concept
 
@user i mean how do you determine whether Math.foo is in Stdlib.Math.foo or GreatLibrary.Math.Foo
 
Absolute and Relative should both be valid.
 
@Seggan Ah, I guess if there are two Maths, then you would need to import by a specific name
 
@Seggan When importing INSIDE of Stdlib.Math, you should be able to use Random.foo
 
9:10 PM
@ATaco Aight, I think I'll do import qualified StdLib.Math.Random in case anyone wants StdLib.Math.Random.foo and import StdLib.Math.Random in case anyone wants just Random.foo
 
@user Hence something like import Stdlib.Math.* should be valid. If you want to later import a different Random as preference, you could do import MathExt.Random and it'll prefer the mot explicit definition.
Or even import Stdlib.*
 
@ATaco Oh yeah, that will definitely be valid
It's valid in Java too, isn't it?
 
It is, but people trust the IDE too much >:(
 
I used to have IntelliJ set to expand wildcard imports to explicitly list classes :)
IntelliJ hides the imports section from you so it's fine if it's 50 lines long
Anyway, thanks for the help, ATaco and Seggan. ATaco has given me lots of food for thought. I am going to go eat a taco now
 
@ATaco almost nobody codes in notepad these days
even vscode is a rudimentary ide
 
9:15 PM
well, I just wrote a method with the signature override fun visitMain_function_declaration(ctx: RabbitParser.Main_function_declarationContext): UntypedFunctionDeclaration
my eyes are bleeding
 
you should probably not special case main functions in your parser
make main a modifier or similar
 
@WheatWizard Do you have documentation for HGL somewhere? I'm wondering if there's an equivalent for Data.List's unfoldr, or better yet, unfoldl. I tried to read the source, but it's big and I'm not sure where to look.
 
@Ginger yeahs thats the disadvantage of antlrs code style
 
@Seggan they're special cased because they can't have certain modifiers (like static) applied to them
although I could probably check that while tokenizing...
 
@Ginger then just enforce that when converting to ast
 
9:17 PM
hm, yeah that makes more sense
 
if (STATIC in modifiers && MAIN in modifiers) error("blah")
 
wait, error is a function?
 
yep
it throws IllegalStateException
 
neat
 
9:24 PM
@Seggan I use VSCode as a fully featured IDE :P
 
@Seggan lies
you've just been corrupted by UnintelliJ
 
@Ginger theres also assert and require
@Ginger i meant vscode without extensions
 
oh, yeah lol it's way less useful without extensions
 
Still a nice lightweight editor without extensions
 
@DLosc Yes! I've worked very hard on the documentation. You can build it with cabal v2-haddock
 
9:27 PM
I essentially went from Notepad++ to Sublime Text 2 to VSCode, a very vanilla code editor pathway
 
@Seggan I code in Notepad++ all the time
 
As a general tip if you want to find the equivalent to a function you can just try using that function, usually you will get a deprecation warning with the short name of the function.
I don't think there is an equivalent to the unfolds though.
 
@DLosc ...
i dont know what to say
 
@WheatWizard Ah, okay. Is it available online, though?
 
It isn't. I used to have a pipeline to build it and stuff, but it broke and I haven't been able to fix it.
 
9:31 PM
@Seggan did u make any progress?
 
@AidenChow no
barely
 
@DLosc lmfao
 
@WheatWizard That's pretty cool. I will check.
 
I checked and I haven't implemented it yet.
 
@Seggan for reference the score to beat is 44 bytes :P
 
9:33 PM
I think it has to do with Maybes being a little weird.,
 
@WheatWizard Okay, thanks. I'll just post my unfoldl solution as Haskell, then.
 
:(
I'll probably implement it.
 
Quite hyped for Language Design SE to be a thing
 
@WheatWizard It feels like one of those elegant functional-programming builtins that HGL is designed to take advantage of :)
 
Yeah. It's a good one.
 
9:54 PM
@RydwolfPrograms library if you can get your language grammar to work with it
It's really nice letting a library do everything for you
 
^
you can make syntax adjusments very quickly
 
One should definitely use a library to parse their lang
That said, I never have
In writing my own parser though, I could write a syntax-aware macro system.
 
0
Q: Shape Animation

InfigonAnimate the shape! In PowerPoint, there's just one overly used feature: animations. For simplicity, that shape will be a non-rotated rectangle. The data is specified as an array of eight integers: [2, 20, 30, 4, 5, 6, 7, 60] means create a 20-by-30 view, with the rectangle's top X at \$(4, 5)\$, ...

 
10:12 PM
> Text cases (took a while to make)
just to make sure we appreciate the effort put into making them :p
 
You're a text case
 
aren't we all?
that was a rhetorical question, don't answer it
 
@Ginger No, not really
@Ginger only you
@Ginger too bad I did
 
I think you need to check your vision, because I said not to answer it right up there :b
 
I said too bad
I answered it
Whether you like it or not
 
10:14 PM
YOU GOT [Guts] KID!! THAT's [[Discomfort And Abdominal Pain]] IN MY [[Guts]]!!
 
Oh yeah, now I'm seeing why I haven't implemented unfolding ...
There's so many new types I could get into.
 
0
Q: Encrypt AES256 (ECB Cipher Mode)

InfigonI've looked and could not find a post for this, if there is one, I'll remove it quick! Related and also related The goal is (hopefully) clear: create the shortest code (in bytes) that implements the AES256 ECB cipher mode. Convert the result to Base64. The input contains two parts. The first part...

 
@WheatWizard Is that because you'd want to generalize the idea as much as possible?
 
Wow I hadn't posted an answer in over a month lol
 
10:31 PM
@DLosc Yes.
@DLosc Just merged a version without any fancy types. This will at least be something until I get around to fully generalizing: gitlab.com/WheatWizard/haskell-golfing-library/-/merge_requests/…
I should figure out how to host the docs somewhere though.
 
11:08 PM
My Rep is... Over 9000!
 
gg
 
11:23 PM
congrats
 
@PyGamer0 imo language design as pertains to golfiness should be quarantined here but praclang design should move
@AidenChow and yeah $ is literally just an infix operator for function application, it just so happens that you usually use it for its own precedence
i forget which is high and which is low but it binds as non-tightly as possible
whereas normal function application is effectively an empty-string infix operator that binds as tightly as possible :P
oh yeah you also use $ for its associativity
 
11:39 PM
I've managed to get Find the smallest missing integer down to 6 bytes in my latest prototype golflang!
        inc
        arg0
    contains
not
first inc
 
\o/ What's the encoding?
 
Symbolic. One word per byte.
Represents 21 41 44 1F 45 21
Called Jalapeño
 
I love your commit mesages
It's like you ate a lot of jalapenos
 
I find github a canvas to let out my emotions whilst coding
 
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
 
11:44 PM
Which tells you I don't frequently work in teams
 
As it stands the word-to-byte map isn't static, thus I'm not submitting any answers
 
@ATaco Any specific reason for the formatting?
 
Just showing the arguments of implicit currying
 
0
Q: Canonical form of a cubic Bézier curve

Parcly TaxelOn Pomax's Primer on Bézier Curves this "fairly funky image" appears: This is related to the fact that every cubic Bézier curve can be put in a "canonical form" by an affine transformation that maps its first three control points to (0,0), (0,1) and (1,1) respectively. Where the fourth and last ...

 
11:47 PM
inc expects one argument, contains expects two, and not expects one. As long a the stack doesn't supply all the required arguments, it curries what it can and returns it as a new function
Like an ugly lovechild between Tacit and Stack-based.
 
Ooh
 
Additionally, if one of these functions is all that's left on the stack after execution, it'll try to run it with the commandline args.
 
@ATaco one person i coded with in github always makes his commits a
which is so annoying since he makes them big and monolithic
 
0
Q: Find the average of the average, median, mode, and range of the average, median, mode, and range!

InfigonIt's easier to put this into coding terminology, so here we go: First, find the average, median, mode, and range. Put them in another array, then find the new average, median, mode, and range. Then average those numbers. Test cases: [1, 2, 3, 4, 5] -> 2.5625 [1, 1, 1, 1, 1] -> 0.9375 [2, 3, 5, 7,...

 
00:00 - 18:0019:00 - 00:00

« first day (4413 days earlier)      last day (435 days later) »