Yeehaa, we’re back!
Sorry the site has been down over xmas, but the monkey2 forums were spammed and I just wasn’t in the mood for embarking on an involuntary MySql refresher. I don’t even particularly dislike MySql or anything, I JUST WASN’T FEELING IT. Spammers kindly fuck off forever.
All done now though, although I suspect I might have been a bit eager while tidying up – I deleted a bunch of users that ‘looked’ suspicious, eg: numbers in email addresses (esp. yahoo) or marketing blurb in sigs. Apologies if you’ve been falsely maligned by the ‘algorithm’, please feel free to sign up again if you want.
I’m gonna go back to manually confirming new users before they can use the site, pretty sure I’ll be able to keep up with demand.
In the meantime, I did actually get some work done on the monkey2/wasm project, primarily just laying down the foundations for a new MSVC project which I ended up calling blitz0 for some reason. There’s not quite enough in there to make it worth adding to github but I suspect there will be soon.
I will be using ‘Antlr’ to generate a real parser this time around, so the actual language syntax will be described in an antlr ‘.g4’ file, a bit like this:
[crayon-5c51ddc0b70e9320825176 inline="true" ]grammar Blitz0;
prog: (expr NEWLINE)* ;
expr: expr op=('*'|'/') expr # binop
| expr op=('+'|'-') expr # binop
| value=INT # literal
| '(' expr ')' # parens
NEWLINE : [rn]+ ;
INT : [0-9]+ ;
I would actually like to attempt to support several versions of blitz/monkey this way – they’re all pretty similar, and even if they weren’t Antlr appears to be capable of a hell of a lot, eg:
Indeed, for this iteration of whatever-the-hell-it-is-I’m-doing I’d like to leave the traditional idea of a language behind a bit (although getting monkey2 going again is still priority #1) and concentrate more on the ‘syntax tree’ stuff and a bunch of tools for transforming, loading, saving and caching trees. Syntax trees should always be loadable/saveable at any point in the build process (eg: post-parse, post-semant etc) meaning you can do all sorts of cool things like ‘cache’ generic instantiations. For example, the first time the compiler has to compile Stack<Int>, it can hang onto the precompiled concrete version in a cache (at least until you clear cache or something). So everyone can ultimately have their own ‘optimized for their own use cases’ cache of precompiled code. A lot of this only becomes possible once you throw out the need to have to producable ‘traditionally linkable’ code, but hell yeah that’s fine with me!
I will be using C++ to ‘rewrite’ monkey2. Antlr can actually produce code for a range of languages, but C++ is what I’m most comfortable with so I’ll stick with that. The idea of ‘writing a language in itself’ now strikes me as kind of indulgent and pointless – you could write a C++ compiler in Apple][ integer basic (or indeed in any turing complete language) but why? WHY? OK, it would admittedly be extremely cool…
I have been having a ton of crazy ideas for all this lately, many of them actually inspired by recent developments in the C++ world – developments I wouldn’t have even realized were going on if I hadn’t ‘become’ a real C++ programmer myself! Here’s some of the (IMO) interesting, possibly bonkers, stuff being talked about these days in the world of C++:
https://youtu.be/80BZxujhY38?t=3066 (This starts at the metaclasses stuff but the whole thing is interesting)
https://youtu.be/CRDNPwXDVp0 (Compile time reflection is the ‘biz – runtime reflection is overkill unless you can load code at runtime, in which case runtime type information can be loaded via syntax trees if needed)
All of which is why I actually plan to start with an interpreter, so things could be happening sooner rather than later with a bit of luck.
Anyway, happy new year everyone and good luck with whatever you’ve got planned for 2019.