Topic treated as well in the famous law of leaky abstractions : http://www.joelonsoftware.com/articles/LeakyAbstractions.htm...
Topic treated as well in the famous law of leaky abstractions : http://www.joelonsoftware.com/articles/LeakyAbstractions.htm...
All too often, this is because the programming language designers/implementors don't know what the semantics are.
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.
Here's the full manual including:
- the language refenrence
- all standard library functions
- the C API.
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 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.
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.
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.