Dev Diary 8
Curzon Raku, my beloved old friend There's a larger post bubbling in the back of my head about this, but for now, lets say that digging into Raku feels a lot like rediscovering an old friend. At the same time, I'm realizing that I've changed.
Raku is… brilliant. I regret not having stayed in touch with it during it's rather prolonged development (21 years!!). You see, I loved Perl 5.
Dev Diary 5
Back to writing a Language target Or… not.
It turns out that I dramatically overestimated the amount of documentation available for creating a new language target for Antlr4. Basically it boils down to "edit one of the existing targets" Except there are all sorts of template directives in there that aren't explained. I suspect the String Template documentation will probably address the syntax enough for me to understand the "what" of these templates but not the "why".
Dev Diary 7
Target Woes Started writing a tiny grammar in Janet last night just to get a feel for it. Wrote one that matches my multi-line comments which I'll need for the initial pass of the parser.
Discovered some problems.
Janet's PEG doesn't support unicode out of the box. It's stuck in ASCII land. Gods forbid anyone wants to try and match a string that was written in another language.
Dev Diary 6
Nanopass Compiler? I realized that in order to really leverage my contract stuff I'm going to need a multi-pass compiler. For example, I want to have the compiler let you know that there's a problem when you feed the output of a function that returns an Integer to the input of a function that takes a String. You can't do that until you've ingested all the functions in your app, and processed their contract definitions.
Dev Diary 4
Lambda Lambda Lambda I'd come up with the temporary syntax of ~>[args]{function body} for lambdas but it was very not in line with the rest of the language, and not at all self-evident, and I just didn't like it.
Then i saw how python handles it:
# lambda arguments : expression x = lambda a : a + 10 print(x(5)) So what if we built off of that?