Anyone interested in having Solar support Teal? It’s like TypeScript for Lua.
honestly I’m not a big fan of typescript, and I don’t even understand the great utility of having type checking on a language that is weakly typed.
Do you want a strong typed language? Use java directly.
Otherwise, you just need a few steps, perhaps using luacheck integrated in vscode and function assertions.
assert(type(my_var) == "integer")
The decorators, as described on the official website:
would be another possibility.
But typically with corona SDK you either move objects on the screen and then integer strokes, or strings or simple objects representing game entities, so the assert in my opinion is more than enough. Especially since the rest are API calls.
I think you’re right that assert would be enough for primitives. But Teal looks mainly useful to me for creating records. It’s hard to remember what properties you should expect on each table as the codebase grows.
considering the dynamic nature of the tables you would need something similar to java interfaces or objective-c protocols I don’t know how much this need is felt and if there are libraries capable of doing it.