
A crash course in compilers (2018) - cristoperb
https://increment.com/programming-languages/crash-course-in-compilers/
======
clircle
> The decision to adopt or avoid a language is always a mix of their perceived
> formal power (“Does this language even have this particular feature?”),
> employability (“Will this language get me a job?”), and popularity (“Does
> anyone important use this language anymore?”).

I'm a statistician. I've always wondered what it's like to grapple with the
question of what programming language to use. In statistics, the choice is
very obvious: use R. If that's not fast enough, use Rcpp. This is definitely a
good thing, because all academic statisticians in a certain age range speak R,
so interfacing work is not so painful, but maybe a bad thing because
statisticians don't really understand the pros and cons of many languages? If
Julia blows up, maybe we will have to get smart on these differences.

Granted the workflow is probably the same in any language: clean data, model
data, graph data.

~~~
Areading314
A big drawback of R is that you can't embed it into a commercial application
due to the GPL licensing (without releasing your source code). It's a
fantastic language ecosystem though.

~~~
einpoklum
> A big drawback of many commercial applications is their being non-free
> software, for which reason they cannot embed R.

There, fixed that for you...

------
pansa2
This article’s introduction includes:

> Diving deeper into program language theory is a great way to grow as a
> developer.

But does anything in this article really count as programming language theory?
I’ve always considered PLT to mean things like type theory and formal
semantics, which are quite separate from the practical implementation of
compilers.

I’ve been put off designing a programming language, even a dynamically-typed
scripting language, because I’m just not that interested in PLT. I’m much more
interested in the subject of this article (the implementation of compilers and
interpreters) than in the math behind type systems.

Do you think it’s possible to design a successful language without knowledge
of PLT? Or should I stick to working on compilers for existing languages?

~~~
zzzcpan
Programming language design for humans is a completely different thing from
PLT. It's more about usability, HCI, psychology. And if by success you mean
popularity or any metric that includes productivity of the language,
understanding of usability will definitely help you there, but knowledge of
PLT will almost certainly hurt it, since it makes you think that a lot of PLT
ideas are acceptable and usable.

~~~
noelwelsh
If you look at the trajectory of most popular languages they are incorporating
more "PLT ideas". Lexical scope, type systems, etc.

------
chrisseaton
I had no idea Stripe had this sort of technical journal - in print as well?
Extraordinary.

~~~
fermienrico
The idea of a software magazine is very cool. We need to go back to 70's era
when magazines were extremely high quality (atleast the ones we remember -
BYTE magazine, for e.g.).

I find the excessive design a bit offputting. It's beautiful, nevertheless.

~~~
lsllc
I remember poring over BYTE issues desperate for any technical detail! Issues
that stood out: one on data compression and the one about the Taos Operating
system.

MSJ (Microsoft Systems Journal) was another good one!

~~~
fermienrico
This is for you! :
[https://news.ycombinator.com/item?id=6113561](https://news.ycombinator.com/item?id=6113561)

~~~
lsllc
Thank you so much!

Data Compression:

[https://archive.org/details/byte-
magazine-1991-03/page/n375/...](https://archive.org/details/byte-
magazine-1991-03/page/n375/mode/2up)

Taos: (the article seems to only have been in the international edition of
Byte)

[https://sites.google.com/site/dicknewsite/home/computing/byt...](https://sites.google.com/site/dicknewsite/home/computing/byte-
articles/the-taos-operating-system-1991?hn)

Taos discussed previously on HN:

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

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

------
Yhippa
This is the first time I've heard of Increment. Is there a way to financially
support them without having dead trees sent to me? Really impressed by the
quality and thought that's gone into these articles.

~~~
theicfire
It's funded by Stripe. Probably the best way to support this work is by
sharing it and upvoting it!

------
spinlock_
I'm almost done with "Writing an interpreter in Go"[0] which I highly
recommend. Even though it's less theoretical than the usual books in this area
I learned a ton of practical stuff and a lot of things I "knew" from more
theoretical sources make now much more sense. Looking forward to work through
the second book of the series [1] which is aimed at compilers.

[0]:[https://interpreterbook.com/](https://interpreterbook.com/)

[1]: [https://compilerbook.com/](https://compilerbook.com/)

~~~
TurboHaskal
They're really good books specially if you want to program in a "modern"
language but I personally couldn't stomach the code style nor the TDD focus.
I'm probably being really unfair to the author, so please don't let this be a
deterrent!

I personally enjoyed `Modern Compiler Implementation in ML` and Crenshaw's
tutorial [0] There's also a Forth translation [1] if you're into that :)

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

[1]
[http://home.vianetworks.nl/users/mhx/crenshaw/tiny.html](http://home.vianetworks.nl/users/mhx/crenshaw/tiny.html)

------
saagarjha
Good stuff. One minor issue I had was that the GitHub links don't point to
specific commits, so they've decayed: either they point at different code now,
or the files they referred to are gone now :(

------
OwnsE
I think this is exactly what people need. That is, something quick and a bit
humorous yet informative; something that gives you a high-level overview, so
that you don't get baffled by the 1000-page thick Dragon book or whatnot.

~~~
barrkel
A significant chunk of what the Dragon book covers is state machine theory,
what you need to know if you're writing a compiler-compiler like yacc. The
state of the art in code generation had moved on even for the edition I read
in college back in 2004 or so, so the tail end of the book isn't super
relevant. IMO it was never a good book for practical compiler implementation.
It's better as an academic reference for compiler theory, especially DFA, NFA,
PDA etc. construction.

------
joatmon-snoo
I'm thoroughly entertained by seeing "ALSO IN THIS ISSUE: It doesn’t have to
be Turing complete to be useful" right next to "The decisive factor in what
makes something a programming language (or not) is known as Turing
completeness."

------
person_of_color
Has anyone taken the Stanford Compilers MOOC? Worth it?

~~~
transitivebs
Would highly recommend it if this sort of thing interests you.

~~~
iambrj
"People who like this sort of thing will find this the sort of thing they
like."

~~~
yesenadam
"Please respond to the strongest plausible interpretation of what someone
says, not a weaker one that's easier to criticize."
[https://news.ycombinator.com/newsguidelines.html](https://news.ycombinator.com/newsguidelines.html)

------
bogomipz
These covers look great and fun. I would love to buy PDF version of these. Is
this an option? I'm jus totally out book space at the moment.

------
jishiav042
This is such a great website.

