"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
https://docs.scala-lang.org/scala3/book/methods-main-methods...
151–160 of 257 posts
"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
https://docs.scala-lang.org/scala3/book/methods-main-methods...
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
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.
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.
"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
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).
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.
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.)
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.