Hacker News new | past | comments | ask | show | jobs | submit login

I was a huge Lua fan, but once I jumped on the typescript bandwagon I found the lack of (production ready) desugaring and static type compilers for Lua to be a negative. The language is fantastic, but what I expect from a scripting language is always expanding, I guess



You might enjoy https://typescripttolua.github.io/

I tried a bunch of different typed luas before landing on this project and having a really wonderful experience incrementally porting my most recent love2d thing over and then being able to make big architectural changes with confidence that types gave me.

I was able to do this port without modifying the original lua files, just replacing them with typescript one by one. Any lua libraries I was using I kept using by just writing some type declarations for then and throwing them in with the compiled output.


Today I would recommend checking out Teal: https://github.com/teal-language/tl/ I'd consider it the spiritual successor to Typed Lua.


I looked at many options, what I lacked when I looked in this space is a big comparable project to, say, my game engine https://github.com/lanarts/lanarts that uses one of these typed Lua's. I'm not in a position where I can spend the time being the first - typescript has very mature idioms for large code bases


What about https://github.com/Roblox/luau? It gives Typescript-like annotations.


With roblox behind it, I'd indeed consider it for my game. I'm guessing no support for LuaJIT, though?


It's a custom fork of plain Lua, not LuaJIT, so indeed there's no LuaJIT support. They first open sourced it this November and supposedly they're planning to implement their own JIT. There's no timeframe or estimate for that though, just mentions of plans to here and there.


Sounds good. I won't cycle back to finish Lanarts for a while so I look forward to a JIT in this space. LuaJIT was a marvel but it probably needed a few more years of Mike Pall's time to smooth out difficult to anticipate optimization




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: