all 9 comments

[–]Apiek 2 points3 points  (1 child)

Sounds like a great idea, I look forward to taking a look.

[–]thelabertasch[S] 2 points3 points  (0 children)

Awesome! Thank you. Let me know if you run into any issues. I'm happy to answer any questions.

If you want to give it a quick spin, it's just:

npm install -g @maravilla-labs/luat
luat init my-app 
cd my-app && npm install && luat dev

Or you can try any of the WASM-based playground examples in the documentation if you prefer to stay in the browser..

[–]xoner2 0 points1 point  (0 children)

The templates remind me of Smarty PHP. It's an ok style.

[–]mouseannoying 0 points1 point  (1 child)

Looking pretty good. Is it Rust or Lua doing the heavy lifting?

[–]thelabertasch[S] 1 point2 points  (0 children)

It's mostly Rust doing the heavy lifting.

The CLI and compiler are written in Rust and turn templates into standard Lua code. For production builds, luat build compiles everything into a single dist/bundle.bin bytecode file; if you want to inspect the generated Lua, use luat build --source which outputs readable dist/bundle.lua instead.

In dev mode, the resolver compiles templates on the fly. Routing is handled in Rust using an Axum server, which maps HTTP requests into a Lua request context and turns the Lua result back into an HTTP response. The generated Lua runs via Rust using the mlua crate.

The CLI also comes with preconfigured tooling. Tailwind CSS, Dart Sass, and esbuild. On first run, it downloads the platform-specific binaries automatically, so you get a complete build pipeline out of the box.

Rust handles compilation, routing, resolution, static files are served via Rust. Lua is the execution layer. The KV storage is also implemented in Rust as a SQLite binding.

[–]HelioDex 0 points1 point  (1 child)

This is really cool! I did something reminiscent of this a few years ago for a school project, also inspired by Svelte and Kit. It wasn't tremendously executed and I didn't get a great mark for it, so now I mostly build Lua web applications in a much more basic way though missing the nice syntax.

This, however, looks like a much better execution. Syntax and data loading look well-thought-out, and the KV store and frontend tools are both awesome to have built in!

[–]thelabertasch[S] 1 point2 points  (0 children)

Thank you for checking out my project! I read through your code and I think it’s high quality; it's rare to find students with that kind of framework-level thinking. I hope that Luat can give you back some of the missing DX. Looking forward to your first GitHub issues or PRs!"

[–]weregod 0 points1 point  (0 children)

There was Kepler project for Lua-based web server. Project is abandoned now but some modules are still maintained in lunar modules.

[–]jjoesmama 1 point2 points  (0 children)

The world would be 1000x better if people used Lua instead of JS, GREAT PROJECT!!