Lua 是否主要基于成熟的编程语言思想? [英] Is Lua based primarily on well-established programming-language ideas?

查看:25
本文介绍了Lua 是否主要基于成熟的编程语言思想?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Lua 在可嵌入的语言空间中占有一席之地.Lua 设计背后的主要想法是来自实现者的新想法,还是 Lua 主要是成熟想法的良好执行组合?

Lua occupies a good place in the space of languages that can be embedded. Are the primary ideas behind Lua's design new ideas from the implementors, or is Lua primarily a well-executed combination of well-established ideas?

将 Lua 的特性和特性与其他 PL 进行比较是特别合适的.

Comparison of properties and features of Lua to other PLs are particularly appropriate.

推荐答案

这是一个非常有趣的问题.我的日常工作是学习编程语言,Lua 会回报认真的学习.我会说很少有其他语言(可能是 Icon 和 CLU).请注意,使 Lua 如此值得研究的是语言整体,而不是个别功能.

This is a very interesting question. My day job is to study programming languages, and Lua will repay careful study. I would say that about very few other languages (perhaps Icon and CLU). Please note that it is the language as a whole, not the individual features, which makes Lua so worthy of study.

这是实施者有有趣的新想法的结果,还是良好执行的成熟想法的结果?

Is this a result of interesting new ideas the implementors had, or is it a result of good execution of well-established ideas?

两者都有.有关详细信息,回答此问题的最佳来源是论文 Lua 的演变,出现在第三届 ACM 编程语言史研讨会上.但我会补充一些意见.

Both. For the details, your best source for an answer to this question is the paper The Evolution of Lua, which appeared at the Third ACM Symposium on the History of Programming Languages. But I will add a few comments.

  • 使用 Lua 表作为唯一可变的、非原子类型的数据是 Lua 团队发明的.他们受到了 CLU 发展的启发,我相信他们也知道 Awk 和 Icon 中的类似工作,但这种程度的改进是 Lua 团队的重要贡献.

  • The use of Lua tables as the only mutable, non-atomic type of data was invented by the Lua team. They were inspired by developments in CLU, and I believe they were aware of similar work in Awk and Icon, but the refinement to this degree is an important contribution of the Lua team.

表也有一个非常高效的实现,它是由 Lua 团队发明的.

Tables also have a very efficient implementation, which was invented by the Lua team.

Lua 的函数式特性与 Scheme 语义相同,但 Lua 有一流函数的独特实现,我认为他们应该提交在 Journal of Functional Programmingem>.

The functional features of Lua have the same semantics as Scheme, but Lua has a unique implementation of first-class functions, which I think they ought to submit for publication in the Journal of Functional Programming.

多年来,嵌入的 API 得到了极大的改进.它的主要区别在于用户定义的抽象类型可以完全参与嵌入.例如,这是使 Lua API 优于 Tcl API 的特性.多年来,Lua API 经历了大量改进,包括在 2.5 版中首次发布以来.Lua 设计者在此值得高度赞扬.

The API for embedding has been greatly refined over the years. Its main distinguishing characteristic is that user-defined abstract types can participate fully in the embedding. This is the property that makes the Lua API superior to the Tcl API, for example. The Lua API has undergone a great deal of refinement over the years, including since its first publication at version 2.5. The Lua designers deserve a great deal of credit here.

垃圾收集技术是标准的.

The garbage-collection technology is standard.

Lua 协程 代表了对一些非常古老的想法的新看法.新版本被认为值得在 ACM Transactions on Programming Languages and Systems 上发表,所以我再次认为 Lua 团队的原创性值得称赞.

Lua coroutines represent a new take on some very old ideas. The new take was considered worthy of publication in ACM Transactions on Programming Languages and Systems, so again I think the Lua team get credit for originality.

Lua 元表与 Common Lisp 元对象协议相关.

Lua metatables are related to the Common Lisp metaobject protocol.

我认为 Lua 的成功源于 Lua 团队的独特优势组合:

I think that Lua's success result from a unique combination of strengths of the Lua team:

  • 如果您阅读 HOPL 论文,您会看到Lua 团队非常了解编程语言的许多发展,并且能够从最好的想法中进行选择.大多数流行脚本语言的设计者都是业余爱好者,几乎没有那么了解情况.

  • If you read the HOPL paper, you'll see that the Lua team were well aware of many developments in programming languages and were able to choose from among the best ideas. Most designers of popular scripting languages have been amateurs and have not been nearly so well informed.

Lua 的设计非常出色,因此各个部件可以很好地结合在一起,并具有出色的功率重量比.这是随着时间的推移大量细化的结果,PUC-Rio 愿意让 Lua 团队在语言设计和实现上工作,而不是磨出大量的论文.这项工作不可能在北美大学完成.

Lua is superbly designed so that the pieces fit together very nicely, with an excellent power-to-weight ratio. This is the result of a lot of refinement over time, and PUC-Rio was willing for the Lua team to work on the language design and implementation instead of grinding out a huge number of papers. This work could not have been done at a North American university.

Lua 的设计非常出色.实施非常好.这部分是优秀工程师的出色工作,部分是在 15 年内不断修改设计的机会.

Lua is superbly engineered. The implementation is just staggeringly good. That's partly great work by great engineers and partly the opportunity to keep revising the design over a 15-year period.

最后我会要求读者不要低估选择提炼成熟的想法以形成一个连贯的整体的难度.这是一项极其困难的工作,很少得到应有的认可.

I'll close by asking readers not to underestimate the difficulty of choosing and refining well-established ideas to form a coherent whole. This is extremely difficult work and is seldom recognized as it should be.

这篇关于Lua 是否主要基于成熟的编程语言思想?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆