Most active commenters
  • pjmlp(3)

←back to thread

118 points mariuz | 12 comments | | HN request time: 0.204s | source | bottom
1. garganzol ◴[] No.45655857[source]
Pascal was the first structured high-level language I learned when I was a kid.

After I learned C and started using it, I noted that I experience five times more memory-related issues in C programs than in an equivalent Pascal code I was writing before.

During that era, Pascal had a remarkable advantage few other languages could match: it used a single-pass compiler that generated machine code as it parsed the source code. No intermediate representations or syntax trees - just a direct translation from source to machine code, all thanks to the well thought-out language syntax invented by Nicolas Wirth. That feature made Pascal compilers incredibly fast.

In turn, it allowed to tighten up a typical development cycle of the day: (edit -> compile -> run) x N times. Given typical CPU speeds of the time, it made a night and day difference. For example, given the same piece of software under development with a comparable number of lines, Turbo Pascal development cycle was about 5 seconds, while Turbo C gave you 40 seconds of a round-trip time at best.

Pascal was the right tool at the right time. Both Apple and Microsoft initially used Pascal to develop their operating systems.

When available CPUs started to become faster and faster, that particular Pascal advantage began to fade out and other languages commenced eating away its market share. Somewhere between 1986 and 1992, software houses were switching to C in flocks.

replies(6): >>45656515 #>>45656649 #>>45656681 #>>45657264 #>>45660151 #>>45660334 #
2. bluedino ◴[] No.45656515[source]
> After I learned C and started using it, I noted that I experience five times more memory-related issues in C programs than in an equivalent Pascal code I was writing before.

I wasted so much productive time learning/writing C for the sake of learning/writing C instead of just doing the work in Pascal back then.

Later on I had the same problem, I already knew Rails but wanted to do Python/Django just becuase.

3. acqq ◴[] No.45656649[source]
Another advantage of Pascal is that the programs written in it crashed much less, which also allowed for a much safe development on the machines of that time which didn't have any "memory write" protections. And safety in development actually translated in less crashy product too.
replies(1): >>45656705 #
4. tasty_freeze ◴[] No.45656681[source]
I first learned programming in Wang BASIC on a Wang 2200 computer (8KB RAM!) in 1978. A year later a "Byte Shop" computer store opened up in town. I didn't have any money, but I would go by and look at the different computers on display and browse their books. While flipping throw a book on pascal, I remember being confused: is this the actual programming language, or is this pseudocode?
5. garganzol ◴[] No.45656705[source]
Pascal is very much like a managed language but without GC or borrow checker. It's not formally memory-safe, but its syntax discourages a developer from playing with fire unless it's really needed.
replies(1): >>45659363 #
6. pjmlp ◴[] No.45657264[source]
Unfortunately it took until cyberattacks started to make an impact on companies budgets, or critical countries infrastructure, for governments and companies to finally realise there was something to programming with straightjacket (the usual criticism from C folks against Pascal back then).
7. pjmlp ◴[] No.45659363{3}[source]
Additionally all the flaws regarding it being designed for teaching and the raise of dialects, were already fixed by 1978 with Modula-2, which Niklaus Wirth than created, with the learnings from Mesa at Xerox PARC.

Later, we also got the managed language genealogy, via Modula-2+ branch, and Niklaus Wirth own Oberon variants, or inspired dialects from it.

Nowadays GCC has Ada, Modula-2 and Algol 68 as official frontend, we have Free Pascal and Delphi.

Then we also have all the other modern ones that somehow got some inspiration out this history.

Thus we as an industry aren't lacking alternatives.

replies(1): >>45660354 #
8. magicalhippo ◴[] No.45660151[source]
> For example, given the same piece of software under development with a comparable number of lines, Turbo Pascal development cycle was about 5 seconds, while Turbo C gave you 40 seconds of a round-trip time at best.

I mentioned it here recently but, we use Delphi at work, the Turbo Pascal successor. A full release build of our main project is about 2 million lines of code, and compiles and links in about 40 seconds on my laptop which has an Intel i7-1260P. A mere compile is of course typically much faster.

I haven't benchmarked it recently myself, but back in the 2000s code generation was quite decent. It was good enough I decided to stop handwriting assembly, as writing compiler-friendly code was significantly faster and much more readable.

9. jacquesm ◴[] No.45660334[source]
This is the reason why there are still people doing new development in Delphi.
10. jacquesm ◴[] No.45660354{4}[source]
Modula-2 is the road not taken for me. It's such a pity that language didn't get the chance that it deserved.
replies(1): >>45662505 #
11. kjs3 ◴[] No.45662505{5}[source]
It sorta did as Ada, tho Ada is a much bigger language than M2 (or Pascal)[1]. There was at least one Ada-83 compiler for DOS (Janus), but it was a tight fit and a miserable experience. To me, the missed opportunity was Modula-3; much of what was nifty about Ada (and other things) in a smaller package.

[1] People often forget how compact a language Pascal (and somewhat M2) is. It comfortable self-hosts on 8-bit machines with a few dozen K (not M) of memory. It does an OK job even on the 6502 (admittedly, p-code). There was even a cross compiler for the 8051.

replies(1): >>45665620 #
12. pjmlp ◴[] No.45665620{6}[source]
I think that D and C# are the right descendents to Modula-3, and many aren't still unaware of how much C# has improved for low level programming tasks.

Unfortunely its adoption window has passed by, although there is a guy keeping it going on Github, from the official Critical Mass compiler that once existed,

https://github.com/modula3/cm3