Skip to content

CerebralLabs/mangle

Repository files navigation

mangle

Narrator: "Was this ever asked for?"
Also Narrator: "I don't think it was."

About | Reasoning | Supported Platforms | Use

About

mangle is a post processing name mangler for luau, inspired by Python's name mangler; what makes private variables private in Python.

Reasoning

In most intro to programming courses, we learn of public and private classes and variables. These concepts are less about security and more about managing complexity. If a private variable causes a bug, the developer only needs to look within the class that its located.

Supported Platforms

mangle may be posted on Wally. We understand the use case is minimal.

Use

local mangle = require(--[[path to mangle]])

local someClass = {}
-- "public" variables and functions of someClass
-- "private" varaibles and functions using "__" in the start of their names.

reutrn mangle(someClass)

Calling someClass.__someFunction or someClass.__someVariable directly is not allowed and will fatally error. However, a function inside the someClass class can still call on __someFunction or __someVariable without problem.

About

a Luau name mangler

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages