[HN Gopher] If Only Borland Had Stuck with Turbo Modula-2 for CP...
___________________________________________________________________
If Only Borland Had Stuck with Turbo Modula-2 for CP/M (2013)
Author : nope96
Score : 70 points
Date : 2022-07-31 19:32 UTC (3 hours ago)
(HTM) web link (techtinkering.com)
(TXT) w3m dump (techtinkering.com)
| [deleted]
| krallja wrote:
| (2013)
| sedatk wrote:
| 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.
| mananaysiempre wrote:
| > [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)
| sedatk wrote:
| That might as well be the case, but Wirth did Pascal eight
| years before Modula-2, yet the former feels way more modern.
| yarg wrote:
| > 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.
| FullyFunctional wrote:
| 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.
| int_19h wrote:
| 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.
| int_19h wrote:
| 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!
| xioxox wrote:
| 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.
| [deleted]
| bruce511 wrote:
| >> 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.
| pjmlp wrote:
| Martin Odersky of Java generics (Pizza compiler) and Scala
| fame, worked on Modula-2 compiler at Borland.
| dbrower wrote:
| 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.
| pjmlp wrote:
| 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.
| tengwar2 wrote:
| 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+.
| FullyFunctional wrote:
| So? TP real success came with the port to DOS, but TM2
| couldn't have been much harder to port.
| bonzini wrote:
| 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.
| pjmlp wrote:
| 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.
| FullyFunctional wrote:
| 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>
| ThinkBeat wrote:
| (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]
| tomcam wrote:
| The PC Turbo Pascal compiler was written in assembly by Anders
| Hejlsberg, of C# and Typescript fame.
| neilv wrote:
| 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.
| int_19h wrote:
| 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?
| mrlonglong wrote:
| 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?
| atombender wrote:
| 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/
| MrMan wrote:
| clarion was good
| mrlonglong wrote:
| 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.
| atombender wrote:
| 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
| nope96 wrote:
| 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]
| yawaramin wrote:
| 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.
| linspace wrote:
| > 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.
| mananaysiempre wrote:
| Pascal and Modula-2 themselves are by Wirth as well :)
___________________________________________________________________
(page generated 2022-07-31 23:00 UTC)