Live data from Hacker News

Unusual Raku Features

buttondown.com

161–166 of 166 posts

Re: Unusual Raku Features

#161

Earlier quoted context omitted.

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.

If you can read Lisp (Scheme) syntax, I think SICP [0] has the clearest demonstration of the utility of lazy streams. The problem it presents (calculating pi) is, admittedly, rather academic; but the concept of having values that evolve over "time" as first-class entities that you can abstract over is practically useful. I think that all of reactive programming (React, Angular, etc) is closely related to this idea (p…

I hadn't realized that SICP covered using lazy streams for calculating pi. That reminds me of this article I read recently about using lazy lists in Haskell to calculate pi by means of a few different algorithms.

https://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/s...

Re: Unusual Raku Features

#162
post #143
post #68

Earlier quoted context omitted.

"Actual parsers" aren't powerful enough to be used to parse Raku. Raku regular expressions combined with grammars are far more powerful, and if written well, easier to understand than any "actual parser". In order to parse Raku with an "actual parser" it would have to allow you to add and remove things from it as it is parsing. Raku's "parser" does this by subclassing the current grammar adding or removing them in th…

Why are they called regular expressions if they can parse non-regular languages?

It’s gradually got so. https://youtu.be/JIlpjJnc6qY?t=54>

Literally, Larry Wall was adding things to regexes all the way back before the release of Perl 2.

Re: Unusual Raku Features

#163
post #159

Earlier quoted context omitted.

The thing is you can chose to write perl in a way that doesn't suck. The problem with TMTOWTDI is that with 18 people in a code base.... well its best to have a set of conventions when writing perl. Let's all agree to use 5.x.x with these features for example

These days you can TMTOWTDI in Python as well though. The TMTOWTDI argument was valid in very early stages of Perl vs Python debate, like some what between 2000 - 2006 etc. These days Python is just Perl with mandatory tab indentation. Python is no longer that small language, with small set of syntactical features. C++/Java etc in the meanwhile have gotten even more TMTOWTDI heavy over the years.

I don't really work with python often enough but as for php there's usually one boring way to do it. We eschew generally more fun stuff like array operations because for loops work and the intent is vlear

Re: Unusual Raku Features

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

Do you use any of Raku's LLM packages? If yes, which ones?

I have not used any. What are some good ones to look at?

Re: Unusual Raku Features

#166
post #144

I don't understand why we want to use some language feature like Junctions, instead of using lists explicitly?

I don't understand why we want to use some language feature like loops, instead of using conditional gotos explicitly. Sure, we can do the same thing with the goto... but why would we want to use the more difficult/annoying alternative when the convenient one exists?

I disagree. When I see a loop, I know that there is a loop. But now, with Junctions, I have to assume that every variable I see could potentially be a nondeterministic choice between many values? Does that make writing (or reading) programs easier?
Post reply on HN