
Show HN: LuaJIT assembler/assembly language for direct bytecode programming - Rochus
https://github.com/rochus-keller/LjTools
======
Rochus
Thanks for the suggestion. I think mostly people who want to use LuaJIT as a
backend for another language, not primarily Lua programmers, might be
interested in my work. Here is an article describing the project:
[https://medium.com/@rochus.keller/implementing-call-by-
refer...](https://medium.com/@rochus.keller/implementing-call-by-reference-
and-call-by-name-in-lua-47b9d1003cc2)

~~~
SlowRobotAhead
> LuaJIT as a backend for another language, not primarily Lua programmers

Not exactly backend but that kinda fits my use case. I have a C embedded
application that I need scripting on. Nothing unsecure from the user, from my
own backend, but it requires a foreign function interface, and its a super
constrained device.

Lua, JavaScript, forth, etc. None I’ve been able to find anything I like under
50 kB flash or are even slightly “friendly”.

Found one in JavaScript was close, but it’s an interpreted language which
means every letter of code is a byte I need to transfer then have parsed.

I’ll look into this. Esp if it’s still possible to send just bytecode in.

~~~
rafa1981
I don't know if luajit runs in your device, but vanilla luajit supports
generating and loading bytecode.

[https://luajit.org/running.html](https://luajit.org/running.html)

~~~
SlowRobotAhead
I think primarily it’s the ffi I would be missing. This would get me a turing
complete language but set up as an executable it’s wrong for me.

~~~
rafa1981
Notice that if I remember correctly, you can generate bytecode on the PC (by
using the luajit command) and have the resulting bytecode loaded through the C
API on your device as if it were a regular script.

------
luadigest
Would you be interested in writing a short editorial on this for the Lua
Digest newsletter?

[https://luadigest.netlify.app](https://luadigest.netlify.app)

------
rsrsrs86
This is very interesting work! I am poking around CPython and Python bytecode
to learn about compilation/VM/interpretation and I was thinking about writing
cose directly in Python bytecode to play with.

The UI on top looks very handy!

Kudos

------
kzrdude
Tangential, but what's LuaJIT's maintenance status?

~~~
faizshah
I was also interested, here's the latest update:
[https://www.freelists.org/post/luajit/Regular-releases-
for-l...](https://www.freelists.org/post/luajit/Regular-releases-for-luajit-
from-the-new-repo-and-future-roadmap)

It doesn't look like there's been a release since May 2017 though.

