[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Any plans regarding static typing in core Lua?
- From: Hisham <h@...>
- Date: Wed, 9 Mar 2016 02:09:48 -0300
On 8 March 2016 at 04:28, Sean Conner <sean@conman.org> wrote:
> It was thus said that the Great Xavier Wang once stated:
>> 2016-03-08 14:41 GMT+08:00 steve donovan <steve.j.donovan@gmail.com>:
>> > On Tue, Mar 8, 2016 at 2:59 AM, Karel Tuma <kat@lua.cz> wrote:
>> >> Such a project is simply better served as a separate recompiler targeting Lua.
>> >> It could easily surpass current Lua codebase in line count if you're wishing
>> >> for something robust enough to allow for large scale application development.
>> >
>> > Exactly. This is why TypeScript exists and why it's implemented as a
>> > recompiler and not part of the EcmaScript standardization.
>> >
>> > (Not only for type-safety and discoverability, but for general ease of
>> > browsing and navigation)
>> >
>> > I suspect one could get pretty far with type annotations as part of
>> > the _documentation_ of an interface.
>> >
>>
>> But Lua lacks #line program makes compiles to Lua difficult to debug :(
>
> +1
>
> I was working on a hacking project recently where this could have been a
> big help (compiling a domain specific language into Lua where arbitrary Lua
> code can be included). I "solved" this issue by including a number of blank
> lines when compiling the Lua code (lua loadstring()) to return meaningful
> line numbers.
FWIW, I went the exact same route (adding blank lines to the code
generator) when I did a (for-fun, never finished) project in Typed
Lua. I don't remember if it was merged to the Typed Lua codebase (too
lazy to check now), but I think it was.
-- Hisham