7 ms·
No mention of how much time it took to compile? I don't know if my memory is faulty but I remember Turbo C++ to be much much faster than today's C++ compilers.
by Coincoin 10y ago
No mention of how much time it took to compile? I don't know if my memory is faulty but I remember Turbo C++ to be much much faster than today's C++ compilers.
- hvs 10y agoIn 1992 it probably wouldn't have had templates nor much of much else (it wasn't standardized until 1998). Modern C++ is barely the same language anymore.
- badsectoracula 10y agoBorland C++ 3.1 (mentioned in the article) does have templates, although it doesn't have nested templates. It also didn't have namespaces (i think that was added in 5.0, which was still released before the first C++ standard). Keep in mind that the C++98 mainly standardized what compilers were already doing.
- throewai 10y agoIt's basically an ugly Python now.
- pvg 10y agoThe source is also plain C. Id/Carmack didn't switch to C++ until Doom 3.
- quantumhobbit 10y agoI don't know about c++, but turbo pascal compiled so fast that it felt like an interpreter back in the day.
- boznz 10y agoUsed both. TP was a lot faster but TC was no slouch. A Few years ago I managed to copy an old DOS diskette onto DOS VM and compiled and run a space invaders game I wrote. TC said it compiled but just kept returning me to the IDE when it executed! I eventually tweeked the VM speed down by about 100 at which point I saw the very fast invaders move to the bottom in about 2 seconds and kill my defender!
- 0xcde4c3db 10y ago> TP was a lot faster Not surprising. As far as I know, Pascal doesn't have anything remotely as hostile to efficient compilation as the C preprocessor (oh look, changing that one constant in a header file rendered your entire project out-of-date because the compiler can't prove that it doesn't make arbitrary memory layout and AST changes in every file that indirectly #includes it).
- badsectoracula 10y agoFWIW this is the same with Turbo Pascal's (and modern incarnations of it, like Delphi and Free Pascal). If you modify a constant in a unit, the compiler will recompile all other units that use that unit. The only way to avoid that is to keep everything in memory and do background updates to the AST. At which point you might as well do background compilations anyway.
- kqr 10y agoPascal, Delphi and Ada are a lot better than C and C++ in that regard, though, by virtue of actually having some sort of sensible module system.
- pjmlp 10y agoNot really, C++ build times are usually measured in hours for anything worthwhile using, e.g. Cocos2d-x as a possible example. You wouldn't get such compilation windows with Pascal derived languages using their module systems. The proof being that with VC++2017 using the incremental linker and C++ experimental modules, one also gets more human friendly compilation times. https://blogs.msdn.microsoft.com/vcblog/2016/10/05/faster-c-build-cycle-in-vs-15-with-debugfastlink/ https://blogs.msdn.microsoft.com/vcblog/2016/10/05/faster-c-... The Microsoft blog is only about the incremental linker, modules would speed it up even more.
- badsectoracula 10y agoI was referring to the given example, i actually use Free Pascal and Lazarus for my own tools and a big reason is how fast both the IDE (Lazarus) and the compiler (Free Pascal) are compared to anything C++ (well, anything except Borland C++ 5 i mentioned above and C++ Builder, but that isn't exactly fair considering the age of those programs :-P). But even in Turbo/Borland/Free Pascal modifying a unit means that you have to recompile the other units that need that unit.
- torgoguys 10y agoPretty close. Back in high school, I was the 'Pascal guy' and one of my friends was the 'C guy.' One day, the friend, after looking through the large list of compiler and linker optimizations available in Borland C++ (and confirming they weren't in my Turbo Pascal) said we should have a Hello World file size competition--see who could get the smallest filesize with our respective languages (compilers really). He spent half a class period digging through the options, reading what would be best, then typed his Hello World program, and announced he was ready. Literally while his code was compiling (these were 386 machines IIRC which took some seconds back in the day), I typed the one-liner and built my code with Turbo Pascal...before his compilation was done. I had no idea if my executable would be bigger or smaller than his, but I didn't want to put effort into the contest until I knew I was behind. As it turns out, it was about half the size of the C executable and he never asked for a round two. My friend was very frustrated that day. Fun day. EDIT: I did some research. They were actually at best 286 machines. The computer lab had those IBM PS/2 all-in-ones with MCGA graphics.
- badsectoracula 10y agoThat is an understatement. That is a full build of my 3D engine - http://i.imgur.com/3ApRyuQ.png http://i.imgur.com/3ApRyuQ.png (C not C++ but the linked article is also about a C codebase) on my current computer (4770K i7) under Borland C++ 5.0. Partial builds (modify a file and run) are instant, which is basically why i'm using it for a lot of my C code (the code also compiles in other compilers, like OpenWatcom, GCC, Clang, Visual Studio, Digital Mars C and Pelles C, but i mainly test with GCC, OW and VS, the rest i only test with occasionally). The compiler is part of the IDE, not some external process that needs to start from a blank state for each file, needing to read the same files over and over (which is what every other "IDE" does these days, similarly with the debugger which is usually running gdb at the background and some IDEs do not even bother to perform the builds themselves and instead using cmake or whatever - honestly it is as if people forgot what the "I" stands for) and it keeps compiled objects and libraries in memory and even uses the source code directly from the open windows's text buffers instead of having to save the file and load it from disk (although it does write the object and executable files to disk, it just doesn't do the unnecessary roundtrip for compiling the source).
- pinum 10y agoThis is interesting. How long does GCC take? Have you tried TCC?
- archimedespi 10y agotcc is blazingly fast, at least last time i used it. it's honestly fast enough that you could probably use it as an c interpreter
- Hydraulix989 10y agoAny technical reasons in particular? I'm curious. How many passes is it doing? I suspect they aren't doing much optimization then? Maybe they patch in differences in the ASTs at the IR level and work from there?
- 10y ago
- tawayway 10y agoI have no data to support it but I suspect the level of optimisation in modern compilers adds a lot of overhead.
- rbanffy 10y agoMany fast compilers of that period left partially compiled files on disk so that generating the final target could be faster. Also, the analysis they performed for optimisation was much simpler than what we do these days (as processors of the time didn't have much to optimise for).