Readit News logoReadit News
fifticon · a year ago
There 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 · a year ago
Yep, 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.

wrs · a year ago
Circa 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.h...

pjmlp · a year ago
Interesting piece of history, thanks for sharing.

I consider D and C# nowadays the closest languages to Modula-3 in features.

There is still some folks keeping Modula-3 compiler going.

https://github.com/modula3/cm3

__d · a year ago
I 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 · a year ago
This 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 · a year ago
Where come Dylan and NewtonScript into play?
wrs · a year ago
Dylan (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. :)

ghewgill · a year ago
Back 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.

Narishma · a year ago
> Even then, Turbo Pascal 3 felt like a toy.

In the late 80s Turbo Pascal was already at version 5 or 6.

ghewgill · a year ago
Closer to mid-80s then. I started using Modula-2 in earnest around 1986 give or take a year.
rcarmo · a year ago
I 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 · a year ago
In 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 · a year 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.

butterisgood · a year ago
If it’s not usable, why is there so much useful software written in Go?

I haven’t had a lot of trouble writing some interesting things in Go that I’ve found difficult to redo in C++ with similar simplicity.

Sometimes a language doesn’t need a ton of bells and whistles to be usable.

Wirth understood this and accomplished much.

Consider how we’ve been able to fix Voyager - simplicity can save.

rcarmo · a year ago
I sort of like Go, but also can't bring myself to write it that often. I don't know why--although part if it is fetching libraries directly from git repos.
pjmlp · a year ago
Nope, that would be FreePascal and Delphi, fast compilation, without paying for a spartan language.
int_19h · a year ago
Surely Free Pascal is the most Pascal language that exists and is actively developed today?
jll29 · a year ago
Modula-2: The Book 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

skissane · a year ago
IBM 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-...

pjmlp · a year ago
Nowadays 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 · a year ago
But nowadays, why would anyone use Modula-2 today and not Rust, C++, Go, or basically any other programming language?
pjmlp · a year ago
Given 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.

phicoh · a year ago
As 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.

WalterBright · a year ago
C++ 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.
inkyoto · a year ago
I 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.

Rochus · a year ago
C++ is much more powerful; but C++ could have added modules thirty years earlier.
WalterBright · a year ago
C++ should have copied D's module design!