Live data from Hacker News

Raku: A language for gremlins

buttondown.email

151–160 of 257 posts

Re: Raku: A language for gremlins

#151

"If you define a MAIN function, any parameters you give it will be automatically turned into CLI flags." This is actually cool

What other languages do this? I love it

Scala 3 does it too

https://docs.scala-lang.org/scala3/book/methods-main-methods...

Re: Raku: A language for gremlins

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

That's due to the Perl culture. Their FAQs and man pages were top class due to the kind of programmers who write Perl; funny, pithy and quirky.

Re: Raku: A language for gremlins

#154

Earlier quoted context omitted.

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.

I think that this is the crux of the story for raku ... if you want you language to apply a standard discipline, then use Python: if you are happy with your team developing a dialect that balances usability with discipline, then try Raku

Re: Raku: A language for gremlins

#156
post #72
post #45

Earlier quoted context omitted.

That’s exactly what you want in a language. It should always feel like cheating! Also debuggers. Give RR a try some time :)

Every time I try it, it doesn't seem to work right. Because I don't feel like debugging my debugger, I just go back to gdb. Yet I only hear other people speaking of it positively, so it seems they don't have that experience.

FWIW I had bad experiences with rr shipped with Ubuntu LTS. I build rr from source, it's relatively easy to do.

Re: Raku: A language for gremlins

#157

"If you define a MAIN function, any parameters you give it will be automatically turned into CLI flags." This is actually cool

What other languages do this? I love it

nushell

https://www.nushell.sh/book/modules.html#main

https://www.nushell.sh/book/custom_commands.html#flags

Re: Raku: A language for gremlins

#158

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…

I found about raku one time I had an assignment for college where I needed to create a parser. I found raku's grammar features really interesting and used it for my project, it felt almost like cheating since it did pretty much every thing for me (actually it was probably just cheating but it was still fun).

> it felt almost like cheating since it did pretty much every thing for me

During my undergrad I implemented a semester-long physics project in about 30 minutes. The supervisor had previously taught the Programming in C module, so I asked if I had to use C; he said I didn't, so I used numpy. The code was literally just repeated matrix multiplication.

Re: Raku: A language for gremlins

#159

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.

It's actually an awful misfeature, because those Rats will automatically turn into floats when the rational representation gets too big: > WHAT 1/10 (Rat) > WHAT 1/100000000000000000000 (Num) (There is FatRat, which does not so 'promote', but it is not the default.)

I disagree that graceful degradation from Rat to Num (ie double) when Real numbers over- or under-flow is a misfeature.

We could (and have) debate whether FatRat should be the default, but imo the right expectation for an untyped language should be that very large or small numbers are represented with a floating point representation that (i) uses the FPU that's right there and (ii) sacrifices precision in the mantissa for accuracy.

Since Raku has (gradual) types, you can easily specify what you want and throw an error.

Post reply on HN