The naked truth about writing a programming language (2014)
This advice is quite good for certain types of programming language, if you look at the world the same was as he does. We&#x27;re implementing Dark from a completely different worldview, and from that vantage point, a lot of these aren&#x27;t exactly wrong, but different.<p>&gt; Syntax matters<p>The approach we took with Dark is that there isn&#x27;t a syntax, per se, in that there isn&#x27;t a parser. There&#x27;s certainly a textual view of Dark and so it&#x27;s important that the code looks good (it currently looks only OK, in my opinion). But as a result, we have other options for minimizing keystrokes (autocomplete built-in), parsing (again, no parse), and minimizing keywords (you&#x27;re allowed have a variant with the same name as a keyword, which isn&#x27;t allowed in languages with parsers (well, lexers, but same idea).<p>&gt; context free grammars<p>No parser, no need to have a grammar. His point about IDEs is great - we only support our own IDE (a controversial decision to be sure!)<p>&gt; Redundancy<p>This is an esoteric parsing problem, that only applies if you have a parser. No parser means no syntax errors. We are left with editor errors (how does the editor have good UX) and run-time errors.<p>&gt; Implementation<p>He&#x27;s right about how hard error messages are, so I feel good about our &quot;not parsing&quot; approach.<p>&gt; Compiler speed<p>Our compilation is instant. The way it&#x27;s instant is:<p>- very small compilation units: you&#x27;re editing a single function at a time, and so nothing else needs to be parsed.<p>- no parser: The editor directly updates the AST, so you don&#x27;t have to read the whole file (there isn&#x27;t a &quot;file&quot; concept). Even in JS, that means an update takes a few milliseconds at the most.<p>- extremely incremental compilation: making a change in the editor only changes the exact AST construct that&#x27;s changing.<p>&gt; Lowering<p>This is really about compilation. One thing you can do, which is what we do, is have an interpreter. Now, interpreters are slow, but we simply have a different goal with the language, which is to run HTTP requests quickly. We do run into problems with the limit of the interpreter, but we plan to add a compiler later to deal with this.<p>Really what I&#x27;m suggesting here is that compiled languages look at having interpreters in addition to compilers.<p>&gt; i&#x2F;o performance<p>&gt; memory allocation<p>I think he&#x27;s approaching this with an implicit goal of &quot;it must be as fast as possible&quot;, which isn&#x27;t necessarily a goal for all languages.<p>&gt; You’ve done it, you’ve got a great prototype of the new language. Now what? Next comes the hardest part. This is where most new languages fail. You’ll be doing what every nascent rock band does — play shopping malls, high school dances, dive bars, etc., slowly building up an audience. For languages, this means preparing presentations, articles, tutorials, and books on the language. Then, going to programmer meetings, conferences, companies, anywhere they’ll have you, and show it off. You’ll get used to public speaking, and even find you enjoy it (I enjoy it a lot).<p>Well this is certainly correct!