鲁特:Luau 的独立运行时
Lute: A Standalone Runtime for Luau

原始链接: https://lute.luau.org/

## Lute:超越 Roblox 的 Luau Lute 是 Luau 脚本语言的一个新的独立运行时环境。虽然 Luau 通常*在*像 Roblox 这样的程序中使用,但 Lute 允许开发者将 Luau 用于通用编程——类似于 Node.js 或 Deno,但用于 Luau。 它通过提供用于文件系统访问、网络、密码学和进程管理等任务的内置 API 来解决 Luau 以前的限制。这使得创建各种应用程序成为可能,包括命令行工具、Web 服务器和自动化脚本。 Lute 通过低级库(@lute 别名)和更易于使用的标准库(@std 别名)提供这些功能。重要的是,开发者正在努力将这些相同的 @std API 集成到 Roblox 本身,旨在实现 Lute 和 Roblox 引擎之间的代码兼容性。

## Lute:一个新的 Luau 运行时 – 摘要 Lute 是一个用于 Luau 脚本语言(尤其在 Roblox 中使用)的新型通用运行时,已达到 1.0.0 版本。它采用 Node.js 风格构建,提供文件系统访问、网络和密码学等功能,利用 libuv 和 libsodium 等库。 Lute 的一个关键特性是它暴露了用于操作 Luau 语法树的 API。这允许开发者在语言内部创建强大的自定义工具和代码转换——鉴于 Luau 的快速发展,这是一个显著的优势。这对于维护大型代码库和适应新语言特性尤其有用。 开发者正在积极寻求反馈,并乐于讨论项目的实现和设计。它被定位为 Lune 等工具的替代品,并引发了它在用于新项目时相对于 Python 等语言的优势问题。
相关文章

原文

What is Lute?

While Luau is a powerful scripting language, it is sandboxed and primarily embedded in a larger program, like the Roblox game engine. This means it lacks built-in capabilities for interacting with the outside world. Lute fills the gap by providing a standalone runtime for Luau, designed for general-purpose programming outside of game engines. Think of it like Node.js or Deno, but for Luau.

How can I use it?

Lute provides a rich set of built-in APIs for common programming tasks: file system access, HTTP networking, cryptography, process management, and more. You can use these APIs to build a wide variety of applications, from command-line tools to web servers to automation scripts and more. These capabilities come in the form of a set of low-level libraries exposed to Luau under the @lute require alias, and a higher-level standard library built on top of those, exposed under the @std alias. For Roblox developers, we're working hard to ensure the Roblox game engine will support this same set of @std APIs in the future, so you can write code that runs both in Lute and Roblox with minimal changes.

联系我们 contact @ memedata.com