3 ms·
For now I'd like to stick with ANSI C for portability but other than that I'm down for JIT alternatives as long as it's quick and easy for others to hack on/ins
by tjholowaychuk 15y ago
For now I'd like to stick with ANSI C for portability but other than that I'm down for JIT alternatives as long as it's quick and easy for others to hack on/install.
Nah that's valid but that macro list might as well just be the enum I'm not using it for anything else right now
- wbhart 15y agoNo worries. One problem with adding a Jit is you usually want to put extra information in the ast, such as LLVM objects, so I'm not sure how totally easy it would be to hack in in an unobtrusive way. The other problem is that VMs like LLVM are quite good for statically typed languages, but not always great for dynamic ones. It's probably too early to tell either way. And yeah, even if you use the C interface to LLVM, you still need to compile it with a C++ compiler, which sucks a bit. Regarding what I thought was a typo, you define n but undef t, but no worries, I guess I didn't read the rest of the code. Good luck!
- tjholowaychuk 15y agoah you're right haha, didn't catch that
- wbhart 15y agoJust for fun I threw up a project I've been working on: https://github.com/wbhart/Cesium https://github.com/wbhart/Cesium In backend.c (esp. lines 171 and following) you can find the beginnings of an LLVM backend (it does work, but doesn't do a whole lot atm). The whole project is in a major rewrite at the moment. I had fully implemented the toy language described here: http://selmer.warwick.ac.uk/cesium.pdf http://selmer.warwick.ac.uk/cesium.pdf with an LLVM backend. But I was relying on closed source code for the parser generation and that began to nag at me, so I'm rewriting the entire thing from scratch to use greg (a fork of leg). I'm also adding type inference this time around.