[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: origins of Lua
- From: Boyko Bantchev <boykobb@...>
- Date: Sat, 6 Aug 2005 23:11:34 +0300
The other day I read http://lua.org/history.html .
One thing that I was interested in was what languages
influenced Lua, and in what respects. Here is what I
found, in order of appearance in the text.
`... syntax borrowed from Modula (while, if, and repeat
`From CLU we took multiple assignment and multiple returns
from function calls ...'
`From C++ we took the neat idea of allowing a local variable
to be declared only where we need it.'
In fact, all these could be attributed to CLU -- especially
since CLU is indeed mentioned and is created earlier than
Modula and C++. So I was curious why the authors chose not
to do so.
(To be precise, it is true that Modula (like Pascal) has a
`repeat-until' statement which CLU doesn't, but that is a
minor point, imo.)
That CLU must have been the language that Lua borrowed
syntax from can be seen from other details, such as:
-- semicolons are not used as statement separators/
terminators in CLU: this is a very distinctive
feature of CLU among Algol-like imperative languages
(the authors mention FORTRAN as a language without
semicolons, but it has no free-form syntax either);
-- in CLU, the `not equal' operator is written ~=
which is also distinctive of the language
(in Modula, `not equal' is <> or #);
-- the word `yield', introduced later in Lua 5, is
used in CLU, and, to my best knowledge, not in any
other language until Python and Ruby.
As for allowing local variable declarations anywhere, let
me mention that that was present not only in CLU but
at least as early as in Algol 68.
So, my question is, why CLU isn't more strongly emphasized
as being influential to Lua instead of the other languages