-
Notifications
You must be signed in to change notification settings - Fork 383
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
Suggest and use a file extension other than .lua
#97
Comments
From my understanding, Luau is fully compatible with normal lua scripts, is it not? |
I thought that (like luac), Roblox could implement a .luau format for lua bytecode. The lua file extension is much easier to get around for source code, as none the less luau aims to be almost 100% backwards compatible with lua 5.1. |
"Fully" is pushing it, judging from the docs. Syntactically compatible with Lua 5.1, but the libraries are much different. I agree here, the extension should be changed. You cannot expect to run the same scripts in both environments, as the semantics have changed. I think the spirit was to ease the pain of porting existing Lua scripts over (which IMO Luau facilities quite nicely, not having actually used it and just reading the docs). |
All Lua 5.1 should be for the most part compatible with Luau but not all Luau will be compatible with Lua 5.1 (e.g.: I write code for both. I don't want a Lua extension to necessarily activate for a Luau file because it will start spewing errors when there's nothing wrong. A separate file extension fixes this issue, but it would be nice to have that extension supported by Roblox in an official capacity so Studio can load such files. |
The small downside to using |
I agree we should aim towards changing it though. Maybe a good first step would be to change "Getting Started" documentation to suggest |
Editor extensions (I'm talking about vsc the name depends on the editor) can change to work for luau for example Roblox LSP supports .luau file types it may actually be beneficial to change to change the file type to .luau as most editors will prompt you to install stuff that will highlight and do other language related things making them support the Luau environment more then just Lua right now the hardest thing in my eyes would be extensions trying to differentiate between: lua 5.1 would require a lot of work for the extensions to try and guess but if the filename was .luau it would default to luau and thus no checking is necessary and its assumed that the file should be checked based on luau syntax and highlighted as such as for GitHub when the .luau becomes more popular you can request for it to be highlighted and such here |
This is a potential concern but most of that tooling won't be able to read any Luau syntax as-is so I don't think it's all that worrying. Tooling that's actively maintained and supportive of Luau will adapt to recognize As for syntax highlighting, I agree that's a concern but most modern editors (read: not Notepad++) have ways around this problem and GitHub has a language repository (like @Baileyeatspizza mentioned), though there are some requirements before Luau could be added. That requirement becomes less obtainable the more projects are published using I agree that suggesting |
@Dekkonot Yeah I think it's the right idea to gently push towards a separate extension. I think to start with we can make sure we mention this in the getting started guide, fix |
This is partly what I meant; a lot of support has gone into the .lua format in the past on multiple different things such as IDEs like VSCode. I think it would be SO COOL to see debugging and custom plugins for things like vsc in the future with Luau now being mostly open sourced. |
I have been looking into encouraging .luau but since the support is simply not there it is a hard sell to make. Definitely +1 for geting the ecosystem onto .luau instead of .lua. |
I'm currently working on a PR to make I'd also like to send PRs to both linguist and VS Code, but the problem is that Luau isn't really a thing outside Roblox and hence isn't likely going to be accepted as a PR. It simply wouldn't be worth GitHub's and Microsoft's time to support a language used by only one game, at least in their opinion. |
Update file extension from .lua to .luau Contributes to #97
I've updated "getting started" guide to suggest .luau extension instead of .lua. Since the command line tools now support .luau as well, I think this can probably be closed. I've filed an internal ticket for supporting .luau in Roblox Studio, but realistically that's not the most important thing here as it barely has any functionality to work with .lua files -- the more significant changes would need to happen throughout the ecosystem. So I think this can be closed now; feel free to link issues for other tools that are extension-sensitive to this one. |
As Luau grows as a language, it's gotten less and less compatible with normal Lua 5.1. It seems prudent to start using an extension that isn't
.lua
to allow tooling to make a distinction between the two languages.This has some implications for Roblox as it allows
.lua
files to be loaded both with Run Script and local pluins at the moment, so it cannot be community driven. I'm not sure of the work that goes into this on your end but it would have to be on Roblox to support it.My suggestion is
.luau
but anything works as long as it isn't.lua
The text was updated successfully, but these errors were encountered: