Hello,<p>as far as I know, programming started out with translating expressions like:<p><pre><code> (number) (operation) (number) := (result)
</code></pre>
Now, I want to understand a bit more on programming language principles, but reading references quickly results into discussion of abstract algebra.<p>So here is my question: How can I start designing simple programming languages?<p>What are some simple, but useful grammars to understand programming language principles?<p>What are these "treetop" like parsing libraries about, and are these for beginners or advanced users?
You should probably spend some time browsing through Lambda the Ultimate [1], a discussion forum devoted to this kind of thing (it is very academic though).<p>There's a collectively authored set of guidelines "How to Design (Declarative) Programming Languages" [2] posted in comp.lang.lightweight, curated by Scott McKay that you might find useful.<p>[1] <a href="http://lambda-the-ultimate.org" rel="nofollow">http://lambda-the-ultimate.org</a><p>[2] <a href="http://thread.gmane.org/gmane.comp.lang.lightweight/2547/focus=2552" rel="nofollow">http://thread.gmane.org/gmane.comp.lang.lightweight/2547/foc...</a>
You could take a look at Marc Cournoyer's course <a href="http://createyourproglang.com" rel="nofollow">http://createyourproglang.com</a>, check out the compiler course on Cousera <a href="https://www.coursera.org/course/compilers" rel="nofollow">https://www.coursera.org/course/compilers</a> and watch Rob Pikes talk on lexical scanning <a href="http://www.youtube.com/watch?v=HxaD_trXwRE.b" rel="nofollow">http://www.youtube.com/watch?v=HxaD_trXwRE.b</a><p>That should get you going. Oh and don't forget to have a look at Go language specification as well.
For some quick hands-on learning, it might be interesting to read up on Resursive Descent Parsers (<a href="http://en.wikipedia.org/wiki/Recursive_descent_parser" rel="nofollow">http://en.wikipedia.org/wiki/Recursive_descent_parser</a>). They're easy to understand and easy to code in a language of your choice. Once you have a working one, you can expand it to experiment with your own grammar. Spend some time experimenting that way and you'll be able to get a lot of insight in what the pitfalls of language design are and how you can work with your parser to minimize them.
Check the next generation approach for a modern IDE:<p><a href="http://blog.jetbrains.com/blog/2014/05/27/nitra-goes-open-source" rel="nofollow">http://blog.jetbrains.com/blog/2014/05/27/nitra-goes-open-so...</a><p><a href="https://github.com/JetBrains/Nitra" rel="nofollow">https://github.com/JetBrains/Nitra</a>
Here's the best "hands-on" introduction I've seen: <a href="http://nathansuniversity.com/" rel="nofollow">http://nathansuniversity.com/</a><p>He walks you through the basics of compiling, parsing, and interpreting to create your own scheme-like language (complete with exercises along the way).