[Screeninvader] Using luajit to bundle Lua bytecode, instead of objcopy/otool ..

phaer phaer at phaer.org
Sat Mar 14 14:18:45 CET 2015


Hi,

I did not really investigate different lua frameworks, but tried 
(and succeeded) to find a quick and dirty way to open a websocket
to janosh without writing too much cpp. A small POC on top of [1]
is on the lounge ScreenInvader.
The general idea was simply to open a socket so that the JS client 
could talk directly to Janosh, because there isn't any form of
access control anyway.

I don't have a strong opinion on luvit or similar frameworks, but 
its usefulness depends on the question of what you'd like to
implement on the server side. For my ideas, something like [2]
seems to be sufficent.

Using luajit to generate header files looks like a good idea to me.
objcopy, on the other hand, is a part of GNU binutils which are quite
common dev dependencies.


[1]: https://github.com/lipp/lua-websockets 
[2]: http://stevedonovan.github.io/Penlight/api/manual/01-introduction.md.html

On Fri, Mar 13, 2015 at 09:24:28PM +0100, Jay Vaughan wrote:
> So I???m trying to catch up with the Janosh changes this evening, and stumbled into this (on Darwin):
> 
> 
> ~/Documents/screeninvader/Janosh $ make
> objcopy --input binary --output elf64-x86-64 --binary-architecture i386 JSON.lua JSON.o
> make: objcopy: No such file or directory
> 
> This is one way to do this - but another way is to use luajit to generate a header file from .lua sources, and then include those headers in the c/c++ project.  See here for reference:
> 
> http://stackoverflow.com/questions/19416981/running-luajit-object-file-from-c
> 
> Before I fix up lua_script.h/.cpp to use this technique, I wanted to run it by you guys first .. is it a problem to have the external tool dependency in place (luajit) instead of using the objcopy/otool method?  My personal choice would be to use luajit - this means its the same tool on all platforms (no objcopy on Darwin) so I think this would be a cleaner/portable change - but it means auto-generated header (.h) files as a build step using luajit first.  No problems with that?  If no, then I???ll make the change ..
> 
> 
> ;
> --
> Jay Vaughan
> seclorum at icloud.com
> 



> _______________________________________________
> Screeninvader mailing list
> Screeninvader at lists.metalab.at
> https://lists.metalab.at/mailman/listinfo/screeninvader




More information about the Screeninvader mailing list