News for hackers. Stuff that matters.
Re:Lua Is So Underrated by le-mark on Thursday December 26, 2024 @08:08PM (#42519159)
I would use quickjs today for embedding over lua. Everyone know js nowadays and quickjs is really nice. The advantage lua has is library support via Lua rocks. Maybe someone can comment on the quickjs ecosystem?
Re:Lua Is So Underrated by kragen on Thursday December 26, 2024 @08:51PM (#42519336)
It sounds like you're saying quickjs is what you'd try if you wanted to embed a language, but you haven't tried embedding quickjs yet?
Re:Lua Is So Underrated by garbagelang on Thursday December 26, 2024 @10:22PM (#42519694)
Luarocks is an advantage? It’s full of thousands of variations of the same poorly copypasted code from idiotic Lua forums. All of them basically abandoned.

Lua rocks is a wart on Lua’s piss poor existence, not an advantage. Lol.

Re:Lua Is So Underrated by feznyng on Thursday December 26, 2024 @11:51PM (#42520023)
I think there’s a fork called quickjs-ng that’s actively maintained on GH. Should be able to use it as a lib maybe with some externing.

I’ve also had luck using it in a wasm runtime thanks to quickjs-emscripten. Good if you need sandboxing sans full process isolation.

Re:Lua Is So Underrated by kragen on Friday December 27, 2024 @08:24AM (#42521867)
Thank you for sharing your experience! Wasm provides full process isolation, doesn't it? Do you mean that QuickJS provides cheaper sandboxing than wasm?
Re:Lua Is So Underrated by feznyng on Friday December 27, 2024 @12:56PM (#42524360)
I’m not sure if wasm would be considered full process isolation but it does provide software based sandboxing. I’m referring to running quickjs in wasm by compiling it with emscripten.

https://github.com/justjake/quickjs-emscripten

Re:Lua Is So Underrated by kragen on Friday December 27, 2024 @08:38PM (#42527796)
I see, thanks!
Re:Lua Is So Underrated by dchest on Friday December 27, 2024 @02:09AM (#42520455)
I have experience of embedding and modifying both QuickJS and Lua. QuickJS is not bad, but Lua is a lot easier and has fewer bugs. JavaScript is a very complicated language under the surface; I think very few people, if any, know and remember all its quirks.
Re:Lua Is So Underrated by ga2mer on Friday December 27, 2024 @03:21AM (#42520684)
Amazfit's Zepp OS uses quickjs to run 3rd party watchfaces and apps in their smartwatch

I was surprised to find out I'd been wearing javascript on my arm all this time

Re:Lua Is So Underrated by xigoi on Friday December 27, 2024 @07:31AM (#42521643)
While QuickJS is nice, JavaScript as a language is much uglier and more complicated than Lua.