Create Your Own Programming Language
createyourproglang.com
createyourproglang.com
It's very likely a scam.
It used to be 53 pages, but is now somewhere over 100 pages, according the new updated site. The original's code listings are in Ruby; I can't help but wonder if he just redid them in Java to make the book longer. Seriously. And no, I'm not picking on Java.
Here's the old version:
Implementing a programming language is a pretty difficult but rewarding task. It's become a lot easier these days now that there are giant runtimes you can target (JVM, CLR and so on). I would encourage anyone who is interested to give it a shot, and to find a good book or course to do so. (That book from Brown dmunoz posted looks excellent) And once you've done that, try writing your own runtime too (garbage collector/virtual machine or native compiler). It will teach you a lot about the tools you use every day.
Do you have any recommendations for books in a similar vein?
LLVM is a modern "compiler infrastructure" project. It's textual intermediate language is relatively easy to write. If you can write a program that accepts user input, and generates LLVM IR, then you've got a compiler of sorts.
It's like this thing is selling an ATM, and the parent comment is asking "well, I live in Nicaragua, is there an ATM there?" and your answer is "there is an ATM in Nicaragua, it is called a bank."
The Dragon Book is the reason more people don't write compilers. It's old and thorough and formal and really feels like you were handed an "Installing Your Model HJ-3660PF Nuclear Hydraulic Reactor" manual, more than an approachable guide. This isn't necessarily a bad thing, if you're forced through it for a class--you'll learn more, and what you learn will have a more stable foundation--but it's a shame for people who are just curious, and would learn something from a friendlier presentation where the more formal approach would lose them.
Writing a compiler is pretty fundamental to being able to form an understanding of platform semantics as separate from language syntax. It's something everyone can do--but it's treated so formally that it feels like one of those weird advanced-level things only to be attempted after you've learned everything else, like creating your own magic spells in D&D. If it felt more like some "Create Potion"-level magic, maybe more people would have tried it, and figured out that there's really no magic going on at all. :)
I always try to dive headlong into literature for concepts like this, knowing I won't understand everything right away. Implementing the concepts with my tools of choice has always been a great way to prove my understanding, and push myself.
The following book [0] popped up on reddit [1] the other day. I'm not sure how it compares, but it looks like a decent option. Surely better than the suggestion in this thread to "get the dragon book" which I feel is too obtuse of a recommendation.
My favourite free resource in this area is Programming Languages: Application and Interpretation [2], which has video lectures [3] from the online offering last year. Udacity also has a programming languages course in the vein of building a web browser.
There were also two interesting videos from PyCon USA 2013, All-Singing All-Dancing Python Bytecode [4], and So you want to write an interpreter? [5].
Some of the above are not precisely for creating your own programming languages, but they are great resource in the general area.
[0] http://nathansuniversity.com/step.html
[1] http://www.reddit.com/r/programming/comments/1jnd95/pl101_cr...
[2] http://cs.brown.edu/courses/cs173/2012/book/
[3] http://cs.brown.edu/courses/cs173/2012/Videos/
[4] http://pyvideo.org/video/1777/all-singing-all-dancing-python...
[5] http://pyvideo.org/video/1694/so-you-want-to-write-an-interp...
Here's a start:
It's an excellent free undergraduate-level PL textbook that covers a lot of ground and is informed by both research and practice. There's a 2nd edition linked from there as well.
Putting bad marketing aside, are there currently areas which would require another programming language, that would provide something current languages do not provide, or make it so much better that the change would be rational?
1. Yes, there are probably a lot of areas that need new
programming languages or improvements of the current
programming languages, everything is quite far from
"perfect" at the moment (and it will probably always
be). There's still a huge amount of research going
in this direction.
2. Learning. Should you ever be stopped from learning
something new by the fact that something similar
already exists? Probably not. This is just business
thinking utter bullshit.
3. This "resource" was the starting point before few
quite young popular programming languages. I haven't
read it myself but it must be something good to learn
from it judging by the outcome. Show some respect.I'd also recommend any of Terrence Parr's books on ANTLR.
[1] http://llvm.org/docs/tutorial/ [2] https://github.com/ruby-llvm/ruby-llvm
In the course he walks you through how to make a simple clone of the Rails framework. Once you've done that, digging into the Rails source isn't so intimidating.
http://www.antlr.org/wiki/display/ANTLR4/ANTLR+4+Documentati...
(And seriously, folks, the GNU people used to tout their Scheme interpreter, Guile, as a target for compilers.)