Live data from Hacker News

Raku: A language for gremlins

buttondown.email

141–150 of 257 posts

Re: Raku: A language for gremlins

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

>Look at the following page as a jumping off point for conceptual stuff. Absolutely top class:

>https://docs.raku.org/language

Thanks for that.

Re: Raku: A language for gremlins

#142

Earlier quoted context omitted.

Do you think many people would put Rust and Perl next to each other?

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.

Re: Raku: A language for gremlins

#143
post #17

Earlier quoted context omitted.

The problem is those are subjective axes. And things can both delight and horrify; I wrote some javascript once where I did document.write = function ... which is kind of delightful in that I was able to do what I needed as a result, but also pretty horrifying :) Other people I showed it to felt it was more on the horrifying side, but like I said, it's subjective.

This is true. Often times it's simple, stuff I wrote: delightful. stuff other people wrote: horrifying.

This was early Perl code for me (early 2000s). Write once; read never. Once you and your teammates developed some discipline, it got much better.

Re: Raku: A language for gremlins

#144
Cool article.

> This isn't weird, lots of languages have multiple dispatch. What is weird is that you can also dispatch based on a runtime predicate of the value.

Is it wrong to think of the predicate itself as a type here?

Re: Raku: A language for gremlins

#145

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.

Some of the dewrapping constructs can get a bit gnarly looking when there is something wrapped in a wrapper in a wrapper sort of thing. But it's probably largely author-dependant and you could write the same code more readably.

Re: Raku: A language for gremlins

#146

Earlier quoted context omitted.

I mean, it was "Perl 6" so is it really surprising that Perl devs wanted a language that looks nothing like any other language? Perl has it's own healthy share of "delightful surprises" and Raku was mostly designed to eliminate perl's horrifying surprises.

Apparently by replacing them with new horrifying surprises, if this article is any indication. Good grief, I don't miss working in Perl.

Some of the Raku people think that showing of the most bizarre parts of the language makes it look good for some weird reason.

Re: Raku: A language for gremlins

#147
post #105

Isn't this still the usual critique of a language before knowing much about the language? We were used to this with Perl's "line noise". Now we get > Raku has no qualms about using Unicode operators. You have the option. I have used this option because I want my code to be compact and expressive on screen. A good fit for careful, considered, creative unicode usage. Or the ever popular (Jeez that's new): > I hate the…

How do you type the non-ASCII operators? Special keyboard layout? Your editor automatically converting some sequences? Raw Unicode escapes? This seems complicated pointless to me just to save a couple characters.

Input method: I see this as fundamentally a keyboard input method that needs to be resolved for your setup overall. Not a Raku issue. For now I'm settled on three alternate methods (under linux). The Compose key method, mostly for accented characters. The editor's code point method, in vim Ctrl-v u or U (but you need to know the unicode code point and I don't exactly have them memorized). Or copy and paste from some web character chart. Since this is programming and not texting emoji, I'd rather have a specific, chosen code point so I tend to use the editor's code point input. (But wait, that's not all, you need enough unicode support in your programming font - not very easy on linux.)

What's the point: Absolutely not saving typing. The point is to have a more visually distinctive notation. A math blackboard would be full of that. For example, in the code right in front of me I have a U+25C0 e2 97 80 BLACK LEFT-POINTING TRIANGLE as a custom infix operator for two specific data types. I could have overloaded an existing one... but no, the existing one still exists and it should be extra clear which one is used. When that code is in front of me, it's perfectly clear which is which. And now that the symbol is there in the code, it can just be copy-pasted. (For good measure, the unicode code point is specified in the operator's definition - but that's not necessary in day to day editing.)

Re: Raku: A language for gremlins

#148

My favorite feature of Raku: Integer division and decimal literals both return `Rat`, a rational fraction type. Even though everyone knows floats suck, nobody is actually moving away from them except Raku. If you want a float literal you specifically have to use scientific notation.

Raku contain so many cool things.

Yup, literally: https://docs.raku.org/type/Cool

Re: Raku: A language for gremlins

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

> "Insufficient data for meaningful answer"

Nice reference, by the way.

Re: Raku: A language for gremlins

#150

Earlier quoted context omitted.

Perl used to bandy about "TMTOWTDI" (Tim Towdy) incessantly in those days of Perl4/5. There's More Than One Way To Do It

Yes, and it even had a way to pronounce it, I'd read: timtowdy which I somehow did not like, but shrug. And then Python got on the bandywagon :) with: There should only be one, preferably obvious, way to do it or such, which, in later years, seems to be not bandied about as much.

I had the wording of the Python slogan slightly wrong, above, and also remembered where I had read it - in the Zen of Python. It is principle 13 there.

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

There should be one-- and preferably only one --obvious way to do it.

Post reply on HN