[server.request-handler]
path = "tmp/fennel/handler"
language = "fennel"
options = { compiler = "tmp/fennel/fennel.lua" }
Look, 'ma! No Lua shim. The Fennel code is about 40 lines of Rust, a bit of boilerplate wrapping the Lua code.
Post
[server.request-handler]
path = "tmp/fennel/handler"
language = "fennel"
options = { compiler = "tmp/fennel/fennel.lua" }
Look, 'ma! No Lua shim. The Fennel code is about 40 lines of Rust, a bit of boilerplate wrapping the Lua code.
"What is acceptable?", you may ask.
Well, anything faster than ~40k req/sec in release mode will do. Why ~40k req/sec? Because that's my reverse proxy's bottleneck.
I also expect a very naive implementation of return false
to run at at least at 1k req/sec in release mode.
What's a naive implementation? Creating the runtime environment on every request, and compiling the trivial program on every request.
In other #iocaine news, I'm doing some final polishing on #Lua scripting support, to make it as convenient as #Roto.
Right now, there's a differenc between how Lua and Roto scripts are loaded: with Roto, one needs to give a path to a directory, and pkg.roto
will be loaded from there, and any import
s will be relative to that directory.
With Lua, one gives iocaine a file path, and - currently - needs to set up the package.path
search path manually.
So here's what I'll do: I'll make iocaine require a directory for Lua too, and it will add it to package.path
, and will require("main")
. The required module will also have to return a table with at least a decide
key, and an optional run_tests
key. This will simplify finding the functions to run, and will greatly reduce the number of special cases.
After that, I'll try to figure something about how to support #Fennel better, natively. The current idea is to have it exposed as another scripting language, built as a wrapper around the Lua engine, with some additional setup at init time:
fennel.path
fennel.install()
I could embed the fennel compiler, it is small enough, and releases aren't frequent. So that's an option. I don't want to pull it into the sources, though, so I'd need a way to do grab it during build or something. That's a bit problematic, however.
So the next best thing I could come up with is:
[server.request-handler]
path = "/path/to/some/fennel/code"
language = fennel
options = {
compiler = "/path/to/fennel.lua"
}
[server.request-handler]
path = "tmp/fennel/handler"
language = "fennel"
options = { compiler = "tmp/fennel/fennel.lua" }
Look, 'ma! No Lua shim. The Fennel code is about 40 lines of Rust, a bit of boilerplate wrapping the Lua code.
And because I give funny names to my structs, the one dealing with #Fennel is called ElegantWeapons
.
I'm also moving all of the language support under the sex_dungeon
module.
use sex_dungeon::{
ElegantWeapons, // Fennel
Howl, // Lua
MeansOfProduction // Roto
};
Yup, yup. This'll do juuuuuust fine.
A space for Bonfire maintainers and contributors to communicate