We need less powerful languages (2015)
Disclaimer: this essay of a comment is sort of an ad for my ideas.<p>At the time this article came out, I had been designing a language for 2-3 years. I&#x27;m still designing it now, so I have more than 10 years experience.<p>The author is right and wrong. The W3C principle is right and wrong. Paul Graham is right and wrong.<p>The author and W3C are right in that the less power you have, the better for understanding, analysis, and even optimization&#x2F;performance. Paul Graham is right that you <i>need</i> power.<p>I only realized this recently after working on a build system, which might be the most hated type of software. As I designed mine, I wanted to do it right, to avoid the mistakes.<p>The biggest mistake, and one common to nearly every build system was not providing the user enough power.<p>The common opinion about building software is that it shouldn&#x27;t be that hard. Most of the time, that&#x27;s correct. But when it <i>is</i> hard, there is nothing that will work except raw power. When you <i>need</i> it, truly <i>need</i> it, literally <i>nothing else</i> will do, by definition.<p>This leads to a quandary because by the time a project runs into a situation where building is hard, the build system is deeply entrenched. This means that changing the build system would be difficult and time-consuming for little perceived benefit. Instead, users find ways around a build system&#x27;s lack of power (usually by writing a script; after all, a script is powerful) and moan about how the build system is a problem.<p>I agree with them: such hamstrung build systems <i>are</i> problems.<p>But at the same time, an all-powerful build system would be complicated to use, right?<p>Spoiler: no, but to do it right takes actual <i>design</i> and <i>user experience</i> work instead of just coding.<p>But let&#x27;s assume it <i>is</i> too complicated to use. What can we do? We need the power, but the power makes it too complicated. Should we just throw up our hands and accept that the complexity is inherent, or should we hamstring the build system and hope we don&#x27;t need the power?<p>Absolutely not. Would we do that with our programming languages? No, so removing the power is not an option.<p><i>Most</i> of the time.<p>What if we could remove the power <i>some</i> of the time? Let&#x27;s say it&#x27;s a config option we put into the build file. Maybe that option can be one of several things:<p>1. Only targets and commands, like a pure POSIX make Makefile.<p>2. Like the above, but add conditionals, like `if` statements.<p>3. Like both of the above, but add constrained `for` loops.<p>4. Screw it, add `while` loops and make it Turing-complete.<p>5. Let&#x27;s go Hole Hawg [1] and add metaprogramming!<p>Some projects will never leave level 1. Some will never leave level 2. Most will never leave level 3. Most of the remaining few will never leave level 4. But for those that need it, level 5 <i>still exists!</i> And more importantly, so does level 4.<p>This means that the projects that don&#x27;t need power won&#x27;t use it and can have all of the advantages of a less-powerful language. It also means that the other projects won&#x27;t curse their build system. Everyone&#x27;s happy!<p>(As a sidenote: implementing this idea is easy; the build system just needs to not allow certain &quot;keywords&quot; in each setting. In fact, you could make it even more granular by allowing users to forbid individual keywords!)<p>This is an extension of a comment I wrote recently. [2] I replied to someone who asked if Guy Steele was right when he said to restrict the grammar of your language.<p>My answer: he was, unless you need power. The more powerful your language, the more likely that an LR(1) grammar is not sufficient for it, to the point that for the most powerful of languages, only an all-powerful Turing-complete parser can parse them.<p>There is no substitute for power. But use as little as possible.<p>So yes, we need less powerful languages. We also need more powerful ones.<p>Perhaps what we <i>really</i> need is a language whose power you can tune to <i>your</i> needs. (Shameless plug: stay tuned!)<p>[1]: Read the &quot;Hole Hawg&quot; section of &quot;In the Beginning Was the Command-Line&quot; by Neal Stephenson. <a href="https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20180218045352&#x2F;http:&#x2F;&#x2F;www.cryptonomicon.com&#x2F;beginning.html" rel="nofollow">https:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20180218045352&#x2F;http:&#x2F;&#x2F;www.crypto...</a><p>[2]: <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34416730" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=34416730</a>