Re:Rhine – A Lisp on LLVM
by steveklabnik on Saturday September 06, 2014 @09:12AM
(#8278265)
Rust was originally written in OCaml, and then ported to Rust once things were working well enough.
[ Parent
| on HN ]
Rust has an FFI to C, which is how it calls out to LLVM. Can you point me to the part of the codebase that codegens the basic constructs?
Re:Rhine – A Lisp on LLVM
by steveklabnik on Saturday September 06, 2014 @09:51AM
(#8278350)
I _believe_ that https://github.com/rust-lang/rust/blob/master/src/librustc_l... is the LLVM wrapper, and that https://github.com/rust-lang/rust/tree/master/src/librustc/m... is what does the actual generation, but frankly, I am quite bad with the compiler internals.
I wrote a little about the guts of the Rust compiler earlier this year. Shouldn't be too out of date, should get you pointed in the right direction if you're interested in the details:
http://tomlee.co/2014/04/03/a-more-detailed-tour-of-the-rust...
At the time of writing, Rust would use LLVM to generate object files from LLVM IR, then link 'em together using the system's C compiler.