
Let's Build a Compiler (1995) - pplonski86
https://xmonader.github.io/letsbuildacompiler-pretty/
======
svat
[Edit: this comment is obsolete; author fixed both issues]

The attribution is missing: As the README on the repository
([https://github.com/xmonader/letsbuildacompiler-
pretty](https://github.com/xmonader/letsbuildacompiler-pretty)) explains, this
is a prettified version of the plain-text “Let's Build a Compiler” by Jack
Crenshaw, published in serial form during 1988 to 1995
([https://compilers.iecc.com/crenshaw/](https://compilers.iecc.com/crenshaw/)).

This prettified version is nice; if nothing else the syntax highlighting in
the code samples makes them easier to read.

But comparing for example the first installment at the original
([https://compilers.iecc.com/crenshaw/tutor1.txt](https://compilers.iecc.com/crenshaw/tutor1.txt))
and here ([https://xmonader.github.io/letsbuildacompiler-
pretty/tutor01...](https://xmonader.github.io/letsbuildacompiler-
pretty/tutor01_introduction.html)), looks like the title, author name,
copyright notice, and date have all been removed. Hopefully the maintainer of
this repo finds a way to add them back. (Also, Part 9 seems to be empty?
Reporting on the repo.)

Edit: Reported on the repo and the author fixed promptly. Thanks!

------
dang
The interesting previous discussions appear to be:

2013:
[https://news.ycombinator.com/item?id=6641117](https://news.ycombinator.com/item?id=6641117)

2010:
[https://news.ycombinator.com/item?id=1727004](https://news.ycombinator.com/item?id=1727004)

2007:
[https://news.ycombinator.com/item?id=63004](https://news.ycombinator.com/item?id=63004)

------
marktangotango
This needs attribution to Jack Crenshaw the author.

~~~
markjenkinswpg
[https://compilers.iecc.com/crenshaw/](https://compilers.iecc.com/crenshaw/)

------
pronoiac
On mobile, to get to the other chapters, there's a hamburger menu at the top
that's hidden until you tap near the top.

~~~
system_panic
Thanks!

------
blattimwind
No mention of Pratt parsing? :)

~~~
peterhj
Pratt parsing is great. Quoting from the original paper itself:

> One may wonder why such an "obviously" utopian approach has not been
> generally adopted already. I suspect the root cause ... is our universal
> preoccupation with BNF grammars and their various offspring...

------
smhenderson
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?

~~~
lboasso
For the excellent introductory book "Compiler Construction" by Niklaus Wirth,
you could find compilers for the implementation language at
[http://oberon07.com/compilers.xhtml](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](https://github.com/lboasso/oberonc)

~~~
AlexeyBrin
Can one use _oberonc_ to compile the Oberon 0 language presented in
[http://www.ethoberon.ethz.ch/WirthPubl/CBEAll.pdf](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 ?

~~~
lboasso
With _oberonc_ you can compile the source code at [http://www-
oldurls.inf.ethz.ch/personal/wirth/CompilerConstr...](http://www-
oldurls.inf.ethz.ch/personal/wirth/CompilerConstruction/index.html) 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.

~~~
AlexeyBrin

        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.

~~~
lboasso
Here is the repo:
[https://github.com/lboasso/oberon0](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.

~~~
AlexeyBrin
Thanks.

