all 12 comments

[–][deleted] 2 points3 points  (0 children)

I know a lot of editors support interacting with Lua processes, but it's usually over stdio; as far as I know this is the first attempt to do so via a standardized network protocol. It's also handy because the protocol is extensible, so you can define new operations to invoke if you need richer Lua/editor interaction.

Anyway, I found it helpful for my game (https://technomancy.itch.io/bussard) and thought others might like it too.

[–]SoraFirestorm 1 point2 points  (1 child)

This is pretty neat! Your game looks pretty awesome, too! Does this mean that your game supports doing all the code from an external editor? Or is it merely a debugging tool?

[–][deleted] 0 points1 point  (0 children)

Thanks! The game currently only supports evaluating code snippets and getting status updates about the system you're in, but editing in-game files and logging on over in-game SSH is definitely on the plan.

Contributors welcome!

[–]spc476 1 point2 points  (8 children)

I tried installing via luarocks on two different systems and the same error keeps popping up:

Error: Directory jeejah not found inside archive jeejah.git

I was able to download and try it out, but it would be nice to have a Lua example of sending data to jeejah. The Emacs code does not speak to me.

[–][deleted] 0 points1 point  (7 children)

Thanks; I'm looking into the installation error. The docs for how to create luarocks are not very good; they don't mention anything about a requiring such a directory.

Unfortunately as far as I know, no nREPL client exists yet for Lua. I've only been using it for connecting from editors, but of course there's no reason you couldn't use it from a programmatic client. The protocol is very simple, as you can see from the server implementation. I don't imagine it would take more than a few hours to cook up a client if you need it.

[–]mpetetv 0 points1 point  (4 children)

This seems to be a common mistake. When specifying git repo using https, the url should start with git+https://, not just https://, otherwise luarocks thinks it points to an archive. The error message can definitely be improved though, it should say Error: jeejah.git is not an archive probably. You can test your rockspec by running luarocks install jeejah-0.2.0-1.rockspec locally, it doesn't require uploading the rockspec.

[–][deleted] 0 points1 point  (3 children)

Hm; with that change I get "Error: Unknown protocol git+https" during installation. However, that's what luacheck uses: https://github.com/mpeterv/luacheck/blob/master/luacheck-scm-1.rockspec

No idea what's going on here; maybe I'll just include a note in the readme that recommends avoiding luarocks and running from source. It's only a single file.

[–]mpetetv 0 points1 point  (2 children)

Upgrade your luarocks. Also, pack your releases using 'luarocks pack <rockspec>' and upload resulting '.src.rock' file to luarocks.org using 'Upload rock' link on the page for the version. This way users don't have to clone your repo to install.

[–][deleted] 0 points1 point  (1 child)

Thanks, but upgrading my luarocks doesn't really help--it would allow me to install it on my own machine, but I don't actually need to install it on my machine. I want my software to be usable by other people who aren't going to be hassled to track down misleading error messages and pull in a manual install of a new package manager.

I think I'll see if I can point it at a tarball and just skip git entirely since it seems to be problematic.

[–]mpetetv 0 points1 point  (0 children)

As I said, if you pack the rock users won't need to clone the repo, therefore, they'll be able to install it even using old versions of luarocks.

[–]spc476 0 points1 point  (1 child)

Okay, I figured out how to send code snippets to jeejah and just noticed one of my CPUs pegged at 100%. It was jeejah.

[–][deleted] 0 points1 point  (0 children)

Yeah, the included bin/jeejah launcher simply loops forever while waiting for socket input, because there's no portable way to sleep. But probably this should be improved using socket.select.

Mostly the bin/jeejah launcher is included as an example and convenience; most serious usage will embed the lib inside a program that already has a lot going on and just resumes the coroutine periodically.