I'm not sure if this belongs in development or scripting, but I figure it's more aimed at the people who would be writing scripts.
Right now, the lua interface is mostly a copy of the ubasic interface. This is limiting because lua is
much more flexible, and also results in an interface that is more clumsy and less intuitive than it needs to be (see motion detection for example. Or compare the ubasic time functions to os.date())
A few things that lua can do, which ubasic can't:
- Interfaces to CHDK code can easily be exposed as functions, objects or tables.
- C functions can accept or return multiple values of any lua type.
- Lua functions could act as "call backs" that are run when a particular event happens in C.
- Structures and arrays in C can easily be made to appear as lua tables.
Many things that ubasic needs done in C can be handled by lua modules, which can be included in the distribution. The propcase stuff is a simple example. This keeps the CHDK core simple, while letting script writers only load what they need.
If we want to design a nice interface, it's better to do it before there are a bunch of legacy scripts that would need re-writing.
OTOH, there is an argument that making the lua and ubasic as similar as possible makes maintenance easier, and makes it easier for users to switch back and forth. I don't find either very compelling, but I am open to being convinced. Even if the interface diverges significantly, you could probably make a lua module that made it look like the old interface.
So, script writers, what would do you want ? Is similarity to ubasic important ? What would your ideal scripting interface look like ?