Live data from Hacker News

Raku: A language for gremlins

buttondown.email

201–210 of 257 posts

Re: Raku: A language for gremlins

#201

Earlier quoted context omitted.

In this chart, sure. Not like, the same dot, but both in that quadrant. But those are my personal opinions, as I find both difficult to read yet very expressive. YMMV.

Interesting. I haven't heard anyone complain that Rust is harder to read than the average language, just stuff about writing it.

Having never written anything in Rust but read and “translated” some code (maybe 3k LOC?) from Rust to Ada, I can tell that I found Rust rather hard to read and harder than e.g. Ruby (which I also do not know how to write but translated to Java once).

Here is what I guess makes it hard to read for me: There are many terse keywords (fn, mut) and symbols (&, [], ->) along with some things that look like Java annotations and are equally hard to understand without knowing the language. Array slices look easy enough to understand [a..b] but surprise: b is actually exclusive? The definition of arrays is the most weird one I have ever encountered [u8; n]. To me Rust looks much like C++ with a twist and people rightfully complain about C++ often :)

The documentation about language and libraries was solid for my cases and most of the time it seemed enough to ignore most of the tiny key words and symbols without losing much understanding of what the code intends to do. If I were given the choice I'd probably still prefer Rust's weird syntax with added safety over the clarity of C which offers no safety at all (not talking about obfuscated code contests here).

Re: Raku: A language for gremlins

#202
post #6

When I was looking at the language, I didn't find the documentation "really poor". In fact I was impressed at how much of a one-stop-shop the official docs site was for both conceptual docs and API docs. https://docs.raku.org/ Look at the following page as a jumping off point for conceptual stuff. Absolutely top class: https://docs.raku.org/language

As someone who has been doing Raku for several years now, I will say the documentation is both great and also lacking. Most of what's there is well written and includes useful example code, but I occasionally run across things that either haven't been documented at all or have only been documented for simple cases.

The worst offender in my experience is the module system. There are docs around it, but they would benefit from a rewrite with a less "technical" audience in mind. The module/package distinction is difficult to wrap your head around just from reading the Modules page. The fact that the declared namespace of what you import can be different from the namespace you used to import, but the directory structure has to match the namespace for the compiler to find it... it's useful and makes sense in a strange way, but I had to learn that by fiddling around.

  # in Name/Space/Thing.rakumod
  unit class Thing { … }

  # in UseCode.rakumod
  use Name::Space::Thing;
  my Thing $thing .= new: …;

Re: Raku: A language for gremlins

#203

Earlier quoted context omitted.

Not everything has to be super easy-to-use.

Nobody is suggesting super easy to use. But sometimes interfaces could be easier with no loss of ability, because they grew over time and nobody ever fixed them.

It is terse for a reason. You're ordering a parser around in 10 characters. Which makes them fit everywhere! A longer more readable version starts taking up multiple lines and looking like shitty react code. Or you're just using your language's string primitives. But there is a reason that nobody does that any more -- who wants to read 50 lines of string parsing code when a couple dozen characters of regex will do the same thing?

Let us wizards have our magic!

Re: Raku: A language for gremlins

#204

One way you might arranging programming languages in a 2D space is with two axes: 1. How much should the language surprise you? 2. When the language does surprise you, should it delight you or horrify you? surprising ^ | | | delight horrify | | | v unsurprising Only a sadist would deliberately design a language for the top right quadrant, but there are many esoteric languages in there. I think most people tacitly ass…

Raku looks very horrifying if you want to actually do anything practical.

But that's some incredibly clever stuff! I wouldn't want to use it, for like, anything, but if there was a programming based game or code golf contest or something it would probably be a great choice.

And the original article talks about math, and I have no real experience actually doing nontrivial math IRL, so perhaps it has some useful properties for people who do.

Re: Raku: A language for gremlins

#205

Earlier quoted context omitted.

Nobody is suggesting super easy to use. But sometimes interfaces could be easier with no loss of ability, because they grew over time and nobody ever fixed them.

It is terse for a reason. You're ordering a parser around in 10 characters. Which makes them fit everywhere! A longer more readable version starts taking up multiple lines and looking like shitty react code. Or you're just using your language's string primitives. But there is a reason that nobody does that any more -- who wants to read 50 lines of string parsing code when a couple dozen characters of regex will do th…

The particular syntax being used an example is more verbose than it needs to be, so I don't know why you're making this argument.

Re: Raku: A language for gremlins

#206

Earlier quoted context omitted.

Interesting. I haven't heard anyone complain that Rust is harder to read than the average language, just stuff about writing it.

Having never written anything in Rust but read and “translated” some code (maybe 3k LOC?) from Rust to Ada, I can tell that I found Rust rather hard to read and harder than e.g. Ruby (which I also do not know how to write but translated to Java once). Here is what I guess makes it hard to read for me: There are many terse keywords (fn, mut) and symbols (&, [], ->) along with some things that look like Java annotation…

> To me Rust looks much like C++ with a twist and people rightfully complain about C++ often :)

But would you put C++ next to Perl in terms of difficulty reading? I wouldn't have thought they were particularly close. (In terms of normal code at least, not the implementations of ultra-generic templates.)

Re: Raku: A language for gremlins

#207
post #86

Earlier quoted context omitted.

Do you want it to take the first match? Inputting a unique prefix doesn't sound practical.

I thought about that. I thought the compiler could error with "Insufficient data for meaningful answer" until you'd added enough digits that the sequence was unambiguous. Then I tried it in OEIS and as you say there are too many sequences that start [1,2,3,4,5,...] - I think we may be stuck with generators and yield. But they're not exactly delightful.

you could special-case arithmetic sequences

Re: Raku: A language for gremlins

#208
post #86

Earlier quoted context omitted.

I thought about that. I thought the compiler could error with "Insufficient data for meaningful answer" until you'd added enough digits that the sequence was unambiguous. Then I tried it in OEIS and as you say there are too many sequences that start [1,2,3,4,5,...] - I think we may be stuck with generators and yield. But they're not exactly delightful.

> "Insufficient data for meaningful answer" Nice reference, by the way.

oh fuck, i missed that

Re: Raku: A language for gremlins

#210
There were so many claims in the first couple of years after Perl6/Raku's initial release in December 2015 about how it had the potential to be optimised due to its superior design but here we are nearly 8 years later and it's still takes 10 times as long as Perl 5 to parse a log file with a regex.
Post reply on HN