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

Rust and Python are not mutually exclusive languages. Servo uses quite a lot of python in the build tooling and server infrastructure stuff.



Python also drives rustc's new build system, driving Cargo.


I'm curious why that was. Convenience for getting the job done? Already installed on a lot of boxes? Something else?


Most of the build process is in Rust[0], but something needs to kick it off: instead of assuming/requiring that install the correct version of Rust (for the right platform) themselves and then invoke cargo in the right place to get the build manager, there's a relatively short Python script[1] that does all of that automatically. Python works well because it's everywhere, and it's already a dependency of the build process (LLVM needs it).

[0]: https://github.com/rust-lang/rust/tree/b30eff7ba72a78e31acd6...

[1]: https://github.com/rust-lang/rust/blob/b30eff7ba72a78e31acd6...


"Python works well because it's everywhere, and it's already a dependency of the build process (LLVM needs it)."

There we go. Makes a ton of sense and was one of my options.


Our build system (cargo) needs rust to compile, but rust itself needs rust to compile, so something has to give _somewhere_ :)


I would suspect it's because it has easy to use and well-developed web libraries.


That's my guess, too. I thought Rust might handle a build system by now with all the libraries pouring out. So, I figured I'd ask anyway in case any interesting answers showed up.


It is a build system written in Rust: https://github.com/rust-lang/rust/tree/master/src/bootstrap

There is only one Python file: https://github.com/rust-lang/rust/blob/master/src/bootstrap/...

Its job is to download the previous Rust release (beta for master, stable for beta and previous stable for current stable), including Cargo, build the build system with Cargo and start it.

The build system then builds native dependencies (LLVM) and runs Cargo several times for different components.


Well, there we go. The other comments made me think it was mostly Python or something.




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

Search: