3 ms·
Pascal was off time. A lot of these traits are really worthy, but it wasn't attractive at the time .. was it as 'performant' as C too or was it a very nice envi
by agumonkey 11y ago
Pascal was off time. A lot of these traits are really worthy, but it wasn't attractive at the time .. was it as 'performant' as C too or was it a very nice environment to craft sound code productively whereas C code could allow you to tap into hardware more aggressively no matter how much headaches that would give you ?
- _0ffh 11y agoGiven the caveat that performance is always a question of how well the implementation performs inside the limits given by the language: Yes Turbo Pascal produced fast code. About as fast as Turbo C. Which was really quite fast. Also, the compilation process itself was very fast compared to other Pascal compilers. About the question you didn't specifically ask: There's no reason (apart from optional stuff, like array bounds checking) that a Pascal compiler couldn't produce code of equivalent speed as a C compiler. (There is one language with a potential speed advantage over Pascal/C/equivalents and that's Fortran.)
- pjmlp 11y agoPascal and C compilers produced similar code quality back then. Everyone praises C compiler quality nowadays. On those home computers, C, Pascal and Modula-2 were good enough for general purpose applications, if one wanted real speed, Assembly was the only way to go. Turbo Pascal, as well as any other Pascal dialects, had the same capabilities to access hardware as C offered. Also the MS-DOS game development scene and the demo scene tools were heavily based in Turbo Pascal, besides the usual Assembly stuff.
- agumonkey 11y agoOh right, I remember inline asm in TP now. I smile at how easy this thing was, I didn't even know how many thing happened under the cover, I just typed so glyphs (I didn't know the language) and hit F5 IIRC. Only recently I heard how they designed the compiler to be so fast you didn't see the build step.
- klagermkii 11y agoThinking you press F5 for compile/run? That's the kind of shibboleth that outs the QuickBASIC heathen!
- baldfat 11y agoI think people who were using computers in the 1980s have their baseline for speed as Assembly and anyone from the 1990s on have C as their baseline of speed. Man I hated reading or figuring out other's Assembly code and Turbo Pascal was a dream in comparison (And Fortran also)
- vidarh 11y agoC compilers tended to be atrocious back then. I remember "porting" some code from C to assembler by compiling it, disassembling it, and then patiently going through several thousands lines of asm output and adding labels etc. as well as deleting on average every second instruction or so, because the compiler was so bad at optimizing register usage. Seeing disassembled code like that kept me from learning C for years...
- bluedino 11y agoTurbo Pascal was fast (produced decently fast code and compiled in a flash compared to C compilers) and very common with the game and demo coders of the time. They did liberally use inline assembly code, though.
- Roboprog 11y agoWorse is Better seems to be an ongoing theme in the programming industry. (Pascal was much more readable and safe than C, and about the same speed - e.g., I could cobble up pointer arithmetic in TP if I have to with the address-of operator and increment/sizeof pseudo-functions) First it was shitty C code in the 90s, and now the Java language. At least I'm not totally burned out on Javascript yet :-)
- nickpsecurity 11y agoVery. Gabriel might go back and forth but I was sold on the concept first read of paper. Let's take Turbo Pascal or even Delphi. People were griping at one point about all C's problems and C++'s similar + new problems. They wanted a more productive, safer, easier-to-integrate systems language. I cited Wirth already built half a dozen and Borland industrialized them. Hell, even industrial BASIC's had less problems that C development with similar safety, readability, and dev speed. What's the market do? Push all effort into C and C++. Results of that are still with us. (sighs) Go and Rust give me some hope in that they're first mainstream languages that solve some problems. On non-mainstream, Julia is an awesome development that might be re-applied to systems programming. Not to mention Racket's metaprogramming combined with C or assembler generation for a high-level use of low-level, fast language. Ivory language does that with Haskell, for example. So, not as Worse as usual. Still true overall.
- pjmlp 11y ago> What's the market do? Push all effort into C and C++. Results of that are still with us. Not to mention the amount of money spent writing band aids for them., in form of static and memory analysers and more recently CPU instructions (Intel MPX). Which not everyone uses, because either it isn't available on their platform, or they choose not to use them anyway. Just like coders that despite C++ safety improvements over C, use it as C with C++ compiler.
- nickpsecurity 11y agoYeah the band aids add up. We'd need things such as static analysers anyway for spotting problems, optimizing, etc. However, an extra problem with C/C++ is that the languages are so complex to analyse that people get friggin' PhD's for certifying or formalizing even a subset of them. And the average programmer working against the clock is supposed to make something robust with such a tool? That's ridiculous. " because either it isn't available on their platform" I tried to solve that with my tools (lang X) using X-to-C compiler w/ seemless FFI for 3rd party code. Encouraged other languages to do that with many having done it before I got on the scene: Modula, Oberon, Ada, LISP/Scheme, and so on. Let them use good language with hardware/OS of choosing. Ignored it as you said. "Just like coders that despite C++ safety improvements over C, use it as C with C++ compiler." David Thornley brought this up on Schneier's blog when he said he was distrusting about those who mentioned "C/C++" as if they're same thing. That using modern C++ prevents many C issues if it's used correctly. Now, I abandoned C++ as anything but a compiler target after all the 90's empirical evaluations showed it was garbage. I think my critique that it lets you shoot yourself in foot easily and is hard to analyse probably still applies like it did when I cited them together. It's why I do. Nonetheless, I honestly don't know how modern C++ developers code when they're doing it "right" with style guides, newer language features, peer review, etc. I think it would be fair in these discussions to do some new, empirical studies comparing proper C++ to Free Pascal, Go, Rust, Ada, etc in various attributes like was done in 90's. Critical that it's used as pro's say it should be so as not to mislead readers about effectiveness (i.e. C++ used like C didn't work). You know any resources I could use to catch up on topic that capture most or all of how pro's do C++ with modern features? Not necessarily most recent standard but what has been used at least past 5 years maybe 10.