lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I'm impressed with the ideas that came up on the subject OOP in Lua. But most (if not all) of them lack a clear syntax in on place or another. I need a simple, clear syntax so users of my apps can extend it without much trouble.

Am I asking for syntatic sugar? Yes, sure! We already have some:

local function f(...)
which translates to
local f; f = function(...)

which is the same as

"self" and ":" are sugar too.

And what about being able to write
a = b *c
instead of
_G['a'] = _G['b'] * _G['c'] ?

The global environment is just a table afterall...

If my users have to write cryptic code just to extend an existing class, code a constructor or call an inherited method, it's time to try another language.

But is there a script language out there that:

1) Has a clear syntax
2) Has a small footprint
3) Doesn't come with lots of modules that you can't remove from the core
4) Has garbage collection
5) Compiles in almost every plataform/compiler
6) Is designed to embeded or is extremely easy to embed
9) Has a nice API
10) Is easy to extend
11) Is (not necessarely only) object oriented

Sure there are some that have almost all those characteristics, and I tried some of them. The main problems are with items 3, 5 and 6. I could't get any of Pike, Ferrite, ElastiC and Ruby to compile under Windows with BCC32.

I know the problem is not with Lua. The problem is maybe with Windows? Why do I insist with Windows? Because it has much more users than all other alternatives.

I love Lua, I want to continue using Lua, but the only reason I'm discussing OOP in Lua is the lack of an alternative. Having a clean workaround would do it, but maybe putting OOP in the core won't make it much bigger and maybe Lua would get a broader audience?


Andre de Leiradella