I would describe this as a Lua wrapper written in Rust. That carries the clear indication that you should not expect the interpreter to be written in Rust.
I would be (and indeed was) disappointed to see that this 'Lua runtime' did not have a Rust implementation of Lua. I would be much more interested in seeing that than a wrapper.
ok
https://github.com/nhatcher/ariana-lua
But next time I think I would like to have a language that compiles in the browser to wasm
> Node.js is a cross-platform, open-source JavaScript runtime environment that can run on Windows, Linux, Unix, macOS, and more.
First sentence for the Wikipedia article Deno:
> Deno is a runtime for JavaScript, TypeScript, and WebAssembly that is based on the V8 JavaScript engine and the Rust programming language.
First line of hero text from Node.js's site:
> Node.js® is a free, open-source, cross-platform JavaScript runtime environment that lets developers create servers, web apps, command line tools and scripts.
First line of hero text from Deno's site:
> Deno is the open-source JavaScript runtime for the modern web.
Node.js is easily the most famous example. Also deno, bun, winterjs, and probably a bunch more.
Someone upthread just linked a bunch of other equivalent lua projects that also refer to themselves as runtimes: https://news.ycombinator.com/item?id=46036362
I've also seen discussions where wrapping the servo-browser-engine in a UI layer referred to the UI layer as a runtime, though I think that's a substantially less canonical use of the word than referring to the part of an implementation that takes requests from the interpreter and executes them in the surrounding environment as a runtime.
(looks as if `code` words are redacted LOL)
Seems like it is a web server runime only?
Hmm, the website is confusing because: https://astra.arkforge.net/docs/latest/std/serde.html
Although even on https://astra.arkforge.net/docs/latest/std/crypto.html it mentions it is for web servers. ("During development of your web servers [...]")
So ultimately it indeed is for webservers, and the utilities are, too.
> Rather a wrapper over it with Rust libraries being available for use. Batteries included essentially
Any Rust libraries? Are there code snippets for random Rust libraries unrelated to webservers?
Not "any" Rust library, the idea is to not reinvent the already made libraries out there for the use cases of the standard library, and rather make an interop with Lua. I am not sure what would count as unrelated to webservers but there are file system, templating, database, cryptography (minimal at the moment), serialization and deserialization moudles, with upcoming compression, logging, testing, and more coming soon https://github.com/ArkForgeLabs/Astra/issues/114
You should totally implement BLAKE2b and ChaCha20. FWIW, BLAKE3 is in Rust already.
Additionally, these features seem to be highly related to web servers, IMO. Not exclusively so, but still.
The word "blazingly" exists nowhere on piccolo's github page according to ctrl-f.
In any case, a bad description term-wise. Being referred to as runtime made sense for Node & JS, since JS was until Node mostly confined to web browsers with Node setting it free giving native OS access, an event loop, and even a module system. Lua, Python, etc are already shipping as their own self-contained runtime. So calling a Lua, Python, etc wrapper in X as runtime written in X makes no sense.
It's a web application server written in Rust (Axum/Tokio), that has hooks into Lua bindings (mlua) so that application behaviors can be implemented in Lua.
Lua does ship a runtime, although it is incredibly limited in standard library, and lacks a lot of features that other languages ship out of the box. I could have either made a library to be used with each Lua VM or package everything into a single binary which was what we needed for our use case anyways, and gave a lot of control for us as well.
In any case, I agree that I should have been more clear in the description. It has not been updated since a while and the project moves very fast.
Anyway, for those who want a lua version of nodejs/bun/deno, try looking at https://luvit.io/ (lua) or https://lune-org.github.io/docs/ (luau - AKA roblox lua).
Based on CosmopolitanC with incredible performance and single binary runs on any platform.
There is also MakoServer.
More for embedded but runs in anything and also very batteries included, like Redbean including SQLite and JSON for example.
Naming is hard.
* https://github.com/Scythe-Technology/zune * https://github.com/lune-org/lune * https://github.com/luau-lang/lute * https://github.com/seal-runtime/seal
All slightly different. Personally, I like Lune and Zune. Have used both to play around and find them fun to use
For those wondering, it is not a Lua implementation, rather wrapping over available Rust crates with Lua bindings and packaging everything into a single binary to be used. It is the way it is because our CI was spending a lot of time compiling our Rust servers, so this was made to speed up development for simple to mid complexity servers. And since then grew to have more functionality.
Naming wise it is true that it is confusing with Astro and other similar naming projects I agree. Name suggestions are welcome!
andsoitis•2mo ago
vrighter•2mo ago
The first sentence in its readme is the following: "Astra is a web server runtime for Lua (5.1-5.4), Luau and LuaJIT written in Rust with native support for Teal."
andsoitis•2mo ago
Would you say the Lua interpreter is also a Lua runtime?
vrighter•2mo ago
andsoitis•2mo ago
Don’t most people simply use the LuaFileSystem library for that? https://github.com/lunarmodules/luafilesystem
I think you (and the project) are using “runtime” when what you really mean environment.
vrighter•2mo ago
That rudimentary "built-in" io that's included with lua? It's actually a library shipped with the interpreter, that you need to explicitly load in from the C side of things.
Exiting with a process exit code? Optional library.
String operations such as pattern matching? Optional library.
Math? Optional library.
Debugging? Optional library.
If you didn't load any of these, then the only I/O you could do is to stdout with the print statement. When you instantiate a new lua state, you are expected to provide your own runtime. It's a language designed to be embedded in other software.
Take, for example, libc. It's the C runtime. It doesn't compile or interpret C. libc is just a bunch of C code (with assembly sprinkled in, of course).
debugnik•2mo ago