原文
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
原始链接: https://news.ycombinator.com/item?id=44052106
Hacker News 正在讨论 Lune,一个独立的 Luau 运行时。Luau 是 Roblox 开发的一种基于 Lua 的语言,它拥有改进的速度、向量支持和类型检查器。Dekkonot,Lune 和 Luau 的贡献者,强调了 Lune 对于脚本需求的适用性,它在 API 的完美性和实用性之间取得了平衡。 讨论要点包括 Luau 用于不受信任代码执行的安全特性及其 WebAssembly 编译能力。一些人对选择 Rust 来实现 Lune 进行了辩论,指出与 Go 或 Zig 等语言相比,它可能存在进入门槛。还提到了其他替代方案,例如 Luau 团队的 C++ 运行时 Lute。讨论还涉及 Rust 的编译时间与其他语言的对比,以及是否应该将 Go 视为遗留语言。最后,还讨论了实际用途,例如序列化 Roblox 资源,以及它的 VS Code 集成和类型检查器。
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
For those who aren't familiar, Luau is a language based on Lua that is developed and maintained by Roblox. It's entirely open source (you can see the repo here: https://github.com/luau-lang/luau) and it's diverged a fair bit from Lua at this point. Most notably, it's quite a bit faster than the PUC-Rio distribution of Lua, has native vector support, and has a type checker. It's not as fast as LuaJIT, but it's about as fast as you can expect for a non-JITed language and it has support for AoT compiling to native instructions on x86 and aarch64, so it can be basically as fast as LuaJIT for some tasks.
It's worth reading the website: https://luau.org/
Lune itself is nice and I use it for basically all of the scripting needs I have. Some of the API is limited compared to what you'd get in other runtimes (the obvious example is hashing, where it's just "string in, string out" instead of a stream that you can feed into and then finalize) but the logic is essentially that APIs should be "good enough" for the average user, not perfect. I think that's fine, but I'm also the one that wrote the hashing API so take it with a grain of salt. :-)
reply