Hey @tarleb, I created issue #128 quite a while ago now and said I might have a prototype for generating type annotations available over Christmas... well, real world happened but I'm getting back into the swing of things with Haskell again and have re-created the dead prototype I had for generating types from HsLua. I've created a repo where you can take a look. It might be useful as a core library as well, but I'm neither super well versed with the type annotations in Lua or HsLua, but from testing the manual typings I've written for a few test projects it lines up pretty well.
I have a few thoughts about the API, I understand it will be a major breaking change but it would be nice to have type safe type annotations when creating functions/modules as the Lua community seems to have landed on a shared subset of type annotations. Like the ... for variadics, typ? for optional types, string|integer for union types, ---@deprecated [note] for deprecations and so on instead of the Text field it is today. hslua-typings does not have a way to differentiate between ...string and string[] for example.
Hey @tarleb, I created issue #128 quite a while ago now and said I might have a prototype for generating type annotations available over Christmas... well, real world happened but I'm getting back into the swing of things with Haskell again and have re-created the dead prototype I had for generating types from HsLua. I've created a repo where you can take a look. It might be useful as a core library as well, but I'm neither super well versed with the type annotations in Lua or HsLua, but from testing the manual typings I've written for a few test projects it lines up pretty well.
I have a few thoughts about the API, I understand it will be a major breaking change but it would be nice to have type safe type annotations when creating functions/modules as the Lua community seems to have landed on a shared subset of type annotations. Like the
...for variadics,typ?for optional types,string|integerfor union types,---@deprecated [note]for deprecations and so on instead of theTextfield it is today.hslua-typingsdoes not have a way to differentiate between...stringandstring[]for example.