11 сент. 2007 г.

Closing over context still not easy in mainstream languages?

"Lisp 1.5, complete with support for lexical closures, appeared in 1959. It’s 2007. That’s forty-eight years."

http://www.lshift.net/blog/2007/09/11/closing-over-context-still-not-easy-in-mainstream-languages-film-at-11

Use Lua, man, use Lua!..

3 комментария:

tonyg комментирует...

I did say *mainstream* languages ;-)

Seriously, Lua's an interesting language - but I think if I got to choose a language to take over the world, it'd be the one I have in my head that's the best parts of Scheme, Smalltalk, ML, Self, Spoon, and Javascript all rolled together. Like *that's* going to happen...

Александр Гладыш комментирует...

And we get down to what 'mainstream' is.

For me to be in TIOBE top 15 is mainstream enough. Well, it is back to top 20 now, but anyway...

If we're talking about closures, in my opinion, Lua is the best wide-known (if mainstream is too demanding word) language around, which supports them.

Best by sum of features of course -- it has syntax, comprehendable even by non-programmers, while being fast, elegant, portable, have brilliant implementation and so on. You'll probably find a language, which is better than Lua in one or few of such fields -- but they'd loose in all others. Lua is the most balanced in that sense of all languages that I've seen.

I'd say that for me now switching back to Lua from something mainstream (in a bad sense of word) is a great pleasure. C++ is a notable exception -- but only because I've get used to it for a decade.

Say, JavaScript is a fine language (it is quite close to Lua in some parts by the way), but existing 'mainstream' browser implementation(s) (and you know which one I mean) is killing all the fun -- and non-browser commercial applications of this language are rare.

The main disadvantage of Lua -- for 'mainstream' usage that is -- is a lack of libraries. But it is compensated by existing comfortable ways for library binding (and amount of usable libraries is growing all the time).

...I've tried Haskell, I've tried some Lisp and Scheme etc.-- my brain rejoiced. Those languages are good for me -- but they are definetely not casual enough. Would you find a good job which would require you to program in them? If you'd talk your boss into using them in the next project -- would he be able to find someone else to support the code in the case you'll... eh.. win 100 million dollars in lottery and move to Bahamas?

Well, those are rhetorical questions, and answers do heavily depend on the 'area' you (and your boss) live in. ;-)

Anyway -- you can always embed Lua in your application -- even 'on your own risk', and, with some luck, your successor would have no or little problem supporting code. (This is even more true due to popularization of Lua by WoW etc.)

So, this is the one more thing for me what Lua is. It is a refuge from the 'casual' (again in bad sense) programming environments.

I did not said you should take Lua and use it everywhere and for every task and take over the world with it. No. But for me Lua is more than just 'interesting' language. It is a passion.

Sorry for so much letters in my reply :-)

Александр Гладыш комментирует...

Well, to get to the point: I've actually said "use Lua", but I meant something like: "I consider Lua to be 'mainstream enough', and it has 'easy to use' adequate closure implementation". ;-)