← Back to context

Comment by pjmlp

1 day ago

And then people are amazed for it to achieve compile times, compiled languages were already doing on PCs running at 10 MHz within the constraints of 640 KB (TB, TP, Modula-2, Clipper, QB).

> [some] compiled languages were already doing on PCs running at 10 MHz within the constraints of 640 KB

Many compiled languages are very slow to compile however, especially for large projects, C++ and rust being the usual examples.

  • It is weird to lump C++ and Rust together. I have used Rust code bases that compile in 2-3 minutes what a C++ compiler would take literally hours to compile.

    I feel people who complain about rustc compile times must be new to using compiled languages…

    • There is a way to make C++ beat Rust though.

      Make use of binary libraries, export templates, incremental compilation and linking with multiple cores, and if using VC++ or clang vLatest, modules.

      It still isn't Delphi fast, but becomes more manageable.

  • True, however there are more programming languages than only C++ and Rust.

  • Well, spewing out barely-optimized machine code and having an ultra-weak type system certainly helps with speed - a la Go!

    • That's a reasonable trade-off to make for some people, no? There's plenty of work to be done where you can cope with the occasional runtime error and less then bleeding edge performance, especially if that then means wins in other areas (compile speeds, tooling). Having a variety of languages available feels like a pretty good thing to me.

      9 replies →

That's a bit unfair to the modern compilers - there's a lot more standards to adhere to, more (micro)architectures, frontends need to plug into IRs into optimisers into codegen, etc. Some of it is self-inflicted: do you need yet-another 0.01% optimisation? At the cost of maintainability, or even correctness? (Hello, UB.) But most of it is just computers evolving.

But those are not rules. If you're doing stuff for fun, check out QBE <https://c9x.me/compile/> or Plan 9 C <https://plan9.io/sys/doc/comp.html> (which Go was derived from!)

  • Indeed, and thankfully there exist languages like D and Delphi to prove as being a modern compiler and fast compilation times are still possible 40 years later.

  • > That's a bit unfair to the modern compilers

    It's really not. Proebsting's Law applies.

    Given that, compilers/languages should be optimized for programmer productivity first and code speed second.