Skip to content

Conversation

@karl-police
Copy link
Contributor

@karl-police karl-police commented Jul 14, 2025

Rendered

I also made an implementation test of it, see a draft luau-lang/luau#1916

@aatxe
Copy link
Contributor

aatxe commented Jul 14, 2025

We will not accept any additions to the language that refer to extern types as classes. The choice of changing that language was very conscious to avoid confusion with the idea that language supported some kind of object-oriented programming. You'll need to adjust the RFC to use the right language, and not reference classes.

@karl-police
Copy link
Contributor Author

We will not accept any additions to the language that refer to extern types as classes. The choice of changing that language was very conscious to avoid confusion with the idea that language supported some kind of object-oriented programming. You'll need to adjust the RFC to use the right language, and not reference classes.

I changed it.

I didn't even name the C++ function classname, I actually named it getExternTypeName. I sticked with "classes" probably because the I only saw declare class being a Extern Type.

@karl-police
Copy link
Contributor Author

karl-police commented Jul 14, 2025

We will not accept any additions to the language that refer to extern types as classes. The choice of changing that language was very conscious to avoid confusion with the idea that language supported some kind of object-oriented programming. You'll need to adjust the RFC to use the right language, and not reference classes.

I changed it.

I didn't even name the C++ function classname, I actually named it getExternTypeName. I sticked with "classes" probably because the I only saw declare class being a Extern Type.

I think actually it's because I saw this

https://github.com/luau-lang/luau/blob/6ff0650a8d4ba90df9826492b68c88911e39b1c1/Analysis/src/TypeFunctionRuntime.cpp#L1284-L1285

it was called "class" when filtering for Extern Type, that's why I was sticking with "class" probably.

@karl-police karl-police changed the title RFC: type classname - Method to get an ExternType's name RFC: type externname - Method to get an ExternType's name Jul 14, 2025
@karl-police
Copy link
Contributor Author

Fixed the link, oops

@deviaze
Copy link

deviaze commented Jul 14, 2025

Old references to "class" might just be fallout from the rename and aren't intentional to the language's design. At some point declare class syntax is supposed to be replaced with declare extern type syntax, but it doesn't seem to have been yet. Well, at least my globals.d.luau hasn't broken with luau-lsp yet.

@karl-police
Copy link
Contributor Author

Old references to "class" might just be fallout from the rename and aren't intentional to the language's design. At some point declare class syntax is supposed to be replaced with declare extern type syntax, but it doesn't seem to have been yet. Well, at least my globals.d.luau hasn't broken with luau-lsp yet.

Ah. That would be better if it's renamed. I was getting confused about declare class thinking about "Are we getting classes, huh?"

But since it's not at the moment, I kept the RFC like so, but I guess I could tweak CustomClass and name it CustomExternType

@karl-police
Copy link
Contributor Author

Oh declare extern type <name> with is working

@aatxe
Copy link
Contributor

aatxe commented Jul 17, 2025

Yes, declare extern type has worked for a while now (several months?), and we're giving people (probably mostly @JohnnyMorganz if I'm being honest) time to switch things, but no RFCs were ever or will ever be accepted referring to extern types as classes.

@karl-police
Copy link
Contributor Author

Yes, declare extern type has worked for a while now (several months?), and we're giving people (probably mostly @JohnnyMorganz if I'm being honest) time to switch things, but no RFCs were ever or will ever be accepted referring to extern types as classes.

I think is("class") is still unchanged though

@aatxe
Copy link
Contributor

aatxe commented Jul 22, 2025

I think is("class") is still unchanged though

Yeah, this one is unfortunate, and we should change it before it's more codified as well because, again, these are not "classes" and setting the expectation for Luau programmers that the language has a notion of "class types" right now is misleading at best, and actively harmful at worst.

@karl-police
Copy link
Contributor Author

I think is("class") is still unchanged though

Yeah, this one is unfortunate, and we should change it before it's more codified as well because, again, these are not "classes" and setting the expectation for Luau programmers that the language has a notion of "class types" right now is misleading at best, and actively harmful at worst.

Yes #131

@JohnnyMorganz
Copy link

Yes, declare extern type has worked for a while now (several months?), and we're giving people (probably mostly @JohnnyMorganz if I'm being honest) time to switch things

I attempted this switch on Saturday, however it looks like parsing is still behind a FFlag LuauDeclareExternType, which is causing issues for users who don't have FFlag syncing enabled (JohnnyMorganz/luau-lsp#1145 (comment)).

I've reverted this change for now and will reattempt once the FFlag is removed

@aatxe
Copy link
Contributor

aatxe commented Jul 23, 2025

I'll clean up the flag now, so that you can do so in this next release. :)

@karl-police
Copy link
Contributor Author

Now, all "class" is gone.

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants