Teal – A statically-typed dialect of Lua
About Teal
Teal is a statically-typed dialect of Lua. It extends Lua with type annotations, allowing you to specify arrays, maps and records, as well as interfaces, union types and generics.
It aims to fill a niche similar to that of TypeScript in the JavaScript world, but adhering to Lua's spirit of minimalism, portability and embeddability.
Is it implemented as a compiler, tl, which compiles .tl source code into .lua files.
A taste of Teal
Here is a quick taste of what Teal code looks like:
local function add(a: number, b: number): number return a + b end local s = add(1, 2) print(s)
...or check out this page's source code!
You can also play with the Teal compiler right from your browser, using the Teal Playground.
Install Teal
If you're using LuaRocks, you can install the compiler with:
luarocks install tl
You can also find pre-compiled binaries for Linux and Windows.
To build larger projects, you probably won't want to run tl on each file individually. We recommend using Cyan, the build tool designed for Teal.
You can also install vscode-teal for Visual Studio Code integration, teal-language-server for NeoVim and others, and more.
Documentation
You can browse the Teal documentation online.
Here are some recorded talks discussing the history of Lua and types, outlining the motivations behind Teal and talking about the project's progress:
Community
Development happens on GitHub.
We have a community forum hosted by GitHub. You can also chat with us via Matrix at #teal-language_community:gitter.im.
Teal is a project started by Hisham Muhammad, developed by a growing number of contributors and is written using Teal itself!
License
Teal is free and open source software.
Its license is MIT, the same as Lua.
What's Your Reaction?






