Hacker News

4 hours ago by eatonphil

If you're interested in more Wirth I recommend his book, Compiler Construction. It's a great small piece on building a language from scratch.

2 hours ago by lboasso

When I read this book I had an hard time running and compiling the source code included. If you want to read the book and try out the example compiler (oberon0), you can follow the instructions here: https://github.com/lboasso/oberon0. You just need a JVM >= 8 and the oberonc compiler: https://github.com/lboasso/oberonc

2 hours ago by setpatchaddress

Second this. Much easier to follow than the dragon book. And you’ll end up with a better implementation if you follow Wirth vs the YACC dudes.

5 hours ago by ggm

The Pascal compiler on UNIX (v7, 4.1BSD) was idiomatic. I think probably no more than any other language, but enough to make me (graduate from York, a pascal teaching university) put off by micro-differences from what I learned.

The uplift to C was simpler in some ways. Why use a confusing port which winds up having to call C system libraries, when you can code directly in the language the system libraries is coded in?

Fortran, oddly, this wasn't such a big deal. Maybe the bulk of necessary code in Fortran meant the barrier to entry was lower.

5 hours ago by undefined

[deleted]

6 hours ago by open-source-ux

One principle that Niklaus Wirth has always espoused and with which I agree: you cannot reduce the complexity of a programming language by expanding the size of the language with greater features. This sounds like a contradiction, but as Wirth says in the preface to his Oberon programming tutorial:

"The language Oberon emerged from the urge to reduce the complexity of programming languages, of Modula in particular. This effort resulted in a remarkably concise language. The extent of Oberon, the number of its features and constructs, is smaller even than that of Pascal. Yet it is considerably more powerful."

The FreePascal of today has grown considerably over time. The same can be said of many popular languages today: PHP, Ruby, Python, C#, Javascript, etc. Some languages start big from the beginning (e.g. Ada).

With large languages there is also the feeling you've only learned a subset of the language, blissfully unaware of many other features the language offers. At least with smaller languages you have a greater chance to master the language whole.

Of course, it doesn't automatically follow that a smaller language will be simpler or easier to grasp. (There is plenty of argument surrounding Go's supposed simplicity.)

3 hours ago by dhosek

Ada was a real bear of a language. When it was introduced as the language of instruction in some class at UIC back in the 80s, students had to work on teams as a single compilation was enough to consume the weekly CPU time allocation for a student account on the VM/CMS mainframe. They had to set up file sharing between accounts and move to a new account with each new day's login. I think there were a few cases where students ran out of CPU time even with pooled accounts before they could complete an assignment.

6 hours ago by Koshkin

One of the nice things about Oberon-07 is that the compiler I’ve played with could compile itself and the standard library all in a tiny fraction of a second.

an hour ago by amedvednikov

V compiles itself in 150 ms on my machine.

0.6 seconds on a free tier AWS instance:

https://fast.vlang.io

2 hours ago by lboasso

When I benchmarked oberonc [0], an oberon-07 self-hosting compiler for the JVM, it took about 100 ms with a hot VM on a old Intel i5 @ 2.80GHz. That compiler follows the same one-pass compilation approach.

[0] https://github.com/lboasso/oberonc

4 hours ago by anta40

I take a look at the list and found this: https://github.com/prospero78/Oberon07ru

Looks interesting. I wonder how hard/easy to port this to Linux/Mac, for example.

3 hours ago by Koshkin

I think Krotov’s is the one that I have tried. The package includes (or used to include) a simple IDE (a code editor) also written in Oberon, which provides another good example.

http://exaprog.com/

https://github.com/AntKrotov/oberon-07-compiler

Linux seems to be supported.

6 hours ago by pjmlp

Note that before Oberon-7 happened, after Oberon came Oberon-2, Component Pascal, Active Oberon and Zonnon.

Although Wirth seems to only have been involved with Oberon-2 and Component Pascal.

5 hours ago by blondin

i have had a book of the same name on my amazon wish list for a while now. will definitely get to it at some point. big fan of the work of wirth.

6 hours ago by galaxyLogic

I wonder, why Modula (-II) never overtook Pascal?

43 minutes ago by nine_k

I'd say it is because Turbo Pascal and then Borland Pascal got popular enough, and had TurboVision and other stuff.

Modula-2 was a nice language (and modern Go is built basically on its ideas, plus Oberon's), but it had a hard time competing for the same niche on the PC. It worked better in embedded space, though.

On Unix, there was C, a language with many shortcomings, but one big upside: it was the language the kernel and the userland was implemented in. Its compiler was readily available as a part if any Unix installation. It seemed a natural choice over Pascal, unless you wanted drastically different features (then you had Fortran, or awk, or Tcl, or later Perl, etc.)

5 hours ago by quicksilver03

Having loved Pascal and struggled with Modula 2, I'll go out on a limb and I'll say: for cosmetic and typing issues.

Modula 2, at least in the implementation I had to use at my University, had case-sensitive keywords which were in UPPERCASE. Compared to Pascal's case-insensitive keywords, in the editors available at that time, Modula 2 stuck out like a sore thumb and made writing and reading code like a chore.

6 hours ago by prestonbriggs

When I started grad school, in 1986, I'd written a lot of Pascal and used Turbo Pascal on my PC. But the school used Sun workstations with unix, so I had to learn C pretty quickly. Nobody seemed to use Pascal. There was a Modula II compiler around, but it was a resource hog and never popular. Oberon was published about the same time. I thought it was pretty cool and worked on a compiler for it, though the language evolved out from under me. My impression is that none of the Wirth languages made much of an impression in any of the US grad schools in that era. Of course, I didn't see everything that was going on, but I saw most of the compiler work. Almost 100% in C, moving eventually to C++.

6 hours ago by pjmlp

Wirth languages were more of a thing in Europe.

Here Pascal was everywhere and C was just yet another language on MS-DOS.

The PC Systems Programming Bible had samples in MASM/TASM, QuickBasic, Quick/Turbo Pascal and Borland/Microsoft C and C++ compilers.

6 hours ago by Koshkin

Because Turbo Pascal already had modules.

6 hours ago by JasonFruit

Not just that Turbo Pascal had modules, but that it had enough of the market that it would have been hard for Modula-x to get a foothold, even if Wirth was a salesman, which he was not.

6 hours ago by pjmlp

Borland had a Modula-2 compiler, created by Martin Odersky of Scala fame.

They decided to focus on Turbo Pascal instead.

Turbo Pascal units are based on USCD units actually.

Outside MS-DOS, Modula-2 had better chances, but since it was MS-DOS that won the 16 bit wars, it became irrelevant, as the only major alternative were UNIX clones were C and C++ ruled.

4 hours ago by ngcc_hk

Really want to migrate turbo pascal bridge. Guess too old to complete that.

Daily digest email

Get a daily email with the the top stories from Hacker News. No spam, unsubscribe at any time.