[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: C with embedded Lua or Lua-only program?
- From: Sean Conner <sean@...>
- Date: Fri, 3 Sep 2010 02:51:12 -0400
It was thus said that the Great Silas Silva once stated:
> Hi all,
> I've been done some research for a project of mine, regarding
> "embeddable" languages to make it extensible, and figured out that Lua
> would be the best solution for this particular situation.
> My question is: Lua is a language made to be embedded (like Tcl and
> Guile -- not sure about the last one), not like Python or Perl, which
> make it perfect to be used as a scripting language in a C program. But,
> over the time, lots of libraries were built on the top of Lua, that
> makes it a great general-purpose language. Should I make a C + Lua
> program or only Lua? Let me explain my problem:
Why not both?
I embedded Lua in a syslog daemon , but the way I compiled it , you
can include other Lua modules pretty much like you would do with the Lua
interpreter (I have a call to luaL_openlibs() in the program). I have had
no problems including other Lua modules (both Lua code and .so files as I'm
running under Linux) from within the scripts I've written for my syslog
 At least under Linux it's:
gcc -std=c99 -rdynamic -g -o syslogintr syslogintr.c -ldl -lm -llua