rtulip / haystack

Haystack is a compiled, statically typed, stack-based language with opt-in variable assignment.
MIT License
25 stars 2 forks source link

Switch to LLVM #119

Open rtulip opened 1 year ago

rtulip commented 1 year ago

Rather than generating assembly, Haystack should instead generate LLVM ir.

Unresolved questions:

rtulip commented 1 year ago

This might help with creating a stack: https://github.com/riywo/llforth

kevinbarabash commented 1 year ago

Is Cranelift an option as well or do you need proper support for tail calls?

rtulip commented 1 year ago

Is Cranelift an option as well or do you need proper support for tail calls?

I've not worked with either, but as far as I understand, cranelift would also work.

kevinbarabash commented 1 year ago

I haven't used Cranelift, but it seems like it might easier to integrate given it's written in Rust.

rtulip commented 1 year ago

That is a good point. I had been planning on generating LLVM assembly, but being able to do the code gen in source may be nice.