Live data from Hacker News

Unusual Raku Features

buttondown.com

51–60 of 166 posts

Re: Unusual Raku Features

#51

Wow. Sign me up for leaving the industry before I ever have to maintain a Raku codebase.

Funny, cause reading that blog post made me want to quit my job and find a raku team to work with. Maybe I'm still too naive :)

Same. And it's a bit funny because I'm usually against unnecessary complexity, and here's a language that seems to have embraced it and become a giant castle of language features that I could spend weeks studying.

Maybe it's because Raku's features were actually well thought-out, unlike the incidental "doesn't actually buy me anything, just makes the code hard to deal with" complexity I have to deal at work day in and day out.

Maybe if Java had a few of these features back in the day people wouldn't've felt the need to construct these monstrous annotation soup frameworks in it.

Re: Unusual Raku Features

#52

# 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.

I agree. This attempt to fuse higher-order functional programming with magic special behaviors from Perl comes off to me as quixotic. HOP works because you're gluing together extremely simple primitives—ordinary pure functions. You can build big things fearlessly because you perfectly understand the simple bricks they're made of. But here: magic functions—which behave differently on lists-of-scalars vs. lists-of-list…

Doing High-Order Programming in perl is not something new.

There is a full book about it:

https://en.m.wikipedia.org/wiki/Higher-Order_Perl

Whats nee in Raku is putting them together with other experimental features as first class citizens

Re: Unusual Raku Features

#53
post #3

I’m not sure this page loaded properly for me, half of it is arbitrary punctuation characters assembled in bizarre nonsensical ways.

The greatest trick the Devil ever played was renaming Perl 6 to Raku.

This is a very funny comment given the context.

https://github.com/Raku/problem-solving/pull/89#pullrequestr...

A quote from the Christian Bible Luke 5:36,37

Re: Unusual Raku Features

#54

Earlier quoted context omitted.

very cohesive, [7] > (1,3,9...*)[4,5] (81 243) [8] > (1,3,9...*)[(1..3)] (3 9 27) and nestable [0] > (1,2,4...*)[(1,2,4...*)[1,2,3]]

These are all very clever, but what's the use case? I'm not saying there isn't one, I just don't know what it is! Not to speak of the dead, but Perl was utilitarian: it was built to solve problems. From my point of view, these are solutions to problems I've never had.

Here’s a nice article which uses this feature well (and several others) while computing e https://blogs.perl.org/users/damian_conway/2019/09/to-comput...>. An example:

    #| Dörrie's bounds
    assess -> \x=(1,10,100...10⁶) {
        ½ × sum (1 + x⁻¹)**(x),
                (1 + x⁻¹)**(x+1)
    }

Re: Unusual Raku Features

#55

Earlier quoted context omitted.

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

BUT WAIT! $ raku -e 'say (1, 1, *+* ... *)[0..10]' (1 1 2 3 5 8 13 21 34 55 89)

I… love it? It's so elegant it's infuriating.

Re: Unusual Raku Features

#56
post #52

Earlier quoted context omitted.

I agree. This attempt to fuse higher-order functional programming with magic special behaviors from Perl comes off to me as quixotic. HOP works because you're gluing together extremely simple primitives—ordinary pure functions. You can build big things fearlessly because you perfectly understand the simple bricks they're made of. But here: magic functions—which behave differently on lists-of-scalars vs. lists-of-list…

Doing High-Order Programming in perl is not something new. There is a full book about it: https://en.m.wikipedia.org/wiki/Higher-Order_Perl Whats nee in Raku is putting them together with other experimental features as first class citizens

[deleted]

Re: Unusual Raku Features

#58
post #36

Earlier quoted context omitted.

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.

My fundamental objection here it that it is recursive. The non-recursive hyperoperators all have nice clean mathematical definitions. The recursive ones are just weird and ad hoc, at least from the perpective of the underlying mathematical structures.

And if you try to avoid the ad-hoc-ness by formalizing each useful weird behavior as its own documented type with its own documented semantics for application, then you've just reinvented monads. (Which is not to say you shouldn't; IMHO stdlib support for monad types in a dynamic scripting language is long overdue.)

Re: Unusual Raku Features

#59
post #55

Earlier quoted context omitted.

BUT WAIT! $ raku -e 'say (1, 1, *+* ... *)[0..10]' (1 1 2 3 5 8 13 21 34 55 89)

I… love it? It's so elegant it's infuriating.

It also seems slowish, but seems the problem is the startup cost. So probably pretty smart?

The following shows fairly stable times.

> for i in $(seq 20); do time raku -e "say (1, 1, + ... *)[0..$i]"; done

Re: Unusual Raku Features

#60
post #44

Earlier quoted context omitted.

Same as Perl, nobody wants to maintain it, but it's extremely fun to write. It has a lot of expression. You can see that in Raku's ability to define keyword arguments with a shorthand (e.g. :global(:$g)' as well as assuming a value of 'True', so you can just call match(/foo/, :g) to get a global regex match). Perl has tons of this stuff too, all aimed at making the language quicker and more fun to write, but less rea…

its not that reading perl is hard, the _intent_ of the operations of often hard/unclear. Yes its nice to write dense fancy code, however, something very boring to write like PHP is a lot of "loop over this bucket and do something with the fish in the bucket, afterwards, take the bucket and throw it into the bucket pile" that mirrors a 'human follows these steps' type.

Frankly I'm on Team Fish Bucket.

I am not totally convinced--well, not at all convinced, really-- that the OOP revolution made programming code better, simpler, easier to follow, than procedural code.

I suppose the argument ended up being a philosophical discussion about where State was held in a running program (hard to tell in procedural code, perhaps, and easier to tell in OOP), but after 20+ years of Java I wonder if baby hadnt disappeared down the plughole with the bathwater.

Post reply on HN