Weird Languages
August 2021 When people say that in their experience all programming languages are basically equivalent, they're making a statement not about languages but about the kind of programming they've done.
2021 年 8 月 当人们说根据他们的经验,所有编程语言基本上都是等效的时,他们并不是在谈论语言,而是在谈论他们所做的编程类型。
99.5% of programming consists of gluing together calls to library functions.
99.5% 的编程包括将对库函数的调用粘合在一起。
All popular languages are equally good at this.
所有流行语言在这方面都同样擅长。
So one can easily spend one's whole career operating in the intersection of popular programming languages.
因此,一个人很容易将自己的整个职业生涯都花在流行编程语言的交集上。
But the other .5% of programming is disproportionately interesting.
但另外 0.5% 的编程却异常有趣。
If you want to learn what it consists of, the weirdness of weird languages is a good clue to follow.
如果你想了解它的组成部分,奇怪语言的怪异性是一个很好的线索。
Weird languages aren't weird by accident.
奇怪的语言并不是偶然出现的。
Not the good ones, at least.
至少不是好的。
The weirdness of the good ones usually implies the existence of some form of programming that's not just the usual gluing together of library calls.
好的程序的奇怪之处通常意味着某种形式的编程的存在,而不仅仅是通常将库调用粘合在一起。
A concrete example: Lisp macros.
一个具体的例子:Lisp 宏。
Lisp macros seem weird even to
Lisp 宏甚至对于
many Lisp programmers.
许多 Lisp 程序员。
They're not only not in the intersection of popular languages, but by their nature would be hard to implement properly in a language without turning it into a dialect of Lisp.
它们不仅不属于流行语言的交集,而且就其本质而言,如果不将其转变为 Lisp 方言,就很难在语言中正确实现。
And macros are definitely evidence of techniques that go beyond glue programming.
宏无疑是超越胶水编程的技术的证据。
For example, solving problems by first writing a language for problems of that type, and then writing your specific application in it.
例如,首先为该类型的问题编写一种语言,然后用它编写特定的应用程序来解决问题。
Nor is this all you can do with
这还不是你能做的全部
macros; it's just one region in a space of program-manipulating techniques that even now is far from fully explored.
宏;它只是程序操作技术空间中的一个区域,即使现在还远未得到充分探索。
So if you want to expand your concept of what programming can be, one way to do it is by learning weird languages.
因此,如果你想扩展你对编程的概念,一种方法就是学习奇怪的语言。
Pick a language that most programmers consider weird but whose median user is smart, and then focus on the differences between this language and the intersection of popular languages.
选择一种大多数程序员认为奇怪但中间用户很聪明的语言,然后关注这种语言与流行语言的交集之间的差异。
What can you say in this language
你能用这种语言说什么
that would be impossibly inconvenient to say in others?
这句话在别人嘴里说出来会不会很不方便?
In the process of learning how to say things you couldn't previously say, you'll probably be learning how to think things you couldn't previously think.
在学习如何说出以前无法说出的事情的过程中,您可能会学习如何思考以前无法想到的事情。
Thanks to Trevor Blackwell, Patrick Collison, Daniel Gackle, Amjad Masad, and Robert Morris for reading drafts of this.
感谢 Trevor Blackwell、Patrick Collison、Daniel Gackle、Amjad Masad 和 Robert Morris 阅读本文的草稿。