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

查看:93
本文介绍了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具有一流功能的独特实现,我认为它们应该提交给《函数式编程学报》以供发表. em>.

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 《编程语言和系统事务》 中发表,因此我再次认为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天全站免登陆