Add Compile-Time Type-Checking using tl
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 613
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
tl is a static type checker for Lua: https://github.com/teal-language/tl/blob/master/docs/tutorial.md (like TS for JS). It would be great to have optional type annotations in moon+ so that moon+ compiles to tl, which then checks and compiles to Lua.
Two issues come to mind:
- Figuring out the type annotation syntax in moon+
- Changing the compiler to keep those annotations. Fortunately, there shouldn't be an issue even for the moonscript-specific class types, because they can be represented by records: https://github.com/teal-language/tl/blob/master/docs/tutorial.md#records
Or, the tl type checker portion could be ported to the moon+ compiler. The majority of code in the tl compiler (https://github.com/teal-language/tl/blob/master/tl.tl) is the actual parser and AST traversal, which could be replaced by the existing parser in moon+.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the issue's linked Teal tutorial and the referenced tl.tl compiler source. Investigate how YueScript currently parses and compiles syntax, then resolve the proposed annotation syntax and whether annotations should be preserved for Teal or type checking should be ported. Done means a defined approach is implemented and validated for MoonScript-specific class types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100