If only Borland had stuck with Turbo Modula-2 for CP/M (2013)
techtinkering.com
techtinkering.com
TM-2 was awesome, but extremely buggy. I used it on an Altos ACS8000, a 4-user machine that originally ran MP/M and would have been $10-20k new. My dad and me got it used at a computer swap meet for maybe $500. My dad helped me to get CP/M running on the machine, and it was great because it could use some of the extra memory in the ACS8000 as a small ram disk. A few years later, I used TM-2 for all my assignments in AP Computer Science, and it sucked having to work around all the bugs.
I'm kind of wistful thinking about it now, because that was right around the time I began to realize that in classes I was almost always the only female in the room. It led to a lot of unwanted attention and awkward situations. Eventually it led to me changing careers.
I wasn't there, but dots can be drawn. Niels Jensen, Borland founder, and his team created turbo pascal, then added Philippe Kahn to the mix to head the US company. Niels and his team also wrote a Modula 2 and C compiler, but Philippe instead chose to buy Wizard C, and market that as Turbo C instead.
This lead to a split inside Borland, Niels and the rest leaving to form JPI which released their work as Topspeed C, and Topspeed Modula 2.
My speculation is that Modula 2 was killed at Borland as a direct result of the split.
It would have been business malpractice to spend money on CP/M products at that point.
From memory, I used TP and them TM2 on CP/M to run an automated thermoluminescence rig, then FTL Modula 2. I wasn't very professional at the time, but then no-one was - most of us were working in isolation. Speaking from that perspective, I was not very impressed with Modula 2. The issue was not with the fundamentals, but the way that it was case sensitive and forced you to use caps for all the keywords, so that it was really annoying to type. As a lesser issue, the names used for type conversions between numeric types seemed to have no rationale, so they were easy to forget. I don't remember exceptions in TM2, and they would not have been part of the standard language. They appear to have come in with Modula-2+.
The Turbo Pascal compiler was based on the Blue Label Pascal compiler originally produced for the NasSys cassette-based operating system of the Nascom microcomputer in 1981 by Anders Hejlsberg. Borland licensed Hejlsberg's "PolyPascal" compiler core (Poly Data was the name of Hejlsberg's company in Denmark), and added the user interface and editor. Anders Hejlsberg joined the company as an employee and was the architect for all versions of the Turbo Pascal compiler and the first three versions of Borland Delphi.[2]
let size = 8191
let flags = Array.make size false
let prime = ref 0
let k = ref 0
let count = ref 0
let () =
print_endline "Type Return";
ignore (input_char stdin);
print_endline "10 iterations";
for iter = 1 to 10 do
count := 0;
for i = 0 to size - 1 do flags.(i) <- true done;
for i = 0 to size - 1 do
if flags.(i) then
prime := i + i + 3;
k := i + !prime;
while !k < size do
flags.(!k) <- false;
k := !k + !prime;
done;
incr count;
done;
done;
Printf.printf "%d primes\n%!" !count
If one didn't look closely it could easily be mistaken for Pascal/Modula-2. OCaml lifts a lot of imperative constructs directly from that lineage while adding its own FP flavour i.e. immutability by default meaning that mutable values must be ref or array values.Another aspect that OCaml lifts pretty directly from Modula-2 is the engineering of its separate compilation via its module system. By comparing the compiled interface files, a build system like dune or ReScript can figure out the least amount of recompilation needed to build a project from a dirty state.
I thought I knew a lot about Borland's history, but what I didn't know was that the original team left Borland in 1987 to form JPI (Jensen & Partners), headquartered in London, taking a bunch of in-progress code with them that they bought from Borland for $1.7m. JPI made a range of development tools called TopSpeed, which I remember hearing about back then. Unlike Borland's language tools, TopSpeed was a unified compiler backend with a frontend compiler for each language.
JPI eventually merged with Clarion, which made a "4GL" IDE with its own crude Pascal-esque programming language that at one point competed with Microsoft Access, as well as with database-focused IDEs like Microsoft's Visual Basic and Borland's own Delphi. Clarion still exists, though it's now owned by a company called SoftVelocity, and is built on .NET, and looks like it's barely on life support.
Of the original Borland founders, I don't know what happened to Niels Jensen, but Ole Henriksen [1] started a business that designs technology for prefab "pod" houses, and Mogens Glad [2] became a movie producer.
Someone also reverse-engineered Turbo Modula-2 [2], which apparently was the original codebase.
[1] https://vetusware.com/download/Topspeed%20Modula%202%203.10/...
Also it included a demo that run concurrent coroutines on a regular 8086 computer, I think it was a traffic simulator.
Pretty cool stuff!
It's hard to understate how critical Borland was in the shift from the BASIC era of home computing for many users and inexperienced programmers in the 80s and early 90s.
Heh, I just found the product announcement here: http://www.museo8bits.es/anuncios/TurboPascal.jpg
C++ wasn't a popular language until Borland released Turbo C++. Because of the IDE wars of the 1990's, Microsoft answered with Visual C++, and the rest is history.
When I finally started to see Zortech on sale, it was after the Symantec acquisition where they made an agreement with Microsoft to also ship MFC. So why not get the real deal directly from Microsoft.
And G++, GNU C++. I worked on it a little in 1989.
> Stroustrup's pre-compiler
Cfront was a compiler. It output C as object code so it could more easily target different processor architectures, but was no less of a compiler for that.
Sundenly many UNIX customers decided to improve GCC instead of paying UNIX developer licenses.
Make no mistake, I use that syntax when writing SQL, and it's very fitting there because the queries are short and I can't tolerate typos due to lack of a compilation step. But, in case of a compiled language, especially with the advent of syntax highlighting and edit-time analysis capabilities, I find it a nuisance.
I suspect it’s just inherited from ALGOL 68, where you were allowed to use names that coincide with language keywords at the cost of using one of a number of “stropping” conventions[1] to distinguish one from the other: surround each keyword with apostrophes (whence the term) or precede it with a period (if you’re using a single-case character set), type keywords in uppercase (if you’re not), or typeset them in bold (if you’re writing a paper—recall the original ALGOL problem statement was “like pseudocode from our papers but executable”).
ISO Pascal as Wirth originally designed it, only was modern in the sense of being much easier than ALGOL to implement and master, as learning language.
Meanwhile Modula-2 was designed from the start to be a type safe systems programming language, based on Wirth's learnings with Mesa at Xerox PARC.
That sort of thing also makes parsing easier from the compiler side; you can look at the string token and know without context whether or not it's a keyword.
The upper case is all about human readability. I suspect ALGOL's heavy reliance on named keywords (unlike C's more extensive use of symbols) relates to the inconsistencies of character sets etc at the time of the ALGOL's definition.
IMvhO, Turbo Pascal (and Turbo Modula-2) would have been much nicer with a C-like (or Rust-like) syntax.
Disclaimer: I worked professionally in Turbo Pascal for a few years.
<arithmetic operator> ::=
+ | - | ⨉ | / | ÷ | ↑
<relational operator> ::=
< | ≤ | = | ≥ | > | ≠
<logical operator> ::=
≡ | ⥰ | ∨ | ∧ | ¬
Most of these characters were not in contemporary character sets (although some later charsets would have symbols added specifically for Algol after it became more common). Given how much variation there was at the time, Algol designers didn't even try to solve that problem - they simply said that specific implementations of Algol would map the reference representation to some hardware-specific form, to be documented by the implementation. Those hardware representations would often use keywords for some of the operators.(It uses a weird glyph for NOT that I've never seen elsewhere, probably a limitation of typesetting.)
Edit: Interesting to note that the English Electric KDF9's Algol used * at the beginning of all keywords, I suppose that's to simplify parsing, or maybe just to avoid reserving words.
So, for hardware representations, which are all linear lists of characters without formatting, they had to use some kind of escape sequence - https://en.wikipedia.org/wiki/Stropping_(syntax). The term itself comes from the most popular syntax for this, which was to put keywords in single quotes / apostrophes, but there were many other variants, including some identical to how we handle keywords today, as seen from this table.
This approach also allowed for Algol programs to be "translated" to a language other than English in a sense that a representation could be defined that used native words for keywords. This was actually used to some extent in Europe, and especially in the USSR.
Algol-60 itself didn't really have any separate compilation facilities, either, and some language semantics (e.g. call-by-name) complicate matters if you try to tack it on.
Or maybe my memory serves me wrong, and lower-case latin were not cyrillic, but somehow that's what I remember (was long time ago)...
M2 seems like a forgotten language. It was what my intro to CS course was taught in back in 1989, and I really haven't seen much mention of it since.. We used some compiler on Macs that was super flaky. I remember the Macs would sometimes lock solid when compiling M2. I also remember grumbling because Pascal seemed to compile faster on the Apple IIs back in highschool than M2 did on the Macs in college. Thankfully we switched to C on SunOS or Ultrix for the upper level classes.
http://www.cs.oberlin.edu/~jwalker/lisa-legacy/ is some interesting reading on this, but in the end C won.
On the other hand, Ada was mentioned, too. So if Borland would've supported M-2 more, maybe that would've meant that they had supported another standardized language later on, instead of further messing with Pascal.
Picture the Delphi IDE with Ada95.
(As much as I like both Modula-3 and Oberon, I picked the more likely candidate for this alternate reality. The one where they're all beaten by Visual SAIL is further down the weirdness ladder.)
The million dollar question.
More seriously, I love Pascal and similar. My first two books were Algorithms + Data Structures = Programs (Pascal) and Algorithms and Data Structures (Modula 2), both by Nicklaus Wirth.
Use Turbo Modula-2 Instead of Turbo Pascal Under CP/M? (2013) https://news.ycombinator.com/item?id=16704733 [2018, 21 comments]
Also interesting:
Turbo Pascal: A Great Choice for Programming Under CP/M (2013) https://news.ycombinator.com/item?id=25956128 [2021, 115 comments]
https://github.com/modula3/cm3
There are binaries for various architectures.
It shows the path of having GC enabled systems programming languages, which also offers all features at C++ level (minus template metagramming and macros), and how we could already be there in the early 1990's, had it not been for the Compaq merges messing it all up.
I recall there were multiple Modula-2 implementations for the PC at the time. The one I used didn't have as much PC-specific access as Turbo Pascal (at the time, I had my own libraries for video RAM direct writes, mouse, etc., and GUI I'd built atop that).
And the Modula-2 language felt a bit clunkier to use, since I was favoring terseness on 80x25-character screens at the time.
Where Modula-2 and pedagogy around interface vs. implementation in team software engineering class paid off, for me, was that I became a professional C programmer right after, and some of those practices enforced by Modula-2 were a useful perspective to bring to cross-platform Unix .c and .h files at the time.
Additionally, my primary school had an Apple IIe, on which I would sometimes use CP/M. My Amstrad CPC464 could run CP/M, too.
Its crazy to think we can't really get a C compiler in our pockets, now, as easily as we once did.
The reason for these 2 statements are...? Because I fail to see their purpose.
> The reason for these 2 statements are...? Because I fail to see their purpose.
The first is to display the prompt "Type Return" (think of it as "Hit enter to continue").
The `readln(ch)` waits for the user to hit the return key. Without the readline, the prompt will be displayed and the program will continue without waiting for the user to press return.