hi, I've been investigating a bunch of compiler backends (LLVM, QBE ), and came across CLIF. my compiler is not written in rust, so i was wondering if there's existing command-line tooling that can accept CLIF and generate executables, or is the only interface via rust?
the closest i could find is this PR: https://github.com/bytecodealliance/cranelift/pull/872
There is currently no C api for Cranelift. As for a program that accepts clif ir in text form and creates an executable, there is none either. The main problem here is that cranelift-module (the interface used to "glue" multiple functions together) doesn't have a text form. This would be useful for other things too though. I have opened #2285 for this.
ok, thanks for clarifying
I started on https://gist.github.com/carlokok/d0d079dba76ee253a1571d58f2e791fb some time ago (it might/will be slightly out of date); could be a good starting point. I have a version at home that's slightly more up to date.
generates a fairly decent C header with cbindgen.
Last updated: Dec 23 2024 at 12:05 UTC