Hello, I am writing a programming language. I am trying translating my AST to Cranelift IR and then compile it to WASM.
I am having a hard time making progress. I was able to write a basic function with numeric variable. But now I am having a really hard time to translate more of my language AST to Cranelift IR.
Specifically I am having a hard time doing simple things like:
Apart from the API documentation, cranelift-jit-demo and kaleidoscope-cranelift I have not found any guide, examples or extensive documentation. I am not a compiler expert so I need more help probably.
Do you have any documentation, guides or well documented examples that you can share?
Thank you very much
@clacla I am personally not aware of any. @Till Schneidereit @Alex Crichton do either of you know of any good sources?
I'm not aware of documentation along these lines myself, you could also try asking in #cranelift perhaps too. I'll note though that Cranelift IR is quite low-level where concepts like arrays/strings are relatively high level by comparison. Additionally Cranelift does not have a backend to generate WebAssembly itself, it's intended for the other way around where WebAssembly is translated to Cranelift
Last updated: Nov 22 2024 at 17:03 UTC