Re:Mrustc: a Rust compiler written in C++
by steveklabnik on Thursday September 21, 2017 @08:11PM
(#15308373)
Usually you port by cross compiling an initial compiler, and bootstrapping from there.
[ Parent
| on HN ]
Re:Mrustc: a Rust compiler written in C++
by binarycrusader on Friday September 22, 2017 @12:00AM
(#15309303)
Speaking from personal experience, that can be quite painful. Being able to build rust and cargo, even if only for bootstrapping when porting, would truly be a wondrous thing.
Why, we could always use emscripten to compile rustc to JavaScript and use that for bootstrapping!
On a more serious note, ghc at least solved this problem by allowing you to compile Haskell to C (-fvia-C). Writing a naive C code generator from whatever your backend is using is probably not that hard.
Re:Mrustc: a Rust compiler written in C++
by mitchty on Friday September 22, 2017 @07:50AM
(#15311268)
I actually did steveklabnik said porting ghc to alpine linux. Lets just say, ghc's cross compilation can be frustrating.