Stream: SIG Documentation

Topic: Cranelift documentation and guides


view this post on Zulip clacla (Aug 05 2024 at 16:44):

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

JIT compiler and runtime for a toy language, using Cranelift - bytecodealliance/cranelift-jit-demo
Tutorial to learn to use the cranelift compiler backend - CraneStation/kaleidoscope-cranelift

view this post on Zulip Kate Goldenring (Aug 14 2024 at 12:29):

@clacla I am personally not aware of any. @Till Schneidereit @Alex Crichton do either of you know of any good sources?

view this post on Zulip Alex Crichton (Aug 14 2024 at 14:35):

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: Oct 23 2024 at 20:03 UTC