Back Original

LuaJIT 3.0 proposed syntax extensions

This is an umbrella issue for the LuaJIT 3.0 syntax extensions.

The documentation will be evolved and updated in the first comment below. 1

Please feel free to discuss the choice, design and semantics of syntax extensions in this issue. Improvements and clarification requests for the documentation are welcome, too.

As syntax preferences are largely subjective, please ensure feedback remains constructive. If a specific proposal is declined, please respect the decision and move on. In general, I hope we can keep the discussion focused on functionality and avoid prolonged discussions about cosmetic symbol choices for edge-case operators (aka bike-shedding).

Some of the syntactic choices have already been made by others (C, Lua, JavaScript, …) — and I'm definitely not happy with all of them. But there's value in conformity and compatibility.

The goal is to only add syntax extensions that:

  1. Improve developer quality-of-life.
  2. Are proven. In other languages or Lua dialects.
  3. Do not create syntactic ambiguities.
  4. Do not break backwards compatibility.
  5. Do not make life difficult for tool developers (syntax formatters, LSPs).

Just to make this clear: I have no intention to copy the syntactic complexity of Perl, Ruby, C++ or Rust.

The related issues #63 and #1379 have been closed in favor of this issue.