2 ms·
I think I was conflating a few things. One of the problems I was remembering was how difficult and inflexible it is to write a fast and efficient AST in C and
by sdegutis 13y ago
I think I was conflating a few things.
One of the problems I was remembering was how difficult and inflexible it is to write a fast and efficient AST in C and export it to a scripting language intact. The only viable way that I could think of was to convert the C struct to an Objective-C graph and export it to whatever scripting language via some bridging, such as JavaScriptCore.framework (ugh JSExport) or maybe MacRuby, or similar.
But writing the AST in Julia itself might very well solve the fast/efficient problem, and since it's a dynamic language, scripting comes for free, with a first-class AST.
Another problem was how I couldn't mix Objective-C and C semantics when writing my AST. If I wanted to represent a collection in my AST, I had to basically hand-roll all the methods in NSMutableArray myself.
So ultimately I'm not sure I expressed myself properly, but I'm still excited about diving into Julia as a scripting language. I really believe it could solve this kind of problem. I can imagine new platforms being built with very little supporting platform-specific code which exports a few building block APIs to Julia and lets the script to the rest.