Peter's Awesome Lua with the Core functionality we care about

TL:DR ; results

DukTape is a C engine for executing ECMAScript 5.1ish. (… or JavaScript or whatever we’re calling it this week) Notably, it’s distributed as a trio of source files to ease integration.

Lua is a C script engine (for the Lua languages) and is not distributed in such a nice way. So I spent a few hours preparing a (Python) script to repack Lua 5.3.3 into a single header. (By the time I fix my blog posting stuff 5.3.4 will probably be out)

Merry (belated) Christmas!

Why would you do this?

Mostly to conform to [Sean Nothings Barret’s]() constraints.

Who would care?

Anyone who wants to slap (somewhat) minimal Lua into a project and see what happens.

How did you do this?

I used a python 3.5.1 script to crack open the .tar.gz file, scan the Makefile, then concatenate sources as needed

  • I scan for some test cases that you (obviously) won’t have - sorry
  • You’ll need a .c (not .cpp … sorrynotsorry) file for Lua to actually compile … so there’s that.
  • … my tests are written in .cpp though … as is the Catch unit testing framework
  • I used a regex and POSIX line endings to get the whole thing under 1MB
    • so that KDiff likes it
    • … hopefully, future updates won’t break this
Peter LaValle avatar
About Peter LaValle
Peter is currently a PhD student at the University of Nottingham. His day work involves applying functional programming to problems with artificial intelligence. Someday maybe he'll retire and be a graphics programmer or demoscene coder.
comments powered by Disqus