Live data from Hacker News

Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

techtinkering.com

31–40 of 118 posts

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#31
post #9

I really wonder how Pascal and the Pascal family of languages, including modula/oberon and ada, how they became niche and how java and c++ took over the world?

My theory is that programmers love complexity and gravitate to more and more complex things over time. If something is complex and never complete your job is assured to be there tomorrow. C++ has a performance advantage but Java and C# do not.

All the languages that are “strangely popular” have had major backing from a global/multinational company.

It’s not a meritocracy driven development, it’s marketing 101.

Go is to Google what Java is to Sun/Oracle. History is repeating but we can’t really fight it because it would be a wasted effort.

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#32
post #27
post #25

Earlier quoted context omitted.

Easy answer, UNIX mass adoption. Long answer, UNIX spread like fire, because Bell Labs/AT&T initially weren't allowed to sell it. So the code was given to university, and while they needed to pay for a UNIX license to use it, the price was symbolic versus paying for something like VMS. Which naturally made UNIX the number one choice for the startups trying to get into the Workstation market during the 90's. So C star…

It also didn't help that Berkeley Pascal for BSD was terrible. Made a subroutine call for every subscripting operation. This discouraged using Pascal on UNIX.

Really? Yeah Pascal UNIX compilers were quite bad.

When I got into university, I had my first set of Pascal classes on UNIX.

Coming from a background of multiple Turbo Pascal versions, I was on TPW for Windows 3.x by then, I was dismayed having to do university assignments in P2C, using original ISO Pascal (it wasn't even capable of the ISO Extended version).

So no wonder that Pascal on UNIX hardly got any love.

I think only HP-UX and VMS Pascal variants were actually relatively good.

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#33

The first software "product" that I sold was created using Turbo Pascal running on DOS. I was in high school at the time. It was designed for an Orthodontist who wanted to input (using a tablet with a cross-hair "mouse") about 20 points from an X-ray of a patient's head, then perform some calculations on the geometry to predict how the jaw bones and teeth were going to develop as the patient gets older. To this day I…

I hope you won't take my curiosity badly, what made this first project so much better ? it seems interesting but short in perimeter too. Was the rest of your career dulled by politics and large projects management to the point of making the work sluggish and boring ?

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#34
At sometime around 1976 Pascal was The Language of the Future. There was some project to program an OS with Pascal in Helsinki, possibly the Russian MIR-computer. Anyways I heard a heated discussion where they wanted money for "tens of man-years". Very annoying, so I wrote Pascal-compiler for 8080 just like that in few months. It was little restricted but quite usable. Then Very Strange Thing happened: the Finnish Army wanted it, maybe because it was not hampered by American Comecon-embargo and better than nothing (or assembler). I was ordered to write a short manual and forget all about it. Not a big deal, it was just a demo, and I was already interested in some other things.

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#35

Turbo Pascal is great and I love the fact that it uses the Wordstar key combinations. I wish that there was a version for 8080 but I understand why they went with the Z80. Borland went on to create Turbo Modula-2 for CP/M which was very similar to TP but with lots of language enhancements and faster execution time of the resulting binaries. However, it was released quite late in 1986 and quickly withdrawn.

It's been a long long long time since I heard anyone opining one way or the other on the classic 1970s dilemma of whether to stay compatible to the 8080 or use all those cool new Z80 instructions considering that the Z80 was kicking Intel's butt in the 8 bit CPU market!

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#36

The first software "product" that I sold was created using Turbo Pascal running on DOS. I was in high school at the time. It was designed for an Orthodontist who wanted to input (using a tablet with a cross-hair "mouse") about 20 points from an X-ray of a patient's head, then perform some calculations on the geometry to predict how the jaw bones and teeth were going to develop as the patient gets older. To this day I…

I used to feel this way, and I wanted to rekindle the fire I felt when I was younger and absolutely in love, mesmerized with writing software. After a few years of that, I went into the professional world, and can relate to how you and others in this thread feel, about the dullness and lack of satisfaction. I remembered those times, though, and I kept looking for something to do.

I realized what the difference was: Back then, I was programming for myself, for the enjoyment of it. I was dogfooding everything, at times I was not only the top user, but the only user of my software.

So I went back to doing that, and I can happily report that I feel that way again. It can be done, don't give up hope.

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#37

Pascal remains my preferred programming environment. Though a bit buggy, and short on documentation, Lazarus/Free Pascal makes quick work of any forms based windows application. I worked through the entire Advent of Code 2020 exclusively in Pascal.

https://github.com/mikewarot/Advent_of_Code_in_Pascal

In case others would like to skip the trip through mike's blog ;)

I'm surprised at how modern a lot of the code feels.

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#38
post #11
post #8

Hmm, I started reading the Wikipedia article on the Pascal programming language. I was reading about the pointer types and saw a 'with' statement... Where did I see something like that before?... Yes, JavaScript! Where it is highly discouraged to use. How is it like in Pascal?

It is discouraged in Pascal as well. Can give really nasty surprises with scoping / debugging. Well to me it is mostly gossip as I refuse to use WITH in my Pascal code so no practical experience.

[deleted]

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#39
post #8

Hmm, I started reading the Wikipedia article on the Pascal programming language. I was reading about the pointer types and saw a 'with' statement... Where did I see something like that before?... Yes, JavaScript! Where it is highly discouraged to use. How is it like in Pascal?

C++ class scopes have the with problem.

   class foo {
     // int x;
     int y;
     int bar();
   };

   // in another file

   int x;

   foo::bar()  // "with whole friggin class scope ..."
   {
     return x + y;  // global ::x plus class member y
   }
Now uncomment the x in the class declaration, and the x + y now adds two class members.

Re: Turbo Pascal: A Great Choice for Programming Under CP/M (2013)

#40
post #11

Earlier quoted context omitted.

It is discouraged in Pascal as well. Can give really nasty surprises with scoping / debugging. Well to me it is mostly gossip as I refuse to use WITH in my Pascal code so no practical experience.

It’s different in Pascal l, iirc: in JavaScript with has dynamic scope in and affects every function you call inside the work statement; in Pascal, it has lexical scope. I used it all the time in Delphi and don’t recall any real issues.

The Pascal/Modula-2 WITH statement brings all of the members of a record into the lexical scope, without them being mentioned in the statement (i.e. implicitly).

So when you add, remove or rename members of a record, you are potentially influencing the contents of scopes in other files all over the project. You can cause variable shadowing that way.

   VAR
     B : INTEGER;

   WITH ^P DO
     A := B;  (* B is just a local, A is a field *)
   END
If B is added as a field, the above suddenly means ^P.A = ^P.B.

Any time you edit a Modula-2 record, you have to search the program for all the places where its type may be targeted by WITH.

Probably if you stick to some rules, like never using WITH on another module's record type, you will be fine.

Diagnostics related to shadowing could help.

Post reply on HN