3 ms·
Thinking about a New Type System for Perl/Cor
- fennecfoxen 6y agoI'm skeptical about languages getting type systems in version 2. Python has a type system (MyPy) and it's pretty mediocre in practice, because all the major frameworks violate it with abandon, and the maintainers seldom bother to add types after the fact.
- b2gills 6y agoThe problem with types in Python is that the compiler doesn't enforce the types. Perl will actually enforce the types.
- jimktrains2 6y agoPHP added type annotations later on, and I think that worked much better than in Python. I couldn't tell you why, but types in Python feel like a dumpster fire and in PHP seem to actually ... help and make things better.
- latenightcoding 6y agoMoose was the first attempt to bring modern OO and a type system to Perl, Moose's codebase became very complex and slow so a lot of people stopped using it and stopped using the Moose type library too. Why make the same mistake with "Cor"? they should be two separate projects.
- rurban 6y agoabsolutely not. types are the base for classes and multidispatch. you cannot just add classes without typechecks. Perl has types, just not in the new signatures, and they are unused. when I started with cperl I started with types, then signatures and then the object system. just modelled after perl6, because that was a proper plan, just poorly implemented. moose never was a proper plan, mouse was always the gold standard. unfortunately only with moose syntax, not perl6. Cor just seems to be another desperate attempt, this time with proper perl6 syntax but no chance of being implemented properly. Good OO systems for perl5 are spvm and cperl, which doesnt have multidispatch yet. But proper type optimizations. http://perl11.org/cperl/#With-classes-types-compilable-company-friendly http://perl11.org/cperl/#With-classes-types-compilable-compa...
- lizmat 6y agoDear readers: please note that Perl 6 has been renamed to Raku (https://raku.org https://raku.org using the #rakulang tag on social media).