Hacker News new | ask | show | jobs
by zoffix222 3508 days ago
Because we aim for organic growth: not too fast and not too slow. Based on stats, our userbase doubled since last year; and that's with an yet-to-be-optimized compiler that's an order of magnitude slower than competitors and by some people's standard not yet production ready.

It'll also take a bit for people who loudly push 25-year-old languages like Python and Ruby like holy grail to... die off (no, I don't want them to convert). Perl 6 is a next generation language over them and it'll take next generation of programmers to make use of the new programming paradigms.

What you're probably asking is why hasn't Perl 6 went viral like Swift, Rust, or Go? Well, we don't have a multi-million (or -billion) company backing us, so fanboys and people who are after the latest shiny things aren't flocking to us like to manure. But look around this site: those langs get as much nonsensical comments from the Python-Ruby zealots who are too scared of new languages :)

Perl 6's first production release was less than a year ago. It's a bit unrealistic to expect it to be a "poster child" of anything so fast. If you're old enough to remember, no one gave a shit about Python until at least second version.

Don't worry about popularity. Learn many languages and use what you like using.

3 comments

Because I don't know much about perl, and not much more about Python, and much much less about ruby, would you kindly give a couple of examples of :

> It'll also take a bit for people who loudly push 25-year-old languages like Python and Ruby like holy grail to... die off (no, I don't want them to convert). Perl 6 is a next generation language over them and it'll take next generation of programmers to make use of the new programming paradigms.

... the kinds of paradigms or ng features that perl has that python doesn't?

I can think of grammars, junctions, autothreading.

Grammars are YACC on steroids. You can very simply say "this parsing state requires reading dot-separated things".

Junctions define multiple plausible states. In certain instances, they can look like a feature you know, but they're more generalized than any of those: sum types, switch statements with multiple cases, combined guards, sets…

Autothreading gives the ability to automatically parallelize certain constructs (for instance, when an expensive operation happens on a junction).

Perl6 also includes features found only in non-mainstream languages, like lazy lists, macros, and runtime addition of syntax.

And it has most modern concurrency primitives, unlike most languages which only have one: threads, locks, semaphores, promises, channels, event loops, supplies.

To be clear: Perl 6 is not without flaws (marketing and performance, for instance), but it is definitely innovative. It lets you write expressive code more succinctly than mainstream dynamic languages, in a way similar to how Python lets you write expressive code succinctly compared to C++.

Python is a Turing Complete language, so I'd be surprised if it trully lacked a feature and there weren't a library written by a poor soul that implemented it.

I am talking more about programming thinking than a feature set. That there's no such thing as Unicode issues or needing to use silly "u" prefixes. That 0.1 + 0.2 == 0.3 reliably that you can write accounting software worry-free and not wonder about why it fails in so many old langs. That you can use grammars to write a mini-language for your specific problem to save yourself tons of generic programming. That you can branch off into a separate processor core with a simple `start` keyword or parallelize a method call on a list of items with just a `>>` hyper prefix or seamlessly communicate a job parallelized over 30 cores with yet another core with a simmple channelled supply without worrying about data races.

These features may be present in Python, but way of thinking isn't. A new programmer starting in Perl 6 won't think of multi-threading, Unicode, floating point math as problematic areas and grammars together with full-language maleability that lets you create problem-specific langs instead of a mountain of generic classes is undreamt of by oldschoolers like me.

> That there's no such thing as Unicode issues or needing to use silly "u" prefixes. That 0.1 + 0.2 == 0.3 reliably that you can write accounting software worry-free and not wonder about why it fails in so many old langs.

It's interesting that you lead with a bunch of examples which are very old or simply wrong.

For example, in any language where you don't think about Unicode you are guaranteed to have encoding issues as soon as you have sufficiently diverse (i.e. real-world) data. If Python 2's u"" prefix offends you so – I must say, hearing a Perl programmer complain about punctuation is a somewhat novel experience – note that Python 3 was released in 2008 which changed to use Unicode by default. In every language, however, you will need to think about file encodings everywhere you read or write data until we finally hit that halcyon decade (century?) where you can assume UTF-8 with a very high level of confidence.

Similarly, Python has had decimal-accurate math since the early 2000s so the developer is free to pick whether they value absolute precision over standard IEEE floating point semantics. Perl 6 dynamically switches numeric classes so the simple syntax you show will lose precision at some point depending on the data and order of operations – that's why the documentation specifies Rat as “limited precision” and it means that anyone writing accounting (or, in many cases, scientific) software would explicitly use an arbitrary-precision data type to avoid the classic floating-point math problems:

    $ perl6 --version
    This is Rakudo version 2016.10 built on MoarVM version 2016.10
    $ perl6
    > 123456789 - 1e-5
    123456788.99999
    > 123456789 - 1e-6
    123456788.999999
    > 123456789 - 1e-7
    123456789
    > (123456789 - 1e-1) - 123456789
    -0.0999999940395355
Please note that I'm not saying Perl 6 is terrible. This is a well known trade-off which everyone has to learn about if they work in fields where this matters. Perl 6 has arbitrary-precision types built-in so anyone dealing with financial data is simply going to learn to specify that precision is not an acceptable trade-off for performance:

    > my $a = Num(12356789)
    12356789
    > $a + FatRat(0.1) - $a
    0.099999999627471
    > my $a = FatRat(12356789)
    12356789
    > $a + FatRat(0.1) - $a
    0.1

I would suggest focusing on the parts of Perl 6 which you like rather than hurling bricks at other languages. Things like start / hyper sound kind of interesting and it'd be far more interesting to hear about how those work in practice and how you manage issues like communications overhead or shared data than your personal dislikes about some other language.
> Python 3 was released in 2008 which changed to use Unicode by default.

Sure, but Python 3 only took on correct handling at the whole string level. It ignored correct handling at the character and sub-string level. Something similar applies for many programming languages. I think this was Zoffix's point.[1]

> explicitly use an arbitrary-precision data type to avoid the classic floating-point math problems:

    > 123456789 - 1e-5
    123456788.99999
Literals of the form `1e-5` are not arbitrary precision in Perl 6. They are floating point (called Num in Perl 6).Hence your above result. Similarly:

    > my $a = Num(12356789)
    12356789
    > $a + FatRat(0.1) - $a
    0.099999999627471
would work if instead you wrote:

    > my $a = 12356789
    12356789
    > $a + 0.1 - $a
    0.1
    > $a + 0.00001 - $a
    0.00001
If all inputs are 100% accurate, arbitrary precision Ints and/or FatRats then all results will be too. But the same applies even if some Rats are also involved provided the final result requires a denominator less than 18,446,744,073,709,551,615.

[1] Of the 150+ languages with Rosettacode solutions for returning the length of a string (at http://rosettacode.org/wiki/String_length) just 3 (Elixir, Perl 6, Swift) have a built in way to get the right result for what Unicode defines as "what a user thinks of as a character".

> Sure, but Python 3 only took on correct handling at the whole string level. It ignored correct handling at the character and sub-string level. Something similar applies for many programming languages. I think this was Zoffix's point

It very well could have been what Zoffix had in mind but do note that this goes back to the problem with the rant style of post.

As for the specific question of character handling which you raised, given the wide number of people who have made other choices on the question of whether a length function should count codepoints or graphemes that I'm reluctant to say using one versus the other is a question of “correct” or “incorrect” versus simply “different”. I suspect most programmers are rarely going to care and the ones who do are going to need to learn enough more about Unicode and i18n that this difference will not be a deciding factor for anyone.

(This is not to detract from the great history the Perl community has with taking seriously the benefits of having a rich Unicode API – I've routinely used this as an example to follow – but simply that Unicode is a deceptively simple-looking topic)

> Literals of the form `1e-5` are not arbitrary precision in Perl 6. They are floating point (called Num in Perl 6).

Yes. Again, my point wasn't that Perl 6 is bad but rather that it's lazy and ineffective advocacy to say something like “you can write accounting software worry-free” when you know full well that anyone doing that for real will still need to understand the differences and that most users will never care because they aren't writing financial software.

There definitely are good reasons for a length function to count both codepoints and graphemes. Which is why Perl 6 has a method for both. This is also why neither of them is called `length`. In fact if you ever attempt to call the `length` method on an object Rakudo will ask you "Did you mean 'elems', 'chars' or 'codes'"
For the sake of exhaustivity, let's point out that numeric literals in Perl6 separate rationals (Rat) and floating-point numbers (Num), which means the first Perl6 example would work as intended provided we stick with Rat:

  > 123456789 - 0.0000001
  123456788.9999999
  > (123456789 - 0.1) - 123456789
  -0.1
Rationals represent numbers of the form a÷b, with a a bigint and b a 64-bit integer. When b gets too big for that fast representation, it gets converted to a Num (ie, IEEE 754).

  > (1 / (10 ** 100)).WHAT
  (Num)
That tradeoff is reasonable, as numbers that cannot be represented this way are very likely to be non-rational math (eg, sqrt, exp, sin, pi, that kind of thing). For money, this is safe. For real numbers, well:

  > sin(0).WHAT
  (Num)
FatRat uses a bigint for b. Obviously, it still cannot accurately represent non-rational numbers such as pi.

Reference: https://docs.perl6.org/language/syntax#Number_literals https://docs.perl6.org/type/Rat

Thanks! I definitely hope my point didn't come across as “this is terrible” rather than “people for whom this is critical still need to read the docs / write tests”.
I wonder : what are those new paradigms perl6 is introducing?

I learnt ruby in early 2000', way before rails, because I was attracted to its "it's 100% OO" concept. Now, I use golang, because background jobs have progressively became a capital part of my programs, and I love how it's just about prefixing a function call with a keyword, in golang. The idea of having system programming-like perfs in web doesn't hurt either. What would you say are the groundbreaking new concepts of perl-6 ?

I wrote a short answer here: https://news.ycombinator.com/item?id=12890552

If you like go's conc stuff, then I'm sure you'll love Perl 6's async/conc/paralel. stuff: https://docs.perl6.org/language/concurrency#High-level_APIs

I wrote an IRC API with Perl 6 that I really love, since it makes it so easy for me to parallelize a plugin's work, while working with an async protocol, all the while connected to multiple servers, all with the same short script: http://perl6.party/post/IRC-Client-Perl-6-Multi-Server-IRC-M...

Thanks!

I'm going to be honest: nothing in what is described seems to me like a new idea that makes me want to try perl6. Floating point safeness is in R, dsl is in ruby, concurrence is in golang. And unicode... I'm not exactly sure what the problem is with other languages, I guess it never hit me. :)

That being said, it's cool to see all those features in the same language. I'll keep it in mind if anyone mentions all or most of those as pain points.

So, floating point safesness is in R, dsl in ruby, concurency in Go and Unicode in... ? What if you want two features at once ? Or all of them ? ;)

Examples: multi wins(Scissors $, Paper $) { +1 }; # dispatch on types

my @a = 1..5; say [+] @a; # 15

(a,b,c) Z (1,2,3) # ((a,1),(b,2),(c,3))

my $time = now; say now - $time;

class Person does Employee { }

use NativeCall; # WOW

and MORE !

So ansering: why Perl6 hasn't taken off yet ? Becouse language specification was released 11 month ago with referential implementation (just like Amaya in 1996). So give it 2 years, it will be "fully operational" ;)

> So, floating point safesness is in R, dsl in ruby, concurency in Go and Unicode in... ? What if you want two features at once ? Or all of them ? ;)

I'm pretty sure you noticed this was exactly the questions my comment was addressing ;)

Oops, but noticied now :)
It's a welcome surprise to see an unreasonable and inflammatory post end with such a good piece of advice.

Needless to say the notion that python and ruby programmers are greybeards who need to "die off" to make way for the future of software development is not a rational assessment of the state of the industry.

Of course, it's not. But as a developer who doesn't use those two languages my only point of contact with them is via those greybears who tarnish the image of the entire lot ;)
Like Larry Wall?