News for hackers. Stuff that matters.
Re:Teal – A statically-typed dialect of Lua by tiffanyh on Friday May 16, 2025 @08:12AM (#44004473)
> As Teal shows, [official typed Lua] would require giving up one of Lua's core features: tables as the language's single data structure.

Is that true ... you can't have typed tables without giving up tables as a data structure?

Re:Teal – A statically-typed dialect of Lua by krapp on Friday May 16, 2025 @08:54AM (#44004879)
You can't have typed tables without giving up tables as the language's single data structure. You would have tables and typed tables which are essentially just arrays with extra steps.
Re:Teal – A statically-typed dialect of Lua by 90s_dev on Friday May 16, 2025 @09:07AM (#44005027)
Not with type erasure like TypeScript does. Then it would just be type checking hints as to how the table is used, not a different kind of table. Teal does this.