←back to thread

218 points generichuman | 1 comments | | HN request time: 0.347s | source
Show context
pansa2 ◴[] No.44001141[source]
> Teal is a statically-typed dialect of Lua.

I was expecting Teal to be "Lua + type annotations", similar to Mypy. However from a quick look it does indeed seem to be a "dialect" in its own right. Teal is Lua-like and compiles to Lua, but there's more to it than just static types. Perhaps it's more similar to TypeScript?

For example, Teal replaces Lua's tables - the language's signature single, highly-flexible data structure - with separate arrays, tuples, maps, records and interfaces. It changes the variable scoping rules and even adds macro expressions.

Teal therefore seems substantially more complex than Lua. The author recognizes this in the conclusion to a recent presentation [0]: Lua is "small and simple", maybe Teal is "something else"? Lua is for "scripting", maybe Teal is better suited to "applications/libraries"?

[0] https://youtu.be/Uq_8bckDxaU?t=1618

replies(8): >>44001173 #>>44001256 #>>44001260 #>>44001346 #>>44001369 #>>44001755 #>>44004680 #>>44006829 #
1. lifthrasiir ◴[] No.44001256[source]
That was a major concern when I was using Lua at work. Pretty much every type checker in Lua required transpiling, which doesn't work for many environments (e.g. Redis script). My Kailua [1] was designed that in mind but didn't reach its full potential.

[1] https://github.com/devcat-studio/kailua/