Thu, 22 Jun 2006
Perl6 syntax
I have just came across the Perl6 Synopsis, so I wanted to see where the Perl development is heading to. I must say, I think moving to Perl6 would be a horrible task. I still did not read everything, but so far it seems some design decisions are a bit weird for me:
- Single dot (".") instead of an arrow ("->") as a dereference operator. While it is not bad per se (several languages like Ruby or C use it), I think the arrow is more readable (because it is wider, it provides better visual delimitation).
- Long dot (the "object\ .method()" construct). It is visually awful (as backslash is usually associated with string interpolation or escaping special characters). Whitespaces in Perl6 will be more involved as a part of syntax than in Perl5. I think the significant whitespace is a domain of Python, but now it is also in Perl6. I think introducing the long dot into the Perl6 syntax is probably connected with having to use dot as a dereference operator instead of an arrow.
- Mixed-case words (such as builtin type names, but I have seen this in other contexts in the Synopsis documents as well). IThinkThisIsAJavaWayOfDoingThings, WhichIsClearlyUnreadable. DefinitelyLessReadableThan underline_delimited_identifiers.
- Native versus object types (at least they have autoboxing). Having to distinguish between int and Int data types is not Do What I Mean. I think the main purpose of scripting languages is that the programmer does not need to think about (obvious) type conversions. Is it another try to sneak Java drawbacks^Wfeatures into Perl?
That said, there are definitely positive aspects of Perl6 as well - for example the ability to use any Unicode pair characters as comment or regex delimiters (for example the Japanese corner quotes in: "qr「match」"). But I think for me the above problems mean that I would have to stick with Perl5 as long as possible, or I would have to lear another language, which would have worse (or smaller) libraries than Perl has (Ruby), or which has even more annoying syntax (Python, the No-oneliners-please language).