lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Mar 8, 2016 at 3:06 PM, Rena <hyperhacker@gmail.com> wrote:
> On Mar 8, 2016 5:19 AM, "Cuero Bugot" <cbugot@sierrawireless.com> wrote:
>>
>> > The moment that "optional" typing is in the core, little snippets of
>> > code posted on this list will start having these "optional"
>> > annotations and Lua code will start looking like Julia code.
>> > <http://docs.julialang.org/en/release-0.4/manual/types>
>>
>> Python added type hinting in 3.5
>> (https://www.python.org/dev/peps/pep-0484/), we'll see if it going to look
>> like Julia code :)
>>
>
> Decorators and annotations are some of my favorite features of Python. Makes
> it easy to add type checking if you want it.

And to clarify, all that's new in Python 3.5 is a standardized
recommendation on how to do type hinting. The annotation syntax itself
has been around since Python 3.0, and there were already third-party
libraries taking advantage of it for type-checking well before 3.5.
PEP 484 is just an attempt to unify competing standards [1].

And "third-party library" is precisely where I think such features
should stay in Lua. To add such features to core Lua would just be
unnecessary bloat for a language that prides itself on being, among
other things, compact and lightweight.

[1] I would be remiss if I did not provide a link to https://xkcd.com/927/ here.