backupRoswaal has moved to roswaal.app. These pages are a backup copy.Go to roswaal.app

12 Luau for Lune✎

The profile for Lune programs: what changes from Roblox, Lune's standard library, and running the output.

Normative · Level 2Draft 0.1Pending review

12.1 What changes from Roblox

Info

This section is informative.

The profile with the id lune turns graphs into Luau programs run by Lune, outside Roblox. It is Luau for Roblox (§11) without the engine: the same Luau types and conversion, the same templates, and 213 of the built-in nodes, those §11.5 marks as running on both, plus Lune's own.

  • There are no engine classes, services or events. A Roblox-only node in a Lune graph is an error.
  • scriptClass is not read. A Lune graph is a module when it has a Module Exports node.
  • Every graph becomes <name>.luau.
  • Modules are loaded by Lune's specifiers, such as @lune/fs. An instance path is an error.
  • Roblox datatypes that Lune's @lune/roblox implements, such as Vector3, can be used once the graph lists that module, with the datatype among its members.

12.2 Types and the standard library

Lune's standard library is generated into Roswaal's source from the type definitions Lune publishes, pinned to one Lune release. Its functions become two nodes, Lune Function, a step, and Lune Function (Value), a value, which take their pins from the chosen function's signature. A function Lune marks as one whose result must be used is offered as a value.

12.3 What each node compiles to

As in §11.6. A Lune call never loads its module itself: the graph's list of modules (§9.3) has to name it, and a call into a module the list does not name is an error.

12.4 Running the output

The file is run with lune run, as any Lune program is. It carries the header of §11.7, and needs nothing of Roswaal's (§2.1, principle 10).

Not reviewed yet