logo
Kurashizu Blogwhere ideas flow
  • Home
  • News
  • Blog
  • About
  • Home
  • News
  • Blog
  • About

© 2026 Kurashizu. All rights reserved.

Admin·New Post·Service Status
Powered by Cloudflare·30.10.26
← Back to news

Teal – A statically-typed dialect of Lua

Original article
teal-language.org|125 points|55 comments|by Lyngbakr|Oct 16, 2026

Teal: A Statically-Typed Evolution of Lua

Teal Logo Placeholder

Teal is a specialized dialect of the Lua programming language that introduces static typing. By adding type annotations, it allows developers to define complex structures such as:

FeatureDescription
Records & MapsStructured data and key-value pairs
ArraysTyped sequences of elements
InterfacesDefined contracts for object shapes
Union TypesVariables that can hold multiple types
GenericsFlexible, reusable type definitions

Teal aims to occupy a space similar to what TypeScript provides for JavaScript, while remaining faithful to Lua's core philosophy of bloat minimalism, portability, and ease of embeddability.

How it Works

Teal is not a runtime; it is implemented as a compiler called tl. This tool transforms source files with the .tl extension into standard .lua files.

A Glimpse of the Syntax

In Teal, you can explicitly define the types of function arguments and return values. For example, a simple addition function would be represented mathematically as f:R×R→Rf: \mathbb{R} \times \mathbb{R} \to \mathbb{R}f:R×R→R, and written in code as:

local function add(a: number, b: number): number
    return a + b
end

local s = add(1, 2)
print(s)

Want to try it out? You can experiment with the language via the Teal Playground in your web browser or examine the source code of the official website.

Getting Started

To begin using Teal, follow these steps:

  • Install the Compiler If you have LuaRocks installed, run: luarocks install tl (Alternatively, download pre-compiled binaries for Windows or Linux).
  • Set Up Your IDE
    • For Visual Studio Code: Install vscode-teal.
    • For NeoVim and others: Use teal-language-server.
  • Manage Projects For larger codebases, avoid running tl on files individually; use a build script or task runner.

Knowledge Base & History

The evolution of Teal has been documented through several presentations regarding the tension between minimalism and type systems:

  • 2019: Minimalism versus types
  • 2020: Minimalistic typed Lua is here
  • 2021: What's next for Teal
  • 2024: Five years of Teal: minimalism versus growth in language design
  • 2025: What should Teal be? (Reflections on the direction of FOSS projects)

Community & Origin

Teal was originally conceived by Hisham Muhammad. Today, it is maintained by a growing collective of contributors. In a feat of "bootstrapping," the language is actually written in Teal itself.

Connect with the community:

  • Development: Hosted on GitHub.
  • Chat: Join the conversation on Matrix at #teal-language_community:gitter.im.