Hi!
I'd like to add structs and a heap-like thing to my little language that uses cranelift, but I'm a bit lost on how to represent those in cranelift. I understand that cranelift doesn't really provide that out of the box and that I need to implement that myself, but I was hoping to find some example out there somewhere. Do you know of any example languages that do anything like this?
I think I found a way to do structs via StackSlots in the meantime :)
You can call into the native malloc to allocate memory on the heap. For as long as you are not doing GC that should be enough.
Interesting approach. I don't think that works for my use case specifically, but it has got me thinking about FFI to solve the issue. Thanks!
Last updated: Dec 23 2024 at 12:05 UTC