Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding/improving Lua standards #577

Open
nvs opened this issue Dec 31, 2023 · 1 comment
Open

Adding/improving Lua standards #577

nvs opened this issue Dec 31, 2023 · 1 comment
Labels
A-standard-library Area: Standard Library C-enhancement Category: Feature request or improvement

Comments

@nvs
Copy link

nvs commented Dec 31, 2023

The standards provided by selene have some deprecated features (e.g. unpack in Lua 5.3) and other inconsistencies present. It might be best to adhere to Lua's default compilation flags, as most users will encounter versions of Lua using those. For reference:

Version Default Flags
Lua 5.1 See luaconf.h
Lua 5.2 LUA_COMPAT_ALL
Lua 5.3 LUA_COMPAT_5_2
Lua 5.4 LUA_COMPAT_5_3

One would need to consult 'luaconf.h' for various details. However, a good example is unpack, while considering the default flags.

  • Lua 5.1: Exists.
  • Lua 5.2: Deprecated. But not in selene. Lua suggests using table.unpack.
  • Lua 5.3: Does not exist. But does in selene. Would need LUA_COMPAT_5_1, which is not active by default.
  • Lua 5.4: Does not exist. Not supported by selene yet.

Luacheck provides the following standards, to cover various use cases.

  • lua51: Lua 5.1 without deprecated features.
  • lua51c: Lua 5.1
  • lua52: Lua 5.2
  • lua52c: Lua 5.2 with LUA_COMPAT_ALL
  • lua53: Lua 5.3
  • lua53c: Lua 5.3 with LUA_COMPAT_5_2
  • lua54: Lua 5.4
  • lua54c: Lua 5.4 with LUA_COMPAT_5_3

Would it make sense for selene to do something similar? Probably just the standards with the default configurations are enough. I also noticed #154, which is related to adding LuaJIT standard.

@Kampfkarren
Copy link
Owner

Any inconsistencies you see are a result of me being firmly in the world of Roblox, which uses a derivative of 5.1 :)

Any contribution like this would be appreciated.

@Kampfkarren Kampfkarren added A-standard-library Area: Standard Library C-enhancement Category: Feature request or improvement labels Jan 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-standard-library Area: Standard Library C-enhancement Category: Feature request or improvement
Projects
None yet
Development

No branches or pull requests

2 participants