Hacker News new | ask | show | jobs
by zoffix222 3508 days ago
To me, it's mostly the presence of all new CS inventions in core. Like you don't need any damn libraries to paralellize stuff, just use `start` block or a `supply`. If you write accounting software, you'll appreciate built-in rationals so that 0.1 + 0.2 == 0.3, unlike so many other languages. Laziness is present in many things like lazy exceptions, string generation, and sequences: say (3, 9 … ∞)[^20] does not hang and produces (3 9 15 21 27 33 39 45 51 57 63 69 75 81 87 93 99 105 111 117), despite being an infinite sequence.

You also have grammars, more readable regex language, and superb object model. On a more advanced spectrum, with grammars and slangs, you can craft your own mini-languages for a specific domain where they would fit better; there's a nice little presentation by Damian Conway where he crafts an operator for quantum mechanical math that looks and functions just like the proper mathematical symbol functions: https://www.youtube.com/watch?v=Nq2HkAYbG5o

As for the langs you mentioned: I find a lot of similarities between Rust and Perl 6, although in some areas it seems Perl 6 folks did more thinking (like the .match stuff). They are however in different domains, Rust being a systems language; but you can use Rust libraries in Perl 6 via NativeCall if you compile them for C calling convention.

Perl 6 smokes Ruby and Python with its asynch/parallel/conc. support and more advanced object model.

As far as Unicode support goes, only Swift comes close to Perl 6; try to uppercase "ß" in Ruby, for example. Even if you to claim you only write software for English-speaking customers, you still have to deal with weird customer names for example.

For parameters you mention, many people notice they have to write fewer code in Perl 6. Personally, I found when writing equivalent code as Perl 5, my Perl 6 versions were TWICE as short. And I don't mean you golf your program to anything unreadable, but rather the provided primitives are... well, modern... so I don't have to reinvent them with more basic primitives provided by older langs.

What you'll find is performance is a bit crappy right now. Perl 6's stable got released less than a year ago so there's still a ton of work left to do in bugfixing and optimizations. I think that's what a lot of folks fail to realize that Perl 6 is a brand new baby language so trying to compare its performance to Python (25 years of work) or Ruby (21 years of work) or ES6 (tons of corporate interest) is a bit unrealistic at this moment in time.

In conclusion, one can list dozens of benefits, but I think at the end of the day, it'll all come down to which language better fits your brain and if you participate in a community, which community feels more like the folks of your kind. So far, anyone who I saw try the language say they loved it. The performance can use an improvement and that's what the core devs are working on. So, I think the steam is being gathered.

1 comments

Thanks for detailed response. After a quick reading, I admit Perl 6 grammars and slang look amazing. Appears to give the language a LISP-like flexibility for creating DSL's.

I discovered that Perl 6 Supply is basically the same as Streams/Sequences which is great for handling async activities and work units.

Also discovered that perl 6 has optional typing. This is terrific since it makes for better maintenance and refactoring tools possible.

I do hope the performance improves! There are so many competitive languages for the backend today that without excellent performance, memory management and scaling characteristics, it is difficult for any new language to gain traction just on features alone.