LuaClass - A class module for Luau

LuaClass

LuaClass is a simple class module written in Luau that allows for classes with inheritance similar to TypeScript/JavaScript. It provides a fluent API for defining classes, extending them, and creating instances, making object oriented patterns straightforward in Luau

Features

  • Simple syntax for defining classes
  • Supports inheritance with :extends()
  • Optional init constructor per class
  • Strictly typed for better user experience
  • Lightweight, with shared prototype methods for performance

Where to get LuaClass

Github
Wally

1 Like

ok show performance

1 Like

bro how come i see you on every forum post

I don’t see a point to this, I think roblox gives all the necessary things without having to define new classes for whatever.

2 Likes

why should i use this over tables

1 Like

you shouldnt unless you need what its providing, use it if you need:

  • inheritance
  • better readability
  • TS/JS familiar syntax
  • consistent patterns and structures

if its something small scale or one off then stick with tables, it would be faster

what in the subjective

1 Like

luau provides a lot of primitives to make OOP / ‘classes’ possible but it doesnt simplify inheritance or standardise constructor methods

LuaClass tries to provides better DX and architecture long term IF you’re familiar with JS/TS patterns or other similar languages. its simply opt-in if its for you

1 Like

readability is subjective, that is the point of LuaClass

if tables read better for you then dont use it. it isnt trying to replace tables, its an abstraction

this isnt a performance library comparable to raw tables
it trades a tiny amount of runtime overhead for (subjectively) bettter readability, inheritance, and maintainability

4 Likes