Today's #Kittyscript design thoughts topic: The structure of the compiler mid-en...

@LunaDragofelis@void.lgbt

Today's #Kittyscript design thoughts topic: The structure of the compiler mid-end.

My current concept is that there's a mutable compilation context object that's fed expressions that add expressions/statements to the current function, or install callbacks, while being able to read the context. The callbacks do things like reacting to a variable being defined syntactically after the point of reference, where the callback then sets the reference to the now defined variable. Lambdas or nested scopes create a new compilation context that partially reads/writes through to its parent context.

Library and user plugins can add arbitrary additional behavior to compilation.

RE: https://void.lgbt/objects/3c7abb8e-f7a4-4b2a-8aad-928bb5e3f49d