Hacker News new | past | comments | ask | show | jobs | submit login
If only Borland had stuck with Turbo Modula-2 for CP/M (2013) (techtinkering.com)
133 points by nope96 on July 31, 2022 | hide | past | favorite | 88 comments



I purchased TM-2 from Echelon in 1986. I was a minor, so I went to Echelon's office in Los Altos and paid cash for an 8" floppy.

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.


We (the tech industry) have lost so many great people by being an uncomfortable/unsafe place for a lot of people. In 2022 we’ve come a long way, but it doesn’t take long just flicking through HN to see how much further we have to go.


This is because of society. When the boys' clothes are blue and the girls' are pink the society has a problem.


8 inch floppies in 1986? My recollection was that the 5¼ inch floppy was ubiquitous with 3½ inch floppies as the up and coming next-generation technology.


8-inch floppies were actually quite common in the mid-80's on machines such as the OP described. I've still got a few stashed in some archives somewhere, with old code I wrote. I shudder to think the effort required to use those floppies again somehow, though .. not exactly the same dilemma I face with the drawer full of Iomega JAZ and ZIP drives, though .. :P


You might want to copy that stuff ASAP if you haven't done so already, because it's not going to get any easier to read in the future. Both due to age of the media itself and the weird formats involved, for which reading equipment is starting to get quite rare and hard to find.


I'm a "collector" in that I bought the stuff originally and never got rid of it. I recently purchased a FC5025 from device side data. With Apple ][ disks from early 80's, I had about a %50 rate of reading them successfully. It's even worse on my TRS-80 cassettes.


This gets me in the feels. What career did you change to?


Sorry to hear about the unwanted attention and awkwardness, and having it push you onto a different path.


>> Why TM-2 made such a fleeting appearance is shrouded in mystery. It was released in 1986 by Echelon under license from Borland and then quickly withdrawn.

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.


(wikipedia)

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]


Martin Odersky of Java generics (Pizza compiler) and Scala fame, worked on Modula-2 compiler at Borland.


Part of it is that by 1986, CP/M was dead for new development of anything, and Modula-2 was also on fumes.

It would have been business malpractice to spend money on CP/M products at that point.


Depends on the country. In the UK, the Amstrad 8256 and 8512 were very popular, and they were only launched in 1985. They were much cheaper than PCs of the time, and came with wordprocessor package and CP/M 3.0. We had about 25 of them in our lab, including one floating at 4000V in a perspex cage, used to control a C14 accelerator.

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+.


They were very nice machines. I wrote my first useful programs on these using Mallard Basic to help with my school work. The word processor was really powerful too. I would have turned in my schoolwork using this too but that was unheard of at the time.


There were a couple of Modula-2 vendors for MS-DOS and Amiga. It was TP on MS-DOS, Object Pascal on Mac OS and stuff like BASIC compilers on the Amiga side that made them lose market share.


So? TP real success came with the port to DOS, but TM2 couldn't have been much harder to port.


They probably reused a lot of ideas in Turbo Pascal 4.0. It had units which were very similar to Modula 2 modules, except that interface and implementation were in a single file.


Most of those ideas come from USCD Pascal, and the later Object Pascal introduced in Turbo Pascal 5.5 came from Apple's Object Pascal, which was derived from Clascal and developed in collaboration with Wirth.


Probably, but there were many other language differences in Modula-2 that made it a better language. I suspect the real reason was the usual one: inertia. A lot more people knew Pascal and thus more bought TP than TM2. <something something about technical merit and popularity contests>


The PC Turbo Pascal compiler was written in assembly by Anders Hejlsberg, of C# and Typescript fame.


Personally, I always have the opposite feeling; C# and Typescript was written by Anders Hejlsberg of Turbo Pascal and Delphi fame.


Second vote for me. While C# may have the greater 'head count' in usage now. TP and Delphi were ground breaking, revolutionary products IMHO.


Voted with delight because that’s precisely the way I feel. But I’m trying to make it easy for HN’s young whippersnappers to relate ;)


I can't vote but supporting as third :-).


This is the history as I remember it too. IIRC Topspeed C was an excellent compiler.


Just for fun, here's the Modula-2 example converted into OCaml in a few minutes of effort:

    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 love reading about the history around legendary companies like this. I was an avid Turbo Pascal user starting in 1990 or so. This sent me into a rabbit hole of research.

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.

[1] https://www.linkedin.com/in/ole-henriksen-a731323a/

[2] https://www.linkedin.com/in/mglad/


I actually worked with TopSpeed Modula-2 to develop software for air traffic control training simulators in the late 90s. Interesting language, wouldn't mind finding a copy to play with in my MS-DOS VM some day.


I found a version of Topspeed Modula 2 from 1993 [1], which is after the JPI-Clarion merger.

Someone also reverse-engineered Turbo Modula-2 [2], which apparently was the original codebase.

[1] https://vetusware.com/download/Topspeed%20Modula%202%203.10/...

[2] https://github.com/Oric4ever/Turbo-Modula-2-Reloaded


Thanks, I'm playing with that on my MS-DOS VM now.


The TopSpeed Modula-2 compiler was fast and the IDE was pretty interesting, you could customize almost anything, far beyond what the Turbos from Borland offered.

Also it included a demo that run concurrent coroutines on a regular 8086 computer, I think it was a traffic simulator.

Pretty cool stuff!


Borland seemed to be in flux in the year or two prior to the split. Turbo Prolog was hyped and then seemed to disappear (although I'm pretty sure it shipped a version or two), Turbo Pascal was advertised for the then-new Amiga 1000 and never shipped.

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.


> Turbo Pascal was advertised for the then-new Amiga 1000 and never shipped.

Heh, I just found the product announcement here: http://www.museo8bits.es/anuncios/TurboPascal.jpg


I didn't know this, nice to dream if there was a successful and widespread Turbo Pascal for Amiga how things escalating differently. Like an early Delphi maybe. Basic never made a real hit on Amiga platform, probably Amos was the only product resembling kind of Turbo Pascal and widely utilized by users but it was too shallow and slow for the era.


clarion was good


Borland doesn't enough credit (or blame, depending on your opinion about C++) for popularizing C++. Turbo C++ was the first mainstream C++ compiler. All that existed before was Cfront, Stroustrup's pre-compiler which translated C++ to C.

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.

[1] https://cplusplus.com/info/history/


> All that existed before was Cfront,

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.


GNU compilers were largely ignored until Sun made the first step, followed by other UNIX vendors, to split UNIX worloads into user and developer packages.

Sundenly many UNIX customers decided to improve GCC instead of paying UNIX developer licenses.


I recall X11R3 went so much faster compiled with gcc that everyone _had_ to get a copy. That was on 68000 though; I think gcc wasn’t so good on RISCs with branch delay slots for a long time.


Zortech C++ was first


That wasn't a mainstream compiler, and certainly wasn't the reason for Microsoft responding with Visual C++, or C++ becoming popular.


It might have been, yet it was nowhere to be found on most European countries. It was Borland vs Microsoft all over the place, then we got Watcom and MetaWare High as well.

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.


Walter Bright (the author) posts here from time to time, I swear he made a comment before with the background of each of the major C++ compilers


Yeah, the D guy


For a brief period of time, Visual J++ was the best Java IDE around.


Its soul lives on C#, even P/Invoke was already in J++.


I dislike Modula-2's full upper-case reserved word syntax. I understand the reasoning behind it: to make language constructs consistent and stand out more, but then, upper-case is harder to read.

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.


Uppercase for keywords was a fairly common style at the time even in languages where they were case-insensitive (e.g. Pascal, BASIC, dBase). Which makes sense when you consider that syntax highlighting was still several years away, and it would take even longer for it to become widespread. Turbo Pascal wouldn't get syntax highlighting until version 7.0 - that's 1992!


Turbo Pascal for Windows got it first.


> [The reasoning behind] Modula-2's full upper-case reserved word syntax [is] to make language constructs consistent and stand out more

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”).

[1] https://en.wikipedia.org/wiki/Stropping_(syntax)


That might as well be the case, but Wirth did Pascal eight years before Modula-2, yet the former feels way more modern.


Not really, unless you're talking about Extended Pascal or the several dialects.

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.


I could be completely wrong on this one, but Pascal not caring about case would've made it more available on machines where lower case was not available, but taken for other needs (like cyrillic). Not sure if it would've made difference (given the COCOM and Eastern Block), but my Apple ][ clone had cyrillic instead of lowercase letters...

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)...


Yes, that's called KOI-7.


Thank you so much, specifically I think I've had this on my Pravetz 8C (Apple ][/e clone) - https://en.wikipedia.org/wiki/KOI-7#KOI-7_N2


Personally, I don't use it even in SQL if I am starting from a clean slate...


> to make language constructs consistent and stand out more

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.


Nope, compilers couldn't care less - it's much faster to hash keywords into the symbol table and just do a single lookup.

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.


Algol (both 60 and 68) had various representations. The reference one, used in the spec, would use formatting to indicate things such as keywords, and used the conventional mathematic and engineering symbols where they were appropriate. Here's a bit of Algol-60 grammar:

   <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.


Here's a table in a 1966 book showing the different keywords across implementations: https://archive.org/details/breuer-dictionary-for-computer-l...

(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.


Algol-60 didn't actually have the notion of keywords as such in the modern sense. The language grammar treats stuff like "if", "for" etc as fundamental terminal symbols without specifying how they're to be parsed distinctly from identically spelled identifiers. Each representation is supposed to come up with a way to make that distinction; for example, the reference representation uses bolding and/or underlining to distinguish keywords.

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.


That not symbol looks like a stand-in for ¬. Nearest I can find is: https://en.wiktionary.org/wiki/⁊ (Tironian et). If that is the case it's amusing that it actually means "and".


looks exactly like U+29A2 https://en.wikipedia.org/wiki/Miscellaneous_Mathematical_Sym... Turned angle to me


Early character sets were indeed very limited and inconsistent in many ways, which contributes to the keyword-heavy style of many early languages. (The other factor behind it was the sheer amount of features that were provided by the language itself, as opposed to library code; minimalism was not generally favored. This in turn encouraged "fancy", hard to parse syntax for those custom features.)


It’s not hard to see the reason - bolting on a feature in the compiler is way easier than implementing a language that allows stuff like this to be implemented in a library. I imagine that memory limitation also contributed to those decisions.


The very concept of "library" would take a while to evolve. The first ones were literally libraries: you'd come, browse to find code for the algorithm you need, and reuse that code - by manually copying it.

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.


Why did Turbo Modula-2 produce a binary that was 3x as fast as Pascal? Is M2 more suitable for aggressive optimization? Was the M2 compiler just better, with the tradeoff of a much longer compilation time (9x)?

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.


Back then there was a war between Pascal-derived (eg Modula2) languages and C-derived languages.

http://www.cs.oberlin.edu/~jwalker/lisa-legacy/ is some interesting reading on this, but in the end C won.


If you're reading the magazines of that time period, you'll find a lot of Modula-2 exposure as some regarded it as the next step in the language's evolution (and a more standardized one than Pascal).

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.)


There were other Modula-2 compilers for CP/M. I used Hisoft FTL Modula-2 quite a bit on my Amstrad PCW to get a speedup from Mallard Basic.


> Should I Switch From Turbo Pascal to Turbo Modula-2?

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.


Pascal and Modula-2 themselves are by Wirth as well :)


Previously posted:

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]


Even better, imo: Modula-3

https://github.com/modula3/cm3

There are binaries for various architectures.

https://github.com/modula3/cm3/releases/tag/d5.11.4


If one can get hold of the Modula-3 books I would advise it.

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 don't recall ever seeing the branding "Turbo Modula-2", but I'd been a Turbo Pascal fan (even owned Turbo Pascal original 8-inch floppy for generic MS-DOS, and used it on an 3.x MHz 8086/8088 that had no PC BIOS), and used Modula-2 in school.

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.


Modula-2 had somewhat more verbose syntax for derived types (e.g. POINTER TO X rather than ^X), but given that it didn't require a BEGIN for every END, wouldn't it be more terse vertically overall?


Uncle used Module-2 to write simulators or a calculator for air venting of tunnels or something like that. I think that software was used until the late 90s, early 2000s. He was even updating it after his retirement :)


This hit me right in the nostalgia feels. I used Turbo Pascal and Turbo C heavily in high school and university. The computer science faculty at my university had their own modula-2 compiler (gpm) so many of our assignments had to be done in modula-2. I would have loved a TPM-2.

Additionally, my primary school had an Apple IIe, on which I would sometimes use CP/M. My Amstrad CPC464 could run CP/M, too.


Same, nostalgia-wise. I still have my old Atari Portfolio with the Turbo C compiler onboard, it is easily one of my most treasured nerd artifacts, given that I wrote thousands of lines of code on the thing and used it to become a skilled C developer ..

Its crazy to think we can't really get a C compiler in our pockets, now, as easily as we once did.


If they'd kept Modula-2, the fact that I learnt Modula-2 for my degree in the 90's might be worth something.


34KB vs. 142KB was a huge difference at a time when 64KB was the standard addressable space.


I just did some googling and it turns out Borland did do a version for MS-DOS but it was sadly never released. Dare I hope it's still out there somewhere waiting to be out in a museum?


Quote: "writeln('Type Return'); readln(ch);"

The reason for these 2 statements are...? Because I fail to see their purpose.


> Quote: "writeln('Type Return'); readln(ch);"

> 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.


you know what your answer is like? the same like asking for "where can I find water?" when in a dessert and you answer with "the Ocean". Technically correct, but totally missing the point.


(2013)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: