Live data from Hacker News

Unusual Raku Features

buttondown.com

21–30 of 166 posts

Re: Unusual Raku Features

#21
post #10

Earlier quoted context omitted.

The detecting of increments has been in Perl6 for ages so that's not new. [edit Perl6 not Perl) I guess (apart from the Whatever), the laziness is new since Perl6/Raku.

> The detecting of increments has been in Perl for ages so that's not new. But this is detecting that the increment is multiplicative, rather than additive. It might seem like a natural next step, but, for example, I somewhat suspect (and definitely hope) that Raku wouldn't know that `(1, 1, 2...*)` is a (shifted) list of Fibonacci numbers.

Ah, I missed that. Nevertheless it's been in Perl6 for a while!

You're safe WRT Fibonacci.

> Unable to deduce arithmetic or geometric sequence from: 1,1,2

Re: Unusual Raku Features

#22
Some of these are halfway familiar. Hyper sounds like a more ad-hoc version of something from recursion-schemes, and * as presented is somewhat similar to Scala _ (which I love for lambdas and think every language should adopt something similar).

Re: Unusual Raku Features

#23
post #8

It is absolutely mindbending to me that all of this language development has happened on top of Perl, of all things.

> It is absolutely mindbending to me that all of this language development has happened on top of Perl, of all things. Why "of all things?" The Perl philosophy of TIMTOWTDI, and Wall's interest in human-language constructs and the ways that they could influence programming-language constructs, seem to make its successor an obvious home for experiments like this.

Indeed! There's lots of magic even in Perl4, some of it obscure.

Re: Unusual Raku Features

#24

# Does weird things with nested lists too > [1, [2, 3], 4, 5] > [10, 20] [11 [22 23] 14 25] This article makes me feel like I'm watching a Nao Geo/Animal Planet documentary. Beautiful and interesting to see these creatures in the wild? Absolutely. Do I want to keep my distance? As far away as possible.

National Geographic for the uninitiated.

https://en.m.wikipedia.org/wiki/National_Geographic

https://www.nationalgeographic.com/magazine

Re: Unusual Raku Features

#25
I use Raku in production. It's the best language to deal with text because building parsers so so damn nice. I'm shocked this isn't the top language to create an LLM text pipeline.

Re: Unusual Raku Features

#26

# Does weird things with nested lists too > [1, [2, 3], 4, 5] > [10, 20] [11 [22 23] 14 25] This article makes me feel like I'm watching a Nao Geo/Animal Planet documentary. Beautiful and interesting to see these creatures in the wild? Absolutely. Do I want to keep my distance? As far away as possible.

You're making a mistake if you're thinking like that. Applying an operation that generally works on single values over a list of values automatically is an incredibly powerful technique. If you have ever used Numpy, you will appreciate not needing it in many cases where Raku's built-ins suffice.

Re: Unusual Raku Features

#27

# Does weird things with nested lists too > [1, [2, 3], 4, 5] > [10, 20] [11 [22 23] 14 25] This article makes me feel like I'm watching a Nao Geo/Animal Planet documentary. Beautiful and interesting to see these creatures in the wild? Absolutely. Do I want to keep my distance? As far away as possible.

Looks more like an advanced Monkey Island puzzle to me.

Re: Unusual Raku Features

#28

> (2, 30, 4, 50).map(* + *) returns (32, 45) Should it be `returns (32, 54)` ? i.e. 4+50 for the 2nd term. Maybe this is a consequence (head translation) of some countries saying e.g. vierenvijftig (four and fifty) instead of the English fifty-four.

checked in rakudo, it does return (32 54), author fingers slipped

[flagged]

Re: Unusual Raku Features

#30

# Does weird things with nested lists too > [1, [2, 3], 4, 5] > [10, 20] [11 [22 23] 14 25] This article makes me feel like I'm watching a Nao Geo/Animal Planet documentary. Beautiful and interesting to see these creatures in the wild? Absolutely. Do I want to keep my distance? As far away as possible.

You're making a mistake if you're thinking like that. Applying an operation that generally works on single values over a list of values automatically is an incredibly powerful technique. If you have ever used Numpy, you will appreciate not needing it in many cases where Raku's built-ins suffice.

You're right. It makes way more sense when you compare it to Numpy.
Post reply on HN