sharkdp / numbat

A statically typed programming language for scientific computations with first class support for physical dimensions and units
https://numbat.dev
Apache License 2.0
1.28k stars 53 forks source link

Experiment: generate LLVM IR #41

Open sharkdp opened 2 years ago

sharkdp commented 2 years ago

Instead of bytecode, simply(?) generate LLVM IR? https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl03.html

sharkdp commented 2 years ago

https://crates.io/crates/inkwell

triallax commented 1 year ago

Sounds like an interesting experiment, but I don't know if we'd want to require an unwieldy dependency like LLVM. :) Perhaps we could at something like https://c9x.me/compile/ instead?

triallax commented 9 months ago

Now that I think about it, LLVM IR generation could be really nice and interesting to have as an optional disabled-by-default feature. Who knows, maybe we can compile Numbat code to executables? :)

sharkdp commented 9 months ago

The tricky thing is probably that you also need to ship a runtime. Compiling something like 1.2 + 3.4 to machine code is not hard. But compiling print("hello world") needs some thought :-)