News for hackers. Stuff that matters.
Re:Let's Build a Compiler (1995) by smhenderson on Sunday May 12, 2019 @03:19PM (#19893865)
How reasonable is it to dive any to this and treat the Pascal as pseudocode so as to implement it in another language? Or would one be better off just using something like freepascal.org?
Re:Let's Build a Compiler (1995) by lboasso on Sunday May 12, 2019 @04:39PM (#19894420)
For the excellent introductory book "Compiler Construction" by Niklaus Wirth, you could find compilers for the implementation language at http://oberon07.com/compilers.xhtml.

If you have a JVM installed, you could use oberonc[0]. I have a local branch where I test that each release of the compiler can compile and run the examples in that book.

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

Re:Let's Build a Compiler (1995) by AlexeyBrin on Sunday May 12, 2019 @04:54PM (#19894502)
Can one use oberonc to compile the Oberon 0 language presented in http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf ?

I guess what I'm asking is if Oberon-0 is a subset of Oberon-7, which oberonc seems to implement. Do you think it is possible to implement Oberon-0 in itself ?

Re:Let's Build a Compiler (1995) by lboasso on Sunday May 12, 2019 @06:13PM (#19894914)
With oberonc you can compile the source code at http://www-oldurls.inf.ethz.ch/personal/wirth/CompilerConstr... with minor changes to the I/O library calls. I can push the changes in a repo if you are interested.

Oberon-0 is too limited to easily bootstrap itself. I wrote oberonc first in Java and then I rewrote it in Oberon-07 for the final bootstrap step. Oberon-0 is a toy subset of the full Oberon-07 language.

Re:Let's Build a Compiler (1995) by AlexeyBrin on Sunday May 12, 2019 @06:29PM (#19895009)

    I can push the changes in a repo if you are interested.
Thanks. That would be great for the people that want to follow the Compiler Construction book. (Thanks for posting the link for the 2017 version)

    Oberon-0 is a toy subset of the full Oberon-07 language.
So I can write small Oberon-0 programs and try these using Oberon-07.
Re:Let's Build a Compiler (1995) by lboasso on Monday May 13, 2019 @01:41AM (#19896657)
Here is the repo: https://github.com/lboasso/oberon0

Yes, you can write small Oberon-0 programs and compile them with an Oberon-07 compiler, but it is simpler to just use the Oberon-0 compiler from the repo above.

Re:Let's Build a Compiler (1995) by AlexeyBrin on Monday May 13, 2019 @07:42AM (#19898231)
Thanks.
Re:Let's Build a Compiler (1995) by pjmlp on Monday May 13, 2019 @04:57AM (#19897306)
As a tip when using languages like Oberon, use an autoformatter that uppercases the keywords, no need for shift or caps turn on/off all the time.
Re:Let's Build a Compiler (1995) by garganzol on Sunday May 12, 2019 @03:34PM (#19893966)
I was taught compiler construction by the books like that. In my opinion they do more damage than good.

A proposed adhoc parser without an intermediate representation is a sure way to create an unnecessary mess in reader's head. Somewhat understandable given the technical limitations of those days, but still the authors could do a better job there.

Dragon Book (Compilers: Principles, Techniques, and Tools) and "Compiler Construction" by Niklaus Wirth are much more sensible choices.

Re:Let's Build a Compiler (1995) by smhenderson on Monday May 13, 2019 @11:25AM (#19900202)
Thanks for the suggestions/info everyone. I look forward to digging deeper!