Lua: Difference between revisions

Content deleted Content added
Correct the implementations box. Luvit and LuaRT are runtimes, not implementations. Luau adds new syntax, making it more appropriately designated as a dialect, rather than an implementation
Goof bug (talk | contribs)
m Remove incorrect link, SOL does not refer to the linked page here.
Line 45:
{{Quote|In 1993, the only real contender was [[Tcl]], which had been explicitly designed to be embedded into applications. However, Tcl had unfamiliar syntax, did not offer good support for data description, and ran only on Unix platforms. We did not consider [[Lisp (programming language)|LISP]] or [[Scheme (programming language)|Scheme]] because of their unfriendly syntax. [[Python (programming language)|Python]] was still in its infancy. In the free, do-it-yourself atmosphere that then reigned in Tecgraf, it was quite natural that we should try to develop our own scripting language ... Because many potential users of the language were not professional programmers, the language should avoid cryptic syntax and semantics. The implementation of the new language should be highly portable, because Tecgraf's clients had a very diverse collection of computer platforms. Finally, since we expected that other Tecgraf products would also need to embed a scripting language, the new language should follow the example of SOL and be provided as a library with a C API.}}
 
Lua 1.0 was designed in such a way that its object constructors, being then slightly different from the current light and flexible style, incorporated the data-description syntax of [[Secure Operations Language|SOL]] (hence the name Lua: ''Sol'' meaning "Sun" in Portuguese, and ''Lua'' meaning "Moon"). Lua [[Syntax (programming languages)|syntax]] for control structures was mostly borrowed from [[Modula]] (<code>if</code>, <code>while</code>, <code>repeat</code>/<code>until</code>), but also had taken influence from [[CLU (programming language)|CLU]] (multiple assignments and multiple returns from function calls, as a simpler alternative to [[Call by reference|reference parameters]] or explicit [[pointer (computer programming)|pointers]]), [[C++]] ("neat idea of allowing a [[local variable]] to be declared only where we need it"<ref name=hopl2007/>), [[SNOBOL]] and [[AWK]] ([[associative array]]s). In an article published in ''[[Dr. Dobb's Journal]]'', Lua's creators also state that LISP and Scheme with their single, ubiquitous data-structure mechanism (the [[List (abstract data type)|list]]) were a major influence on their decision to develop the table as the primary data structure of Lua.<ref name=ddj96>{{cite news |last1=Figueiredo |first1=L. H. |last2=Ierusalimschy |first2=R. |last3=Celes |first3=W. |date=December 1996 |title=Lua: an Extensible Embedded Language. A few metamechanisms replace a host of features |magazine=Dr. Dobb's Journal |volume=21 |issue=12 |pages=26–33 |url=https://www.lua.org/ddj.html}}</ref>
 
Lua [[semantics]] have been increasingly influenced by Scheme over time,<ref name=hopl2007/> especially with the introduction of [[anonymous function]]s and full [[Scope (computer science)#Lexical scope vs. dynamic scope|lexical scoping]]. Several features were added in new Lua versions.