4 ms·
QuickJS is presumably intended for embedding within applications - how does it compare to Lua for this? Both languages are fairly quirky - at least JavaScript’
by pansa2 2y ago
QuickJS is presumably intended for embedding within applications - how does it compare to Lua for this?
Both languages are fairly quirky - at least JavaScript’s quirks are widely-known. But how do the implementations compare in terms of API, robustness, portability, performance etc?
Also, I’m not aware of any static typing add-ons for Lua, but presumably it’s possible to use TypeScript with QuickJS?
- sampullman 2y ago> ...but presumably it’s possible to use TypeScript with QuickJS? I don't see why not, since TS compiles down to JS. The engine doesn't know or care about what kind of transformations the code went through before it was JS. You might need to be careful about compatibility, the QuickJS intro says 'Almost complete ES2023 support", so you'd have to avoid any unsupported features.
- depr 2y agoLuau is a gradually typed version of Lua at least.
- yohannes_k 2y agoI have been using TypeScript for quite sometime but it's my first time learning of one gradually typed language. I always decribed TypeScript as optionally statically typed
- pansa2 2y agoDoesn’t Luau require a custom Lua implementation though? Is that implementation easily embeddable like the regular Lua VM?
- SpaghettiCthulu 2y agoYes, and yes. There are libraries for embedding lua in rust programs that allow you to trivially switch between Lua, LuaJIT, and Luau.
- cies 2y ago> Also, I’m not aware of any static typing add-ons for Lua I'd not cal TypeScript an addon to JS. It's a language that transpiles to JS (and so does CoffeScript, Elm, etc. etc.) There are many language projects that transpile to Lua: https://github.com/hengestone/lua-languages?tab=readme-ov-file https://github.com/hengestone/lua-languages?tab=readme-ov-fi...
- catwell 2y agoTeal (https://github.com/teal-language/tl https://github.com/teal-language/tl) is the closest we have from a "TypeScript for Lua". It is natively supported by many projects now, including game engines such as the Bevy scripting plugin and Defold.
- pansa2 2y agoOh, interesting. Thanks!