Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Back in 1999 - 2003, when I was working on a product mixing Tcl and C, the builds took one hour per platform, across Aix, Solaris, HP-UX, Red-Hat Linux, Windows 2000/NT build servers.

C++ builds can be very slow versus plain old C, yes, assuming people do all mistakes there can be done.

Like overuse of templates, not using binary libraries across modules, not using binary caches for object files (ClearMake style already available back in 2000), not using incremental compilation and incremental linking.

To this day, my toy GTK+ Gtkmm application that I used for a The C/C++ Users Journal article, and have ported to Rust, compiles faster in C++ than Rust in a clean build, exactly because I don't need to start from the world genesis for all dependencies.



That’s not really an apples to apples comparison, is it?


I dunno why, the missing apple on Rust side is not embracing binary libraries like C and C++ do.

Granted there are ways around it for similar capabilities, however they aren't the default, and defaults matter.


I talked a bit about this at the Rust All Hands back in May.

A lot of Rust packages that people ust are setup more like header-only libraries. We're starting to see more large libraries that better fit the model of binary libraries, like Bevy and Gitoxide. I'm laying down a vague direction for something more binary-library like (calling them opaque dependencies) as part of the `build-std` effort (allow custom builds of the standard library) as that is special cased as a binary library today.


You only build the world occasionally, like when cloning or staring a new project, or when upgrading your rustc version. It isn't your development loop.

I do think that dynamic libraries are needed for better plugin support, though.


> You only build the world occasionally

Unless a shared dependency gets updated, RUSTFLAGS changes, a different feature gets activated in a shared dependency, etc.

If Cargo had something like binary packages, it means they would be opaque to the rest of your project, making them less sensitive to change. Its also hard to share builds between projects because of the sensitivity to differences.


Except for RUSTFLAGS changes (which aren’t triggered by external changes), those only update the affected dependencies.


One hour? How did you develop anything?


That was a clean build for the binary code used in Tcl scripts, every time someone would sync their local development with latests, or switch code branches.

Plenty of code was Tcl scritping, and when re-compiling C code, only the affected set of files would be re-compiled, everything else was kept around in object files and binary libraries, and if not affected only required re-linking.


That’s probably why tcl is in there, you use uncompiled scripting to orchestrate the native code, which is the part that takes hours to compile.




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

Search: