lua-users home
lua-l archive

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


I don't think Lua is the next big thing as a standalone scripting language
and probably not as an extension language, at least not for applications
(it IS quite suitable for games). However, as an unexposed, internal
scripting language, I think it will go from strength to strength. Perhaps
we should stop thinking of Lua as a bolted-on addition to a C program and
think in terms of Lua-assisted C. I would be inclined to call the Lua + C
combination "Lunar-C", but hey, what do I know? ;-)

If you think about Objective-C, it's basically a small, highly dynamic
language tightly integrated with C for the parts of the code that need
high performance or interaction with existing C libraries. It combines the
advantages of C with most of the advantages of Java/C# but doesn't require
a standalone VM on the target machine. It would seem to be a very advanced
and appealing language but has never really become popular. It's targetted
at C users, presumably, but isn't available on most C compilers and people
seem to find it a bit "postmodern" and don't quite trust it.

Now think about how Adobe have used Lua for Lightroom: most of the core
code written in Lua (small, highly dynamic language) tightly integrated
with C for the parts that need high performance or interaction with
existing C libraries. It combines the advantages of C with most of the
advantages of Java/C# but doesn't require a standalone VM on the target
machine... hmmm... Lunar-C is very much like Objective-C approached in a
different way. It works with your favourite C compiler and offers simple
but powerful high-level language features. On the other hand, it isn't as
seamlessly integrated as Objective-C, so you do still have to include Lua
headers and make calls to set up the lua_state and pass data to the
interpreter, etc.

I see tight integration with C code as Lua's major area for growth in the
future, and I think it could either be left to evolve naturally or pursued
as a goal in its own right. For instance, 

- at the bottom of the list of selected Lua Programming Gems there is an
item called "Interpreted C modules" which I am guessing is an inline C
system like Perl's CPR (apologies to Jerome if I am wrong about this).
This might provide a good basis to show how C source could be mixed
together with Lua source.

- Would it be possible to modify Lua's garbage collector so that it can be
used instead of malloc/free in the host C program (like the Boehm garbage
collector)?

- more straightforward linking to shared libraries?

- standard mechanism for reading/writing C structs and arrays as if they
were Lua tables?

Plenty of scope for development here. And the fact that Lua is a
self-contained language in its own right? Bonus.

&.


#####################################################################################
This e-mail message has been scanned for Viruses and Content and cleared 
by MailMarshal.
The Blackpool Sixth Form College.
#####################################################################################