HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
teal-language
tl
Lua2020–2026
teal-language / tl

tl

The compiler for Teal, a typed dialect of Lua

42Distinct people
62Mentions
1Explicit recommenders
3KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

The compiler for Teal, a typed dialect of Lua

GitHub

Where it is used

No documented product use was verified in the last source check.

What people are saying

I need to clean up this page but I'm working on a local(-ish) book collection tool (calling it Livtet for "book head" in Haitian Kreyol). https://www.jacky.wtf/projects/livtet/…

jalcine used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 10:01:16 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year62 dated mentions

Observed mentions: 2020-07-27 13:11:12 UTC to 2026-10-18 09:49:20 UTC.

0510152020-01-01 00:00:00 UTC to 2021-01-01 00:00:00 UTC (exclusive): 11 mentions; 2 submissions, 9 comments20202021-01-01 00:00:00 UTC to 2022-01-01 00:00:00 UTC (exclusive): 11 mentions; 1 submissions, 10 comments2022-01-01 00:00:00 UTC to 2023-01-01 00:00:00 UTC (exclusive): 10 mentions; 1 submissions, 9 comments2023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 13 mentions; 1 submissions, 12 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 8 mentions; 1 submissions, 7 comments2025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 7 mentions; 0 submissions, 7 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 2 mentions; 0 submissions, 2 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20202020-01-01 00:00:00 UTC2021-01-01 00:00:00 UTC1129
20212021-01-01 00:00:00 UTC2022-01-01 00:00:00 UTC11110
20222022-01-01 00:00:00 UTC2023-01-01 00:00:00 UTC1019
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC13112
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC817
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC707
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC202

From the project README

An excerpt from the repository, fetched Nov 13, 2026.

Read the project’s introduction
Teal This is the repository of tl, the compiler for Teal, a typed dialect of Lua. The core compiler has no dependencies and is implemented as a single tl.lua file which you can load into your projects. Running tl.loader() will add Teal support to your package loader, meaning that require() will be able to run .tl files. Introduction You can read the tutorial chapter of the Teal documentation to get started with an overview of the language. Installing Via LuaRocks Install Lua and LuaRocks, then run: luarocks install tl This should put a tl command in your $PATH (run eval $(luarocks path) if the LuaRocks-installed binaries are not in your $PATH). Teal works with Lua 5.1-5.4, including LuaJIT. Binaries Alternatively, you can find pre-compiled binaries for Linux x86_64 and Windows x86_64 at the releases page. The packages contain a stand-alone executable that can run Teal programs (without the need of a separate Lua installation) and also compile them to Lua. Try it from your browser You can give Teal a try directly from your browser with the Teal Playground! It compiles Teal into Lua using Fengari, a Lua VM implemented in JavaScript, so everything runs on the client. Running Using the compiler directly Once tl is in your path, there are a few subcommands: tl run script.tl will run a Teal script. tl check module.tl will type check a Teal module, report any errors and quit. tl gen module.tl will check for syntax errors and generate a module.lua file in plain Lua with all type annotations stripped. tl warnings will list all warnings the compiler can generate. tl also supports some compiler options. These can either be specified on the command line or inside a tlconfig.lua file at the root of your project. Building projects with Cyan To build whole projects, you probably won't want to run tl on each file individually. We recommend using Cyan, the build tool designed for Teal. Loading Teal code from Lua You can either pre-compile your .tl files into .lua, or you can add the tl.lua module into your project and activate the Teal package loader: local tl = require("tl") tl.loader() Once the package loader is activated, your require() calls can load and compile .tl files on-the-fly. Documentation You can read the rendered documentation online; it can also be generated locally from the files in the docs/ folder of this repository. Type definitions tl supports declaration files, which can be used to annotate the types of third-party Lua libraries. We have a collaborative repository for declaration files at https://github.com/teal-language/teal-types — check it out and make your contribution! Text editor support Teal language support is currently available for Vim, Visual Studio Code, lite with linter support and Helix with LSP support. Community Join the chat on Gitter! You can also join 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 License is MIT, the same as Lua.
Read the full README on GitHub

What Hacker News says

13 sources
> I found it quite nice but I'll also not forget the hours I wasted tracking down nil table corruptions which could have easily been caught by a type checker. > I had some hope that Luau https://luau-lang.org or Teal https://github.com/teal-language/tl would make things better Inline type annotations are not a prerequisite for typechecking; there's nothing stopping you from writing straight Lua (or whatever) and then having a separate tool that does typechecking _without_ having to change the language. People are failing to take away the most important lessons from TypeScript. The same goes, frankly, for languages that ostensibly have typechecking but have such deficient type systems that it's not exactly that much better than not having one. (Like C, for example.) Considering that type annotations are more valued for being a form of d
Read the rest
ocumentation than they are valued for making it easier to write the compiler's code generator... If you have a function like printf that is ostensibly typechecked but not really, and you already have documentation (like man pages) for that function that says that the arguments need to be such-and-such, but the typechecker for your compiler/IDE isn't able to factor that in at or before build time, then that's a compiler/IDE problem, not anything that necessitates a change to the original grammar.
In Lua Criticism Is Unwarranted
I had the pleasure of working with Lua 5.1 back in the late noughties. For me it replaced Tcl whenever I wanted something I could configure above a C library. At the time I used it I found it quite nice but I'll also not forget the hours I wasted tracking down nil table corruptions which could have easily been caught by a type checker. I had some hope that Luau https://luau-lang.org or Teal https://github.com/teal-language/tl would make things better but with the following example function foo(x: number): string if x == 2 then return nil else return "foo" end end x = { foo(1), foo(2), foo(3) } for i,v in ipairs(x) do print(i,v) end they produce no warning and sadly only print 1 foo When I was younger I might have put up with that sort of WTF but now that I have better options I try to stic
Read the rest
k to type checked languages where I don't have to.
In Lua Criticism Is Unwarranted
Now I like lua and think single pass is the way to go for interpreted, since you don't have the disadvantage of a slow compile time no matter how big your codebase gets, BUT its not great to write in. some things are (apparently) not possible, which means the only solution is to transpile into it, which has led to some good languages like moonscript[0], and the dynamic nature is a boon as your codebase grows, which has led to teal[1] which offers static type checking. [0]: https://moonscript.org/ [1]: https://github.com/teal-language/tl
In Why Fennel?
For those interested in using Lua or a similar syntax I curated a list of typed Lua-related projects: - https://luau-lang.org (Lua derivative, interpreted / sandboxed, from Roblox) - https://terralang.org (Lua JIT compiler) - https://nelua.io (Lua-syntax -> C compiler (WASM too w/ Emscripten) - https://github.com/pallene-lang/pallene (Lua AOT compiler) - https://github.com/teal-language/tl (Teal -> Lua compiler) - https://typescripttolua.github.io/ (TS -> Lua compiler) - https://github.com/sumneko/lua-language-server (IDE only typing) With minimum effort you can get a lot of benefit from using Sumneko's Lua language server in VSCode for near many Lua versions (LuaJIT, PUC-Rio Lua, etc.) All of the projects serve different purposes, whether you need/love Lua for speed (JIT, for games), low memory usage (AOT, for embedded), or simplicity (a
Read the rest
ll of them).
In Using Lua with C++
Terra and Nelua are both very different in goals than Teal. Teal is literally gradual types integrated into Lua keeping as many of Lua's idioms as possible (to a fault[1]). Terra and Nelua are both very metaprogrammable systems programming languages. Nelua's goals are primarily to soften C's rough edges, comparable to something like Nim. There's another one you missed in Pallene[2]. But again, it's goal was to optimize the stack sharing involved in using the C API. It also adds types though and maintains Lua idioms as much as possible. [1]: https://github.com/teal-language/tl/discussions/339 [2]: https://github.com/pallene-lang/pallene
In Bog – small, strongly typed, embeddable language
Teal only type checks when run from the command line though, which isn't the best when you want to embed Lua. At least thats what my reading of the docs says, I'd be happy if I'm wrong. But reading the docs now, it doesn't seem to say that any more - maybe its changed recently? Edit: Oh yes it's still like that 'When loading and running the Teal module from Lua, there is no type checking! Type checking will only happen when you run tl check or load a program with tl run.' from https://github.com/teal-language/tl/blob/master/docs/tutoria...
In Bog – small, strongly typed, embeddable language
There's many different approaches to typed Lua: - https://luau-lang.org (interpreted / sandboxed) - https://terralang.org (JIT interpreted) - https://nelua.io (Lua -> C) - https://typescripttolua.github.io/ (TS -> Lua) - https://github.com/teal-language/tl (Teal -> Lua) - https://github.com/sumneko/lua-language-server (IDE only typing) With minimum effort you can get a lot of benefit from using Sumneko's Lua language server.
In Bog – small, strongly typed, embeddable language
Wow, amazing stuff. I love Lua, it was how I learned programming as a kid. Coincidently from the same world as the author. Open Tibia. The author made a custom client (https://github.com/edubart/otclient) for the game that is still very much in active use by thousands of players. He's a very skilled developer. Great to see AOT compiled Lua, I know of the other solutions: Luau (from Roblox), Teal, TypeScriptToLua, Terra, etc., but this one is my favorite so far. Love the simple compilation to C (and WASM support via Emscripten). Though Terra's JIT is enticing and good replacement for LuaJIT, this is for embedded systems, it's a good replacement for Lua PUC-Rio. Typed Lua Projects: - https://luau-lang.org/ - https://terralang.org/ - https://github.com/teal-language/tl - https://typescripttolua.github.io/ There's also a language server for L
Read the rest
ua dialects for type checking in the IDE: https://github.com/sumneko/lua-language-server
In Nelua: AOT statically typed Lua

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.