Re:“Modern” C++ Lamentations
by praptak on Friday December 28, 2018 @03:10PM
(#18779091)
I remember Turbo Pascal 5.0 and its imperceptible delays between pressing F5 and seeing the program output. I hope some day we can have this in C++, even if it takes sorcery like speculative compilation as-you-type done on a gigawatt cluster of custom chips...
[ Parent
| on HN ]
Pascal (and the entire family - Modula etc) is a language designed by a guy with an academic background in PLs. This shows in the design: e.g. the syntax is verbose and has a very rigid structure, which can often be frustrating to the user (like the need to declare all variables in a separate declaration block at the beginning of each function), but which makes it extremely easy to parse with just a single token lookahead. Similarly, the semantics are such that they're easy for a compiler to implement.
Borland still did a great job with their implementation performance-wise, and the legendary reputation of their Pascal compilers is well-deserved. But they had a solid foundation to build on in form of a tool-friendly language, which C++ just doesn't offer.
Those rules are quite relaxed in Delphi, while still keeping the compilation speed.
Same applies to C++ Builder, at least until they decided to move to clang.
By now I think parsing is not exactly the bottleneck. But back in 90s, I'm sure that it has been a part of why TP and BP were as fast as they were, esp. compared to C++. Having precompiled units (and therefore no need to #include hundreds of kilobytes of headers for every translation unit) is probably a bigger deal today.
Also, IIRC Delphi had only recently gotten generics, and they're still not heavily used? I suspect that code that's heavy on those will compile pretty slow.
I have seen a modern Oberon compiler building itself in 1/10-th of a second. (The Tiny C compiler does not take much longer, either.)