prosody/teal-src
Kim Alvefur 2ef0e122fd util.xtemplate: Use same argument order in filters even without 'args'
This removes the different argument order used between '{x|foo}' and
'{x|foo(y)}' because the differing order was awkward and confusing.

This util does not seem to be widely used so should not be problematic
to change this part. The only known use is in mod_pubsub, which does not
use the filter function feature.
2024-10-16 16:15:05 +02:00
..
prosody util.xtemplate: Use same argument order in filters even without 'args' 2024-10-16 16:15:05 +02:00
module.d.tl moduleapi: Update Teal spec 2023-11-13 10:40:24 +01:00
README.md teal-src/README: Words on Compiling to Lua 2023-03-28 11:42:20 +02:00

Teal definitions and sources

This directory contains files written in the Teal language, a typed dialect of Lua. There are two kinds of files, .tl Teal source code and .d.tl type definitions files for modules written in Lua. The later allows writing type-aware Teal using regular Lua or C code.

Setup

The Teal compiler can be installed from LuaRocks using:

luarocks install tl

Checking types

tl check teal-src/prosody/util/example.tl

Some editors and IDEs also have support, see text editor support

Compiling to Lua

GNUmakefile contains a rule for building Lua files from Teal sources. It also applies LuaFormat to make the resulting code more readable, albeit this makes the line numbers no longer match the original Teal source. Sometimes minor luacheck issues remain, such as types being represented as unused tables, which can be removed.

sensible-editor teal-src/prosody/util/example.tl
# Write some code, remember to run tl check
make util/example.lua
sensible-editor util/example.lua
# Apply any minor tweaks that may be needed

Files of note

module.d.tl
Describes the module environment.