lua-users home
lua-l archive

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


Hmmm... you are choosing a solution that is rarely chosen for libraries,
even though lua has no special requirements that differentiate it from
other libraries.

My pragmatic view on this is:
1. I believe that most people compile the lua libraries as C libraries.
    Because then they can use the library from both C++ and C projects.
2. Most compilers and people automatically launch the C compiler if a
    file has a .c extension
Therefore most lua libraries are compiled as C libraries.

I believe that many (if not most) programmers use the lua interpretter
from within C++ code.
Forcing them to include the luad headers like this:
extern "C"
{
#include <lauxlib.h>
#include <lualib.h>
}
Which many people find ugly, because it's error prone.

Also I see no special benefits in compiling the lua libraries as C++ code..
but even if there was a benefit, lua could still be compiled as C++ code,
but with external C binding.

Therefore, the solution (to add extern "C" declarations to the main headers)
would make many people happy and few people angry ;)

I fully accept that it's up to you to chose the right solution for lua, but
I also
find the rationale behind your decision flawed.

Best regards,
Thomas Andersen

----- Original Message -----
From: "Luiz Henrique de Figueiredo" <lhf@tecgraf.puc-rio.br>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
Sent: Wednesday, April 09, 2003 3:01 PM
Subject: Re: Very small feature request


> >I believe that many C++ developers use lua these days.
> >Although the lua interpreter is written in C, it would be nice if the 3
main
> >headers had extern "C" declarations in them.
>
> This is a frequent request. However, Lua's implementation compiles under
both
> C and C++. Adding extern "C" would force it to be a C library instead of a
C++
> library.
> --lhf