Can eLua use normal Lua libraries

classic Classic list List threaded Threaded
4 messages Options
Blackdragon1400 Blackdragon1400
Reply | Threaded
Open this post in threaded view
|

Can eLua use normal Lua libraries

I want to develop with eLua in a Desktop environment in preparation for porting some libraries to an embedded device, specifically libpcap and libnet. Ideally I would like to run the eLua version of Lua with these networking libraries (and maby a few other generic Lua libraries) added. Is this possible? How would I go about making it work?

If this is a stupid question I am quite new to embedded systems so please go easy on me =)

Thanks!
BogdanM BogdanM
Reply | Threaded
Open this post in threaded view
|

Re: Can eLua use normal Lua libraries

Hello,


On Thu, Jun 6, 2013 at 1:33 AM, Blackdragon1400 <[hidden email]> wrote:
I want to develop with eLua in a Desktop environment in preparation for
porting some libraries to an embedded device, specifically libpcap and
libnet. Ideally I would like to run the eLua version of Lua with these
networking libraries (and maby a few other generic Lua libraries) added. Is
this possible? How would I go about making it work?

If this is a stupid question I am quite new to embedded systems so please go
easy on me =)

Not a stupid question at all. If your embedded system happened to be based on Linux, the answer would be "must likely yes". But on a bare-metal system like eLua we don't have the required OS support for running libpcap/libnet, so unfortunately the answer is "no".

Best,
Bogdan
 

Thanks!



--
View this message in context: http://elua-development.2368040.n2.nabble.com/Can-eLua-use-normal-Lua-libraries-tp7578060.html
Sent from the eLua Development mailing list archive at Nabble.com.
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
jbsnyder jbsnyder
Reply | Threaded
Open this post in threaded view
|

Re: Can eLua use normal Lua libraries




On Fri, Jun 7, 2013 at 6:25 AM, Bogdan Marinescu <[hidden email]> wrote:
Hello,


On Thu, Jun 6, 2013 at 1:33 AM, Blackdragon1400 <[hidden email]> wrote:
I want to develop with eLua in a Desktop environment in preparation for
porting some libraries to an embedded device, specifically libpcap and
libnet. Ideally I would like to run the eLua version of Lua with these
networking libraries (and maby a few other generic Lua libraries) added. Is
this possible? How would I go about making it work?

If this is a stupid question I am quite new to embedded systems so please go
easy on me =)

Not a stupid question at all. If your embedded system happened to be based on Linux, the answer would be "must likely yes". But on a bare-metal system like eLua we don't have the required OS support for running libpcap/libnet, so unfortunately the answer is "no".

I'll add to this a little bit, since it sounds like you want to use the existing libraries on a desktop version of the eLua sources first before making embedded versions of libraries.

You can compile the eLua sources as a desktop version of Lua.  The desktop side for LuaRPC (which is just Lua w/ some specific libraries included, compiled from eLua sources) is an example of this:

As for how one would add these modules you can see the list of module source files in rpc-lua.lua, and I think inc/desktop/platform_conf.h (through LUA_PLATFORM_LIBS_ROM or LUA_PLATFORM_LIBS_REG) may give you what you'd need to compile an extra module into the binary.  I've not tried using dynamic loadable modules against the eLua sources.

You'll also want to keep this in mind when working on modules for eLua: http://www.eluaproject.net/doc/v0.9/en_arch_ltr.html

I can't recall if you can get away with not doing this for compiling the luarpc binary on the desktop or not.
 
Now, as for getting versions of the mentioned libraries or others going on a small MCU target, you may be in for a fair bit of rewriting or re-implementing depending on how memory-hungry they are and what their dependencies are.


Best,
Bogdan
 

Thanks!



--
View this message in context: http://elua-development.2368040.n2.nabble.com/Can-eLua-use-normal-Lua-libraries-tp7578060.html
Sent from the eLua Development mailing list archive at Nabble.com.
_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev


_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev



--
James Snyder
Biomedical Engineering
Northwestern University
http://fanplastic.org/key.txt
ph: (847) 448-0386

_______________________________________________
eLua-dev mailing list
[hidden email]
https://lists.berlios.de/mailman/listinfo/elua-dev
Blackdragon1400 Blackdragon1400
Reply | Threaded
Open this post in threaded view
|

Re: Can eLua use normal Lua libraries

Great, I'll give that a try.

Thanks!