I agree that documentation is useful and important, but too much programming languages documentation really doesn't answer some fundamental questions about the semantics of a language.
All too often, this is because the programming language designers/implementors don't know what the semantics are.
It's very terse. The "Programming in Lua" book, by one of the authors of the language is far more friendly (an excellent book actually, the first version is available online for free: http://www.lua.org/pil/).
I use Lua quite a bit (Lua & C on Unix is my dev environment of choice, actually), but I haven't seen a written formal semantics for it, just the reference manual and bytecode guide. I'm thinking more like _The Definition of Standard ML_ - something that's very "math-y".
I was wondering about that today, actually - the designers are changing / simplifying the behavior for non-local environment scoping in Lua 5.2 (http://lua-users.org/lists/lua-l/2010-02/msg00753.html), and have been discussing the implications on the mailing list.
I follow that discussion too (and posted some messages). The new proposal is great IMO. Simple yet powerful.
There's no formal semantics, that's true, but I think one wouldn't be very long (although I would be absolutely unable to write it myself). The semantics of the more elaborate constructs of the language (the generic for loop, metamethods) are detailed in the manual as Lua code.
One could argue that code is math, according to the Curry-Howard isomorphism... But I'm no mathematician so I don't know if the point is valid in this context.
I ask because it's the language I'm trying to learn currently and so far it seems to have a core that's something like "Scheme with syntax" (Although I guess it's actually a lisp-2). But I don't know if it has weird edge cases that I haven't gotten to yet.
Erlang, too, has a core language which is pretty concise. I haven't seen a formal specification of its semantics, though.
FWIW, I found that Erlang made quite a bit more sense after I spent some time with Prolog. Erlang started out as a DSL built on SICStus Prolog, and a lot of its design decisions carried over from there.
Comments
That's where a language's documentation intervenes. Some have a very small and simple core (Scheme) with well-defined behaviour.
Topic treated as well in the famous law of leaky abstractions : http://www.joelonsoftware.com/articles/LeakyAbstractions.htm...
I agree that documentation is useful and important, but too much programming languages documentation really doesn't answer some fundamental questions about the semantics of a language.
All too often, this is because the programming language designers/implementors don't know what the semantics are.
I'd say that having "a very small and simple core with well-defined behavior" is the exception, not the rule.
Off the top of my head, the only languages I can think of with small, precisely defined formal semantics are Scheme, SML, Joy, and Prolog.
You can add Lua to your list.
Here's the full manual including:
TOC: http://www.lua.org/manual/5.1/Manual: http://www.lua.org/manual/5.1/manual.html
It's very terse. The "Programming in Lua" book, by one of the authors of the language is far more friendly (an excellent book actually, the first version is available online for free: http://www.lua.org/pil/).
I use Lua quite a bit (Lua & C on Unix is my dev environment of choice, actually), but I haven't seen a written formal semantics for it, just the reference manual and bytecode guide. I'm thinking more like _The Definition of Standard ML_ - something that's very "math-y".
I was wondering about that today, actually - the designers are changing / simplifying the behavior for non-local environment scoping in Lua 5.2 (http://lua-users.org/lists/lua-l/2010-02/msg00753.html), and have been discussing the implications on the mailing list.
I follow that discussion too (and posted some messages). The new proposal is great IMO. Simple yet powerful.
There's no formal semantics, that's true, but I think one wouldn't be very long (although I would be absolutely unable to write it myself). The semantics of the more elaborate constructs of the language (the generic for loop, metamethods) are detailed in the manual as Lua code.
One could argue that code is math, according to the Curry-Howard isomorphism... But I'm no mathematician so I don't know if the point is valid in this context.
Would Erlang fit this catagory?
I ask because it's the language I'm trying to learn currently and so far it seems to have a core that's something like "Scheme with syntax" (Although I guess it's actually a lisp-2). But I don't know if it has weird edge cases that I haven't gotten to yet.
Erlang, too, has a core language which is pretty concise. I haven't seen a formal specification of its semantics, though.
FWIW, I found that Erlang made quite a bit more sense after I spent some time with Prolog. Erlang started out as a DSL built on SICStus Prolog, and a lot of its design decisions carried over from there.