News for hackers. Stuff that matters.
Re:Teal – A statically-typed dialect of Lua by 90s_dev on Friday May 16, 2025 @03:35PM (#44009042)
That's actually really exciting in that case.

If it goes further and generates native C control flow statements when possible ("if", "for", native functions, native function calls, etc), I think it could be an omni-level language, generating basically Lua statements when dynamic and C when not, and mixing them all within the same program, entirely controlled by how much type information you give it (and how you use tables and metatables).

Re:Teal – A statically-typed dialect of Lua by ufo on Friday May 16, 2025 @03:48PM (#44009170)
Alas, as of last month we changed Pallene's compiler and it now generates C gotos for control flow. ( ^ _ ^ メ ) It helped with certain optimizations...
Re:Teal – A statically-typed dialect of Lua by 90s_dev on Friday May 16, 2025 @04:24PM (#44009500)
Ha! Called it again!

But why gotos instead of proper control flow? Is it just easier to emit?

Re:Teal – A statically-typed dialect of Lua by ufo on Friday May 16, 2025 @07:01PM (#44010567)
We switched from a hierarchical internal representation to a flat one, with gotos. Made it easier to write textbook otimization algorithms. In theory we could try to reconstruct the if and while statements when it's time to emit C, but gotos are more straightforward now.
Re:Teal – A statically-typed dialect of Lua by 90s_dev on Friday May 16, 2025 @10:50PM (#44011670)
This sounds like it could compete with V8 at some point in the next few years. Honestly it could be a game changer. Looking forward to watching its progress.