lua-users home
lua-l archive

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


On Wed, Oct 24, 2007 at 11:51:44AM -0700, Bilyk, Alex wrote:
> I do mostly C++ for a living and like a lot its features (not a big fan
> of exceptions though). Strangely enough, I have never even wished for
> Lua to be in C++. It can be done, to be sure, but the simplicity will be
> gone, the performance will likely drop, the size will likely increase.
> Given all the above, among bigger, slower and more complex languages Lua
> would have much stiffer competition for the programmers' mind share in
> addition to losing some of its niche in resource limited applications.

Erm, before things get out of hand, let me clarify some things:

- I am NOT suggesting to move Lua to C++. That said, I am wondering
  whether it would make sense to have a C++ implementation of Lua
  _in addition_ to the original Lua, an implementation that might
  be better suited for some Lua users that do _not_ deal with
  specialised embedded scenarios (where there might not even be a
  C++ compiler, I know).

- My expectation would be that a well-designed Lua in C++ would have a
  smaller source code, be more flexible, and at least as fast as the
  original; this is of course pure speculation until somebody actually
  goes ahead and does this; as stated, I was only pretending to start
  on such a project for a few hours because it gave me the right "mind
  set" to dig into the Lua code in order to understand the internals of
  Lua better (which helps me in my role as regular Lua user embedding
  it into some other software).

(For example, I could imagine that, with some sufficiently well adapted
and optimised discriminated union class it would be possible to get rid
of the userdata datatype because datatype handling would be symmetric
wrt. built-in and additional datatypes, i.e. adding new datatypes to
what is now "union GCobject" could be made really simple...)

Regards, Colin


> -----Original Message-----
> From: lua-bounces@bazar2.conectiva.com.br
> [mailto:lua-bounces@bazar2.conectiva.com.br] On Behalf Of Ralph Hempel
> Sent: Wednesday, October 24, 2007 11:05 AM
> To: Lua list
> Subject: Re: Start of Lua rewrite in C++
> 
> Colin wrote:
> > On Wed, Oct 24, 2007 at 03:14:53PM -0200, Luiz Henrique de Figueiredo
> wrote:
> >> What's the point of rewriting Lua in C++? The code already compiles
> as C++.
> 
> > That's a spontaneous brainstorm...
> 
> Colin, somebody else will probably chime in here, but the fact that
> Lua compiles under straight ANSI C is a complete win for the deeply
> embedded field that myself and others use Lua in.
> 
> Moving to C++ will flat out not work on many small systems.
> 
> Ralph