编程语言需要哪些功能?
最近我的大学为本科生设立了大型项目。其中一个项目是创建一种新的编程语言,其中包含其他语言的所有最理想的部分。现在,我知道很多事情对我来说很难有效地(甚至紧密地)实现 - 例如,使语言非常接近自然语言。
有一些很好的功能,例如高阶函数和用于交换两个变量值的运算符。然而,我正在努力想出很多建议,因此我们将非常感谢一些建议 - 最好的建议将被标记为答案。不过,我只是在这里寻找想法,而不是如何实现它们的方法。
Recently my university has set large projects for its undergraduates. One of these projects is to create a new programming language with all of the most desirable parts of other languages. Now, I know that many things would be pretty infeasible for me to implement efficiently (or even closely) - making the language very close to natural language for example.
There are some neat features that would be nice, like high order functions and an operator for swapping the value of two variables. However I am struggling to think of very many, so some suggestions would be very much appreciated - the best one gets marked as the answer. I am only looking for ideas here though, not methods for how to implement them.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我喜欢的功能:
price["apple"] := 0.99
:=
运算符,而不是=
;)case "apple": Price : = 0.99 。
Features I like:
price["apple"] := 0.99
:=
operator for assignment, instead of=
;)case "apple": price := 0.99
.多重继承会很好......尽管它在任何当前语言中都不可用。
Multiple Inheritance would be nice...though it's not available in any current languages.
目前,我渴望像 JavaScript eval 这样的语言功能,并具有执行已评估指令序列的额外功能:
也就是说,语言运行时可以解释并执行用该语言编写的语句。
——p
At present, I'm yearning for a language feature like JavaScript eval, with the additional power that it would execute the eval'ed instruction sequence:
That is, the language run-time could interpret and execute statements written in the language.
-- p
最强大的一个:
The most powerful one: