
Create Your Own Programming Language (Book) - laktek
http://createyourproglang.com/
======
plinkplonk
This is a scam. Take a look at the toc to see how many pages are devoted to
the interpreter, the VM and so on. It is impossible to learn how to write a
complete interpreter or compiler, (leave alone VMs etc) in such a small
"book".

The blurb says

"Become the next Guido Van Rossum, Matz, Larry Wall or Rasmus Lerdorf by
creating your own revolutionary programming language in a few days"

yeah right! :-D.

If anyone is really interested in learning to build an interpreter or
compiler, here is a book list to work through in order.

(1) SICP (do _all_ the exercises in Chapter 4 and Chapter 5). There is an
incredible amount of learning there. Once you've done this, you can write a
basic interpreter/compiler for languages with s-expression _syntax_. [The
semantics can be anything you imagine]

(2) Essentials of Programming Languages. This will teach you how many language
features work (lazy evaluation, object systems, static type systems ..)

(3) Lisp in Small Pieces - how to implement byte code compilers, macro
systems, compilation to C, lots of good stuff here.

(4) A book on lexing and parsing so you can give your language any syntax you
want. I prefer Modern Compiler Design by Gries. If you understand the first
three chapters you can write your own lex/yacc equivalents. (the book has a
lot more to it than these chapters, but it is the best I've seen on
lexing/parsing).

(5) Now take a look at the source of your favorite language. ((Lua and the lcc
compiler (it even has a book explaining its design) in particular, are very
educational).

(6) If you are REALLY serious about optimization, Steve Muchnick's book,
Advanced Compiler Design and Implementation.

I have all these books and have derived an incredible amount of learning and
joy from them.

yes it is a bit of work, but it is fascinating journey. Enjoy.

EDIT: If you want to go deep into type systems (say you want to grok Haskell's
type system from first principles, (or add OCAML like modules to your
language, say) Benjamin Pierce's Types and Programming Languages - You are in
good shape to work through this after you've finished EOPL

~~~
ajross
Your advice is good, but you're being a snob. The complexity of a simple
compiler is not that high. My language (<http://plausible.org/nasal>) has a
core of about 3-4000 lines of C, well under the size of the Unix kernel
explained (very well) by Lions in his classic book.

Sure, language design is a deep field, with lots of subtlety and complexity.
And people spend years studying it. That doesn't mean that every language
requires a huge tome of background to implement.

~~~
plinkplonk
"Your advice is good, but you're being a snob. The complexity of a simple
compiler is not that high. "

Sure reccomending someone work through SICP chapters 4 and 5 (enough to write
an ultra simple compiler/interpreter) is "snobbery". ;-)

So be it. :-P

That doesn't mean _this_ book (referred to in the original posting) isn't a
scam. It is.

Any reccomendation on the internet (including mine) is worth only the
electrons it consumes. Caveat Emptor!

I've worked through the books _I_ reccomended (and was careful not to
reccomend great books like CTM which I have no experience of).

This is the best way _I_ know how to get this knowledge. I am not claiming it
is the most efficient method. feel free to provide better paths.

If that strikes you as "snobbery" , bleh to you ;-)

~~~
ajross
The part that strikes me as snobbery is your statement that you _cannot_ learn
language design from a small book. Based on my actual experience in the same
regime, some of which involved reading books but far more of which involved
thinking through code, I think you're just wrong.

~~~
plinkplonk
"The part that strikes me as snobbery is your statement that you cannot learn
language design from a small book. "

I stand by that. _Design_ in _any_ endeavor can't be learned from books, small
or big. Before you can "design" you need the nuts and bolts skill to implement
your designs.

The books I reccomended, if sincerely worked through, give you the nuts and
bolts knowledge to implement the designs you _do conceive_. Reading through
the source of languages you admire, will teach you a lot (I reccomended that
too).

Since I _never said_ you could learn language _design_ (vs learning how to
_build_ interpreters and compilers - I started my reccomendation list with "If
anyone is really interested in _learning to build_ an interpreter or compiler,
..." -) by _working though_ books, I fail to see what you are reacting
against?

I maintain that a 44 page book (particularly _this_ one which is an outright
scam) doesn't have the space to cover even the basic _implementation
techniques_ , leave alone "design".

Please provide counter examples of such "small books" that teach "language
design" if you disagree. One counter example is worth a lot of internet
debate!

The shortest introduction _I_ know capable of turning you into an
interprter/compiler _writer_ is Chapters 4 and 5 of SICP (and there is a lot
of stuff in the previous 3 chapters that lead to these chapters).

------
macournoyer
Hey, I'm the author of the book. I agree the marketing site is not perfect,
I'm still looking at ways to improve it, sorry if if it sounds like a scam.

Any tips on improving the copywriting or anything are greatly appreciated!

~~~
aardvark
The copywriting is a little over the top, but my suggestion is for the book
itself.

I'd like to see more details. Your sample chapter on Lexers, for example,
would be much stronger if you went into more details (maybe 3-4 pages) on how
a scanner identifies a token, how it knows when it has reached the end of a
word, how it recognizes and handles whitespace, why it's important to keep
track of indentation and newlines, what is the difference between keywords and
other identifiers, etc. Maybe also give a written explanation describing what
each section of your lexer for Awesome is doing.

Please consider this as constructive criticism: I think the book is a good
idea, but I also think it needs more meat. I don't know how easy it is to
revise it at this time, but I think you'd have better luck if you added more
details.

~~~
plinkplonk
"The copywriting is a little over the top,"

a _little_?

"Become the next Guido Van Rossum, Matz, Larry Wall or Rasmus Lerdorf by
creating your own revolutionary programming language in a few days"

Heh heh!

~~~
netghost
Lose 120 pounds in six minutes!

~~~
geeko
...even if you only weight 80 pounds.

~~~
dkersten
I've always wanted to weight -40 pounds; where do I sign up?

------
dkersten
$39.99 for a 44 paged PDF? On Amazon.com I can buy a hardcopy version of
_Compilers: Principles, Techniques, and Tools (2nd Edition)_ for $86.29 and
its got (according to amazon) 1000 pages.

~~~
petercooper
I have a few reams of paper (about 2000 sheets) you can buy for $40 if you
want. That's even better value than the book you suggest.

~~~
yangyang
Depends on your definition of value. Aho Sethi Ullman will teach you rather
more about compilation of programming languages than 2000 sheets of paper ;-)

------
keyist
I feel the copywriting of the site is a little over the top. The subject
matter is interesting enough that most geeks should want to have a look.

Is this a sign of the times? (See also: <http://perl6.org>). Sure there's
nothing wrong with dressing tech up and making it look fun, but at some point
it becomes a turn-off, which is a shame. 2600 et al did not need fancy fonts
and bright colors to appeal to hackers.

tl;dr - get off my lawn!

------
igrekel
Seems like the "book" (44 pages in PDF) is a walkthrough to using compiler
building tools and the like. Not a bad idea.

A lot of what surrounds it sounds way too much like a mix of spam and
infomercial for my taste. Then again, I am most likely not the intended
audience. I must say it makes me smile seeing this marketed as a "cool thing"
tough.

------
donaq
Hmm. Are you sure this is not some tongue-in-cheek prank?

~~~
silentbicycle
Yeah, it kind of reads like ParrotSecrets.com for hackers.

------
baxter
I agree that learning how to create a programming language is a valuable
lesson in and of itself -- I may even buy the book to see what it's like --
but claiming that you can create a "revolutionary" programming language within
a few days conveys the wrong message.

Creating programming languages is not difficult but designing good programming
languages is.

~~~
hughprime
Creating a new programming language is trivial. I just invented one called
"awesomepython". It's just like python, except that the keyword "and" is
replaced by "awesomeand", "if" is replaced with "awesomeif", and so forth. The
compiler is one line of awk.

Creating a language that's actually good for something is a very different
sort of challenge...

~~~
plinkplonk
"Creating a new programming language is trivial. I just invented one called
"awesomepython". It's just like python, except that the keyword "and" is
replaced by "awesomeand", "if" is replaced with "awesomeif", and so forth. The
compiler is one line of awk."

Coffee all over keyboard! Damn you!! :-D

Hilarious! Upvoted! Now to clean that spilt coffee!

------
oscardelben
Became the next Guido Van Russom, Matz... with just reading a book? Seriously?

Edit: it looks like a good website but I'm still skeptical.

~~~
mcantelon
The tone seems tongue-in-cheek to me. The page is a humorous parody of get
rich quick sites. The product itself is real and, if it gives somebody a quick
way to get up and running exploring the basics of language, it's likely worth
the $40.

------
Mongoose
I ctrl+w'd at "your own freaking awesome programming language."

------
igorgue
The Dragon Book!

------
rygorr
I think its great that we've reached a point in technology that we have people
(rather than teams or large companies) creating languages that people can use.

However, if you are looking at books to learn HOW to create a new language you
likely haven't answered a more important question: WHY.

~~~
mquander
What do you mean, why? How many reasons do you need to write code that does
something cool?

~~~
rygorr
Writing something cool is one thing. writing a language is another. What I'm
saying is if you are using an ebook to create your language (on the jvm no
less) I expect there are several other languages that people have spent YEARS
on that I bet would solve most of the issues you could ever have if you
learned them a bit better

* The JVM is awesome. But there are lots of "hosted languages" already on that platform that likely will suit most peoples' needs.

~~~
docmach
How writing a compiler not cool? Just because someone uses a book and targets
the JVM, which is a great target platform for a lot several reasons, doesn't
mean they aren't doing it just because it's fun.

~~~
dkersten
But why pay $40 for _fun_ when you can do it with free information on the net?
If you're doing it for fun, then that information is more than adequate. If,
however, you're doing it because you want a real language that people
should/would use, then a 44 page PDF is not nearly enough, regardless of how
good and densely packed it is. For a _real_ (as opposed to a _toy_ ) language,
you require theory on language design, on compilers, on programming paradigms,
on syntax, on computation models and so much more.

------
teeja
Why not write a book that lets you create your own programming languge in
_javascript_ ??

That way you at least get something _useful_ out of the exercise.

(Ducks)

