New scripting capabilities - Adding Lua

Discussion to talk about software related topics only.
Post Reply
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

New scripting capabilities - Adding Lua

Post by dciliske »

As mentioned in an earlier thread, I've been working on porting the Lua interpreter to the Netburner runtime. I'm happy to announce that as of the next beta release, it will available. It is still a work in progress, lacking drivers for most Netburner library functions, but it functions and is fairly high level.

Some information about the implementation of the Lua interpreter itself:
  • It is dynamically allocated. It currently does not have a setting to create a soft limit.
  • All numbers alike. The type is set by a compile time flag. It defaults to double.
  • Strings are internally cstrings: memory efficient, but resizing, concatination, etc. are expensive as usual.
That said, the memory usage is on the order of 200k flash and ram for the interpreter functions and ~20k ram for a base interpreter instance. Speed seems acceptable for user facing code, but has not been tested currently for extreme performance (though, anyone wanting to use a scripting language in an interrupt routine, let me know the results).

I'm working on getting a couple basic example apps for it to demonstrate user customizable webpages and emails, as well as examples for interfacing between Lua and C/C++ (populating a Lua environment/retrieving return values).
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
tony
Posts: 49
Joined: Thu Apr 24, 2008 6:05 pm

Re: New scripting capabilities - Adding Lua

Post by tony »

This is an interesting development for Netburner. What is the status of this project? Is this available for public release?
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: New scripting capabilities - Adding Lua

Post by dciliske »

It is currently in a beta state. It appears to have been missed in the installer for the last beta.

It is available, but missing a couple critical examples (script upload and custom webpages). Also, the the documentation is a work in progress.

The Lua interpreter is fairly separate from the rest of the system library and can be built like a normal project library.
If you have the latest beta (or are willing to install it). I can package up the source with a little install script if you'd like to try it out and to help us test it.
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
tony
Posts: 49
Joined: Thu Apr 24, 2008 6:05 pm

Re: New scripting capabilities - Adding Lua

Post by tony »

I will give it a shot. Just to add to the fun I ordered a MOD54415 to try it out on.
Post Reply