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 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 3:56:07 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

62 sources
Many of us would love a TypeScript analogy for Lua. There have been some attempts: Luau (5.2k, last week, https://luau.org/, https://github.com/edubart/nelua-lang) Nelua (2.3k, 8 months ago, https://nelua.io/, https://github.com/luau-lang/luau) Terra (2.9k, 3 days ago, https://terralang.org/, https://github.com/terralang/terra) Teal (2.7k, 2 days ago, https://teal-language.org/, https://github.com/teal-language/tl) The Luau author is always on the official Lua mailing list, and it has twice as many stars, so it seems likely to win the long term popularity contest.
In Lily Programming Language
Teal creator here! Thank you for the kind words, super happy to see people being productive with it!! On your wishlist items: 1. There are a few third-party projects that bundle Lua code. One that comes to mind is https://lrocket.codeberg.page/ — I don't know if this functionality should be brought into Teal itself, it sounds to me like something better left to the surrounding tooling? 2. Unfortunately those annoyances are part of the heterogeinity of the Lua ecosystem, but Teal tries to paper over them using the compat53 library (which, granted, is not available everywhere if you want to do a pure-Lua deployment on existing Lua environments). The --gen-target and --gen-compat flags should still help some, hopefully! 3. Not sure what you mean there -- you mean adding chunks of untyped Lua _in the same file_? I think that if you have a js
Read the rest
on.lua and a json.d.tl file, then it should use the definition file only and leave the .lua file alone. At least that's the intended behavior! 4. That's up to GitHub :) Last time I checked their docs I think they want something like 100 or 200 projects using the language for considering adding native highlighting for it on the website. But you can add a .gitattributes file to the root of your repository like this https://github.com/teal-language/tl/blob/master/.gitattribut... and at least it will display .tl files with .lua highlighting. Again, thank you so much for the feedback!
In Teal – A statically-typed dialect of Lua
Ah that's a shame. I was hoping it would work via sidecar files like Ruby's RBS [1] or Python's stub files [2] I was editing my comment during your reply, and added this: > or maybe https://github.com/teal-language/tl#loading-teal-code-from-l... this is the easier way to do it. `require` and use `loader` during development, generate the Lua once things are somewhat stable. Does that sound like the right idea then? [1] https://github.com/ruby/rbs [2] https://mypy.readthedocs.io/en/stable/stubs.html
In Teal – A statically-typed dialect of Lua
There's a type declaration file for the vim global that's defined by default in Neovim: https://github.com/teal-language/teal-types/blob/master/type... to be used via `global_env_def` described in https://teal-language.org/book/declaration_files.html And though they mention it as being for third party libraries, this also seems a way to declare types for your own code in an external file, thus keeping your code as runnable Lua and benefiting from type checking too. That seems like a neat workflow for developing Neovim plugins with this: instead of having to constantly regenerate Lua from .tl files so Neovim can pick up your changes during development. Edit: or maybe https://github.com/teal-language/tl#loading-teal-code-from-l... this is the easier way to do it. `require` and use `loader` during development, generate the Lua once things ar
Read the rest
e somewhat stable.
In Teal – A statically-typed dialect of Lua
Yep. Luau has an LSP so you should be able to get all that. There is no support for Luau in Love2D though. You would have to author your code in Teal (typed lua to lua compiler) and then compile that to Lua to be run in Love: https://github.com/teal-language/tl You can get the Lua LSP working in Love2D with full completion support by the way. The Lua LSP has 3rd party libraries included in it. You can see all the preinstalled ones here: https://github.com/LuaLS/lua-language-server/tree/master/3rd Support for them as built-ins will be removed at some point though. But you can always add them yourself: https://github.com/LuaLS/lua-language-server/wiki/Settings#w... using the files from here: https://github.com/LuaCATS/love2d/ It looks like the easiest way to support them is using a `.luarc.json` file though: https://github.com/LuaLS/lua-lan
Read the rest
guage-server/wiki/Configurat... Here is a project that is already set up with a config file that you should be able to just copy: https://github.com/jonasgeiler/love2d-joystick-tester/blob/m...
In Lune (Rust-based Luau runtime) 0.9.0 released
jalcine·Aug 24, 2024Recommendation phrase
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/ has some notes but https://man.sr.ht/~jacky/livtet is much better. It's been fun using Lua to externalize a lot of logic (and I'm looking into using https://github.com/teal-language/tl because I love me some typing. Outside of that, I've been blogging a lot more (https://www.jacky.wtf/essays/ - August looks so full, ha) and now I'm writing about things I'm reading too (https://www.jacky.wtf/links/). Been doing this to try to ween off social media and rely on places like this to share stuff.
In Ask HN: What are you working on (August 2024)?
I don't think Teal can be total. Lua is super expressive and you would need to get deep into dependent types and whatnot to caption a fraction of the power of its types. > Some Lua libraries use complex dynamic types that can't be easily represented in Teal. In those cases, using any and making explicit casts is our last resort. https://github.com/teal-language/tl/blob/master/docs/tutoria... Personally if I paid the cost of having an extra compile step then I would rather wish for some serious type safety like what Elm or Reason provide. But then you end up with a different language. I agree though that for your use case of making complicated libraries Teal might be actually good fit. I was going to argue that Luau is superior anyway if you really can't cope with annotations but obviously if you want to make libraries for lua users that d
Read the rest
oesn't work. (Though I guess you could technically compile down from Luau to Lua, just not sure if anyone has ever bothered.)
In What I think about Lua after shipping a project with 60k lines of code

Showing the 15 most recent of 62 sources. Enable JavaScript to search and browse every indexed mention.

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.