TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How to start programming language design?

12 pointsby poseidalmost 11 years ago
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 &quot;treetop&quot; like parsing libraries about, and are these for beginners or advanced users?

5 comments

EdwardCoffinalmost 11 years ago
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&#x27;s a collectively authored set of guidelines &quot;How to Design (Declarative) Programming Languages&quot; [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:&#x2F;&#x2F;lambda-the-ultimate.org</a><p>[2] <a href="http://thread.gmane.org/gmane.comp.lang.lightweight/2547/focus=2552" rel="nofollow">http:&#x2F;&#x2F;thread.gmane.org&#x2F;gmane.comp.lang.lightweight&#x2F;2547&#x2F;foc...</a>
wilsonfiifialmost 11 years ago
You could take a look at Marc Cournoyer&#x27;s course <a href="http://createyourproglang.com" rel="nofollow">http:&#x2F;&#x2F;createyourproglang.com</a>, check out the compiler course on Cousera <a href="https://www.coursera.org/course/compilers" rel="nofollow">https:&#x2F;&#x2F;www.coursera.org&#x2F;course&#x2F;compilers</a> and watch Rob Pikes talk on lexical scanning <a href="http://www.youtube.com/watch?v=HxaD_trXwRE.b" rel="nofollow">http:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=HxaD_trXwRE.b</a><p>That should get you going. Oh and don&#x27;t forget to have a look at Go language specification as well.
评论 #8019395 未加载
评论 #8019345 未加载
chtonalmost 11 years ago
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:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Recursive_descent_parser</a>). They&#x27;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&#x27;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.
评论 #8022223 未加载
评论 #8019390 未加载
评论 #8022239 未加载
CmonDevalmost 11 years ago
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:&#x2F;&#x2F;blog.jetbrains.com&#x2F;blog&#x2F;2014&#x2F;05&#x2F;27&#x2F;nitra-goes-open-so...</a><p><a href="https://github.com/JetBrains/Nitra" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;JetBrains&#x2F;Nitra</a>
评论 #8019792 未加载
sprobertsonalmost 11 years ago
Here&#x27;s the best &quot;hands-on&quot; introduction I&#x27;ve seen: <a href="http://nathansuniversity.com/" rel="nofollow">http:&#x2F;&#x2F;nathansuniversity.com&#x2F;</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).