News for hackers. Stuff that matters.
Re:Cosmopolitan v3.5.0 by brabel on Monday June 24, 2024 @06:21AM (#40774255)
Lua is perfect for Redbean because it's tiny and made for embedding, which is this exactly use case. Something like TypeScript would require a transpiler to JS and a JS runtime, which as far as I know, even the smallest one would be much bigger than Lua. And Lua has well defined semantics to call C and be called by C, which may be hard to do with JS/TS.
Re:Cosmopolitan v3.5.0 by DrNosferatu on Monday June 24, 2024 @06:30AM (#40774313)
Any examples and good tutorials on how to best go about it?
Re:Cosmopolitan v3.5.0 by brabel on Monday June 24, 2024 @11:50AM (#40777529)
Best go about using Redbean? The project is well documented: https://redbean.dev/

Just go through it, it answers all questions you may come up with IMO.

Or you mean about embedding Lua? The official docs are great too: https://www.lua.org/pil/24.html

If you prefer a tutorial, there's plenty as Lua has been around for a long time. Search on Youtube for example and there's lots of videos.

The top hit on DDG for me was https://lucasklassmann.com/blog/2019-02-02-embedding-lua-in-... which seems pretty straightforward to follow.