5 ms·
What ever happened to Modula-2?
- OnlyMortal 3y agoIf memory serves, JPI did a Modula2 compiler that looked quite a bit like Turbo Pascal. http://www.edm2.com/index.php/TopSpeed_Modula-2 http://www.edm2.com/index.php/TopSpeed_Modula-2
- kcartlidge 3y ago> If memory serves, JPI did a Modula2 compiler that looked quite a bit like Turbo Pascal. There was. I bought (and used) it twice back in the day. It was fast, simple, clean, modular (as you'd expect), and the IDE was the best IDE ever - in relation to its power/performance vs the machines it ran on at the time, obviously, not in absolute terms. For the Pascal influence you only need to look at the career of Anders Hejlsberg of C# and TypeScript fame. Plus Free Pascal and Lazarus are (arguably) the best modern-day cross platform native desktop software development tools (like an open source cross-platform Delphi).
- olliej 3y agoAh ha, I knew I had a “turbo” modula-2 but remembered it wasn’t actually Borland, but couldn’t remember anything else about so didn’t know what to google right now. Thanks for digging it up!
- jll29 3y agoModula-2: The Book https://www.modula2.org/downloads/wirth-modula2/Wirth_Modula2.pdf https://www.modula2.org/downloads/wirth-modula2/Wirth_Modula... Mostly Unknown: There was Actually a Turbo Modula-2 (by Martin Odersky for Bordland) https://www.cpcwiki.eu/imgs/6/64/Borland_Turbo_Modula_2.pdf https://www.cpcwiki.eu/imgs/6/64/Borland_Turbo_Modula_2.pdf
- polotics 3y agois it just me or does this website not copy the Metafilter theme?
- pjmlp 3y agoNowadays available as a standard GCC fronted, since GCC 13. Now we only need a good VSCode plugin for it to be rediscovered by younger generations.
- trealira 3y agoBut nowadays, why would anyone use Modula-2 today and not Rust, C++, Go, or basically any other programming language?
- phicoh 3y agoAs an undergraduate I had to use Modula-2 in the first year programming courses. It was a decent language for teaching programming, but I don't recall anybody who liked it. Those in systems programming quickly switched to C the next year. It may still be useful for teaching. Low level enough that you can teach memory allocation, etc. Simple enough that you can cover most of the syntax in an introduction course.
- trealira 3y agoThat's fair. I taught myself to program using C, and C's conflation of pointer parameters with arrays, and its declaration syntax, confused me at first. And I also ended up with more unexplained glitches segfaults in the beginning due to arrays not being bounds checked. It might have been easier to start with something like Modula-2 in the beginning.
- pjmlp 3y agoGiven that Zig is basically Modula-2 features packaged in C like syntax + compile time execution, or languages like Odin do exist, there is still a group that finds such kind of languages interesting. So then do we reuse code that was been scattered around since 1978 and give it new life, or start from zero, yet another language for systems programming with manual memory management, while being safer than C? Kind of philosophical question.
- randcraw 3y agoIsn't the answer to that question ISO/Object Pascal? Modulas 2 and 3 had too little inertia along pretty much the same path as OP to outcompete it.
- WillAdams 3y agoI thought the answer would have been Oberon: https://projectoberon.net/ https://projectoberon.net/
- esafak 3y agoIt lives on in nim.
- kombine 3y agoAnd D.
- fifticon 3y agoThere were dozens of us!, using M2. I used it on Amiga. It was sort of ironic. I wanted to use C - I guess. But this was pre-internet, pre-university, pre-city. The nearest people to network C with, were cows on the neighbours farm - there weren't any.. I had two C compilers, but no text or people to tell me that you needed to link, what linking was, and in particular, the commandline arguments to do so.. In this world, modula-2 was a godsend. It had a clear type system, clear type definitions, readable error messages, and logical/intuitive tooling, which meant a school kid could figure out how to operate it by themselves. So for a couple of years, I would replicate in M2,what others did in C. I eventually met an environment where I could learn C, but modula2 allowed me to start early.
- cmrdporcupine 3y agoYep, this was me with the Atari ST. It was tough, though, the ST's OS really was written with C in mind. Lots of void pointer action which Wirth languages really didn't get along with.
- ghewgill 3y agoBack in the late 80s, the first "real" compiler I had was Logitech Modula-2 (yes, they used to sell stuff other than mice). Even then, Turbo Pascal 3 felt like a toy. Modula-2 was the real thing. And it was slow! Granted that was on an 80286, but the compiler was slow. (The generated code was fine.) I had used a different flavour of Pascal previously, but Modula-2 felt right. I liked the case sensitivity compared to Pascal's ambivalence. I liked the strong typing with clear differences between signed and unsigned integers. I liked the better block structures that omitted Pascal's "begin" keyword. I liked the way modules were organised. What happened to Modula-2, in my case, was Turbo Pascal again. I got a job, where we used Turbo Pascal 4. Then 5, and then 5.5 which introduced single inheritance OOP. Then we needed to migrate to this new fangled "Windows 3.1" thing, which at the time we chose C++ and MFC. I stuck with C++ for many years and never went back to Pascal (which evolved into Delphi, successful in its own right). I think in the broader sense, C++ happened to Modula-2. In the early 90s, C++ was the hot new thing and people were using either that or C. The next shakeup had to wait until Java in the mid 90s.
- rcarmo 3y agoI learned Modula-2 in college 30+ years ago (hot on the heels of Pascal, which I used for Mac development), and actually sort of liked it, but C was king across VAXen and UNIXes, so I went that way and never looked back. I am still pretty amazed at the size and performance of Pascal-like compilers, and still smile whenever I come across ancient code with Pascal calling conventions, but am also sort of happy I don't have to type BEGIN and END ever again (or brackets--I became a Python and LISP fan). I have to wonder if there is anything _as good_ from a compiler perspective but with a nicer syntax.
- densh 3y agoIn my opinion Go is the most Pascal like language that exists today due to fast compilation speed and extremely opinionated pursuit of oversimplifying the language at the detriment of usability.
- akira2501 3y ago> extremely opinionated pursuit of oversimplifying the language at the detriment of usability. Subjective usability. Objectively, the language is quite usable, and many people even prefer it over the many other choices otherwise available to them.
- bitwize 3y agoGo has the nice quality (shared with Pascal) that it pretty much sticks to being a set of computer instructions, which means when you read Go it's easy to understand more or less exactly what the computer is doing. Great for auditing. Not so great for building large systems as abstractions over types.
- akira2501 3y ago"Not so great for building large systems that are hard to audit due to the level of type abstraction they have access to." I'll give you that the lack of extensibility is sometimes a unique frustration among programming languages, but this design choice was intentional, and you've incidentally highlighted that, I think.
- WalterBright 3y agoC++ killed it. One of the compiler writers for it ruefully told me that they backed the wrong horse, that I was right in picking C++ to do.
- Rochus 3y agoC++ is much more powerful; but C++ could have added modules thirty years earlier.
- WalterBright 3y agoC++ should have copied D's module design!
- inkyoto 3y agoI would ascribe it to the paradigm shift – C++ was the executor, but the advent of the object-oriented programming was the instigator. By the time Modula-2 appeared in the mainstream, «C with classes» (later C++) had already been begot, and it brought about a major change in the industry. Modula-2, on the other, delivered useful, but evolutionary and not revolutionary enhancements to the ageing procedural programming paradigm.
- wrs 3y agoCirca 1990 we seriously considered doing Newton OS in Modula-3 [0], which had all the things…modules, generics, exceptions, GC, etc. But we ended up taking a chance on C++ (in the form of CFront). Modula-3 was very cool, though. [0] https://www.cs.purdue.edu/homes/hosking/m3/reference/intro.html https://www.cs.purdue.edu/homes/hosking/m3/reference/intro.h...
- __d 3y agoI don't think I've ever heard that before -- was there an ARM compiler available? Did DEC have any involvement? Did you do any prototyping?
- wrs 3y agoThis was before we switched to ARM. We would have had to make a compiler/runtime for the AT&T Hobbit processor (or get DEC interested in doing it). (Hmm, maybe this was 1989 not 1990.)
- Rochus 3y agoWhere come Dylan and NewtonScript into play?
- wrs 3y agoDylan (then known as Ralph) started with the acquisition of Coral Software, a year or two after the big language search. We started building the kernel in C++ then, and later the “Junior” project (i.e., the one that finally shipped) did the whole thing in C++ with NewtonScript on top. There was also a brief period pre-Junior when I advocated using C++ with Smalltalk on top. Newton did not have a very linear project history. :)
- Rochus 3y agoThanks. Just found this paper: https://dl.acm.org/doi/pdf/10.1145/217838.217844 https://dl.acm.org/doi/pdf/10.1145/217838.217844. Very interesting. Why didn't Dylan and Smalltalk make it, i.e. in which respect was NewtonScript better? Was the latter natively compiled or interpreted?
- johnaspden 3y agoJPI Modula-2 was my first proper compiler on my childhood PC! I loved it, it was nicer to use than either Turbo Pascal or C. I actually bought my first ever hard disk (a mighty 10MB as I remember, more storage than I'd ever be able to use), for something like £200, an absolute fortune to an adolescent in 1986, just so that I could install modula-2 permanently in the machine and could stop swapping compiler floppies and program floppies all the time. But when I first got access to UNIX boxes as a postgrad there was C but no Modula-2, so I switched to C, which could do everything Modula-2 could do except it was a bit more fragile and treacherous.
- mikewarot 3y agoPascal was an amazing simplification of ALGOL, but then Wirth went too far, and Modula-2 was worse, not better, as the wild success of Turbo Pascal showed. Then Borland was deranged, and Microsoft was able to tempt Anders Hejlsberg to the dark side. Their derangement resulted in C++, and eventually .NET, a lose-lose-lose situation.
- Jtsummers 3y agoYou mean C#, right? C++ (and MS's adoption of it) predated Hejlsberg's move to MS by quite a bit. He worked first on J++ (for which MS got sued) and then C#.
- fuzztester 3y agoAnd then on TypeScript.
- billforsternz 3y agoC# not C++ I think
- int_19h 3y agoIt's very much arguable whether Pascal was simpler than ALGOL 60 (of which it is a derivative via ALGOL-W), given that it has a much more complicated type system. I mean, A60 didn't even have pointers and records. The only thing I can think of that it did have but Pascal did not is pass-by-name and labels as values. The wild success of Turbo Pascal was due to it adopting many concepts from Modula (units, most notably), and then the decision of Borland to stick with it rather than doing Modula-2 for brand recognition reasons. I can't think of any particular reason why Modula-2 is worse than Pascal, though. It's pretty much Pascal with all the necessary bells and whistles to do proper systems programming like C, and a somewhat shorter syntax (thanks to dropping BEGIN).
- pjmlp 3y agoUnits came from UCSD Pascal.
- threecheese 3y agoMy 1994 freshman Intro to Compsci was a Modula-2 course, and seeing it here for the first time in 30 years has reminded me of what acute anxiety feels like :) That class scared me right into the humanities for a few years.
- skissane 3y agoIBM used Modula 2 to write parts of OS/400, the operating system of the IBM AS/400 – nowadays the operating system has been renamed to IBM i, (in part) since it now runs on identical POWER hardware to AIX. (At first, when they moved to RISC, they shared CPUs with the RS/6000 but had their own servers with incompatible firmware, only later did they unify the server lines and firmware so the same servers could run either operating system.) In the original CISC version of the OS/400, the operating system kernel was mostly written in a PL/I dialect called PL/MP, but parts were also written in Modula 2. As part of the transition to RISC (PowerPC), large parts of kernel code were rewritten in C++ – although a significant quantity of PL/MP survived the rewrite, and a smaller quantity of Modula 2 – and apparently, to this day, some components of the IBM i operating system are still written in Modula 2. My impression is, they wanted to replace PL/MP with a more mainstream language, and so started rewriting the PL/MP code in Modula 2. However, once it became clear that Modula 2 wasn't taking off, they switched to rewriting it in C++. But, typical "lava layer" anti-pattern, [0] all three of the original, the old rewrite and the new rewrite survive. [0] https://mikehadlow.blogspot.com/2014/12/the-lava-layer-anti-pattern.html https://mikehadlow.blogspot.com/2014/12/the-lava-layer-anti-...
- butterisgood 3y agoI’d like Active Oberon to be more broadly applicable. A2 is a pretty neat system. But using it outside the environment it comes with feels a bit crazy! (Same with all Oberon’s I’ve played with) Sometimes things become over-opinionated to be generally useful perhaps?
- pjmlp 3y agoI usually come up with an Oberon fan, although I also dislike Wirth's pursue for minimalism that started with Oberon, ending with Oberon-07. I also feel that Active Oberon is the best Oberon that came out from the Oberon linage. Yes Oberon is like Smalltalk and Lisp Machines, without the environment, it misses a lot.
- gtirloni 3y agoI was learning Modula-3 on my own back in the late 1990s and it was great. Sadly, the CS professors were caught in a Lisp vs C war at the time.
- RachelF 3y agoThe commercial PC/DOS compiler was a terrible buggy mess. I had the misfortune to use TopSpeed Modula-2 and it involved going into the compiled code with a Hex Editor and re-assembling it.
- fuzztester 3y agoIIRC, there was a BYTE magazine article about Modula-2 once, maybe written by Dick Pountain, a regular BYTE columnist from the UK. That is where I heard about the language, and I remember thinking that it seemed good and useful, based on the description, and due to having heavily used and liked Turbo Pascal earlier. I somehow never got to know there was a Turbo Modula-2, although I did know about Turbo Prolog, and may have tried it out briefly.
- Jtsummers 3y agohttps://archive.org/details/byte-magazine-1984-08 https://archive.org/details/byte-magazine-1984-08 That one has several articles, it's the theme of the issue. There are several other issues with Modula-2 articles as well in the Archive, you may find the one you're thinking of if it's not in this issue.
- fuzztester 3y agoOh, thanks a lot for this. I was just vaguely remembering that there might have been a whole BYTE issue about it, not just an article, like there were whole issues for Lisp and Smalltalk, but was not sure. Very good to know. Will check those articles out.