X Tutup
Skip to content

Basic Luau target#1608

Merged
Perryvw merged 5 commits intoTypeScriptToLua:masterfrom
vurvdev:luau
Dec 29, 2024
Merged

Basic Luau target#1608
Perryvw merged 5 commits intoTypeScriptToLua:masterfrom
vurvdev:luau

Conversation

@vurvdev
Copy link
Contributor

@vurvdev vurvdev commented Dec 23, 2024

Luau is a variant of Lua semi-recently becoming popular due to its open-sourcing and use by Roblox. It has a mix of features from 5.1-5.4 that make it not really fit into any traditional Lua version.

Why

There's roblox-ts but that's another project and not everyone is using Luau for Roblox. We're using it for our own game engine - and I'm aware of other projects making use of Luau (the popular mlua rust library supports it, despite being a "lua" library)

Luau does include a type system, but it's not yet capable enough for my usecases. Plus, that's ignoring all the other benefits that Typescript brings.

Changes

This PR:

  • Adds a Luau luaTarget
  • Adds a continue statement used solely by Luau.
  • Adds the if <COND> then <X> else <Y> ternary operator used solely by Luau.

There are other Luau-only features like type hints and compound assignment operators - but they could be done later on and aren't as pertinent

Please let me know how I should incorporate test cases - couldn't figure out how to do so myself, although I tested these features in a local project.

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

X Tutup