Skip to content

Comment on What are the semantics of your favourite programming language?parent

Comments

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.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.