Repository navigation
The Future of Class++ #23
Pinned
TenebrisNoctua
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hello! This post will talk about the future of Class++.
If you haven't heard of it already, Luau will soon have a native class type, which will allow you to create classes in a way that is far easier than prototypes.
An RFC brings in a new class keyword, which allows you to define classes with public (and soon, private) fields at the top of your scripts. This completely removes the need of having to use metatables for defining classes, in which Class++ was also priding itself with. Introduction of access specifiers natively in Luau will also allow developers to define private fields in Luau far easier without using up-values or other weird workarounds.
So, what do these changes mean for the future of Class++? Well, I will first wait until some restrictions are lifted, and see if Class++ can continue as a wrapper on top of native classes. It would mean significant performance improvements and would also make the implementation far easier.
If not, the work on Class++ may slow down or ground to a halt, as with future updates and RFCs, native classes could exceed the capabilities of Class++. But for now, native classes lack certain capabilities that still allows Class++ to stand better.
First of all, inheritance may or may not end-up in native classes. Class++ supports inheritance in many types. Function overloading and automatic object destruction are also unlikely to make it in native classes. This gives Class++ an advantage over native classes.
Though I must mention again, native classes will still be technically faster than Class++ classes. Of course, if I'll be able to use native classes underneath Class++ classes, then this performance difference may become very insignificant over-time. Only time will tell.
For now, Class++ will continue to live and get occasional updates and improvements.
All reactions