Hacker News new | past | comments | ask | show | jobs | submit login

For comparison, the original Rust compiler was written in OCaml. AIUI, the Rust compiler build now has three stages: a blessed binary snapshot of Rust+LLVM (stage0) compiles and tests a new build (stage1) from source, then (as a bootstrap sanity check) the stage1 compiles and tests a new build (stage2) from the same sources. Needless to say, this is a time-consuming process. :)



Does it mean that you have to change ocaml sources to change the language? Why don't you develop Rust in Rust? That would be the real eat your own dogfood?


It is now purely in Rust (with a few thousand lines of C, mostly external libraries or tiny wrappers to interact with the OS, where the API is defined in terms of C macros) + the LLVM optimiser.

The OCaml compiler was just written to get an implementation of the language that was good enough in which to write a compiler. The OCaml source was deleted more than 2.5 years ago and Rust has been properly bootstrapping/dogfooding for that long.


So the current state is: Rust is developed in Rust. Go is still developed in C, but they plan to gradually change that.

So it's Go which still doesn't eat its own dogfood. I always wondered why Go was never functional enough to be used in a lot of the scenarios where C is used. With all the details, it's more clear now.


The whole Go standard library, which is more code than just a compiler (and it even includes a complete Go AST parser as well), is developed in Go ("dogfooded") and so are the documentation tools (godoc, the web site, present) and the static code analysis tools (SSA, oracle, go/types etc.) in the go.tools repository.


Is there a place where I can read the source of the OCaml Rust compiler?


All 38k lines were deleted in https://github.com/mozilla/rust/commit/6997adf76342b7a6fe03c... , so the most recent revision is https://github.com/mozilla/rust/tree/ef75860a0a72f79f97216f8...

(The "Rust" that the OCaml compiler handled is very very different to modern Rust, fwiw.)


It's in the boot/ directory here if you go back far enough in time: https://github.com/mozilla/rust

Sadly the GitHub Web UI seems to cap viewable history at 100 pages' worth of commits.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: