profoundlynerdy,
RogerBW, The Weekly Challenge 260: Uniquely Rank #Perl #Raku #RustLang #Postscript #PerlWeeklyChallenge #BlogFiredrakeOrg https://blog.firedrake.org/archive/2024/03/The_Weekly_Challenge_260__Uniquely_Rank.html
alchemistsstudio, Yesterday I was daydreaming of spring and our gardens and these raku pottery pieces come to mind. What do these pieces remind you of?
Here's hoping my poor flower bulbs are not too confused (they started coming up in February.
#raku #pottery #handmade #MastoArt #art #spring
A multi-coloured raku pottery vase with various shades of blues, pinks and purples.
mjgardner, @Perl Per @PerlRakuFoundation's announcement yesterday,* The #Perl & #RakuLang Conference 2024 in Las Vegas is now accepting proposals for live in-person session talks! https://tprc.us/talks
Need ideas? That page also has previous conference schedules as well as a wiki link to request topics.
New this year: a peer-reviewed #science track with its own #CallForPapers process: https://science.PerlCommunity.org
ology, @mjgardner @Perl @PerlRakuFoundation Woo! I just submitted two: {Beginning,Advanced} Algorithmic Music with Perl - Thanks for announcing! :D
samebchase, I want to try out https://www.morling.dev/blog/one-billion-row-challenge/ in #rakulang
The baseline solution in Java clocks in just under 5 seconds, so with Raku what should be a decent timing for a closest translation of that. The optimized solutions are less than 2 seconds.
What is a good time to target?
lizmat, my atomicint $i;
$path.IO.lines.race(batch => 10000).map({ ++⚛$i });would be a better benchmark. This will at least parallelize the work (incrementing $i). But that still needs serial decoding.
How fast would this be:
my $h = open $path;
Nil while $h.read;that would be the lower bound.
You could .list.grep(10, :k) on each Blob, and use that to decode async (10 being "\n".ord).
Is that a plan?
samebchase, @lizmat Let me try this out.
For comparision with single threaded
wc -l
i mplementation:
- Go takes 23 seconds.
- Common Lisp (SBCL) takes 70 seconds.
CL => 3x Go
Raku => 10x CLThe
Nil while read
thing that you've given runs in 20 seconds.The race and atomic increment thing, I killed it after 3 mins.
VZ, I really like #rakulang, in theory, and would like to use it more, but whenever I have something to write, I still often end up with using #perl for it.
Just the latest example: I had to write a simple text-wrangling script that needed UUID generation. With Perl, I used App::Fatpacker to embed UUID::Tiny to make the script runnable just about anywhere without any extra dependencies, but there is nothing like that for Raku AFAIK and it just didn't seem worth it to do something more complicated.
18+ mjgardner, @VZ “#RakuLang’s design all came from the question, ‘What could I build if I could basically start again from scratch? What ideas might I have? How do I build a coherent whole from this blank canvas?’
“#Perl’s ongoing design is all rooted in, ‘What would I use right now in this real code I am writing today? What features would I like to have that I currently do not?’”
— @leonerd (https://x.com/cpan_pevans/status/1596972022952779782)
mjgardner, @VZ @leonerd IMHO #RakuLang is great but it’s also a classic case of Fred Brooks’ “second-system effect”: https://archive.org/details/mythicalmanmonth00broo/page/53
Greguti, J'ai réalisé un #hippopotame en terre cuite et puis je l'ai cui en #céramique et puis j'ai mis des émaux dessus et puis je l'ai cui en cuisson #raku. Le résultat est un mignon petit hippo qui est dans l'eau et dont seule la partie supérieure émerge, tête, dos, petite queue.
samebchase, Great post featuring #rakulang while trying to explain an algorithm using which we can do mental arithmetic to generate pseudorandom numbers.
https://www.hillelwayne.com/post/randomness/
I learnt a few tricks! 👌
goldstein, I solved this day of #AdventOfCode in #Rakulang, which still looks fun, until I try to actually write it and discover once again that basically every operation has some weird footguny semantics. nevertheless, I’m quite happy with the final result, which looks nice and concise.
https://github.com/GoldsteinE/aoc2023/blob/master/day13/code/main.raku
18+ goldstein, some random examples of weird footguny semantics in Raku:
my @arr = (2, 3);<br></br>reduce &[+], 1, @arr;<br></br>
is 3 (list gets reinterpreted as a scalar). you need to use
|@arr
for it to work.reduce &[(&)], ();<br></br>
(identity element for set intersection) is an empty set for some reason.
Set.new((1, 2), (3, 4)) (&) Set.new((3, 4), (5, 6))<br></br>
is an empty set (sets use comparison by identity, so all the lists are considered different).
set((1, 2), (3, 4))<br></br>
is a set of four numbers 1, 2, 3, 4,
set
flattens its arguments, whileSet.new
does not.sequences like
x...^y
and(x..^y).reverse
are either not actually lazy, or just really slow, not sure which one.
18+ samebchase, @goldstein Hmm, even in the official documentation it seems to require the
|
(slip) operator. https://docs.raku.org/routine/reduceCould any experienced Rakoon let us know why this is necessary?
opoku, I've completed "Pipe Maze" - Day 10 - Advent of Code 2023 #AdventOfCode https://adventofcode.com/2023/day/10
As I suspected, day 10 was a doozy (especially part 2). I've always had trouble with these enclosed spaces algorithms.
18+ jeff, @opoku Nice work! This seems like the proper approach. 👍
I was getting hung up on the adjacent pipes, and decided to just upscale the map 3X then flood fill.
masukomi, I've been asked to write an article for the #RakuLang advent calendar this year. I have a simple tutorial idea that I think will be good for beginners, and I swear to god I spent half the effing day yesterday fighting with ORM libraries and now I'm thinking "Fuck-it. I'll just write raw SQL."
Personally, I love SQL, but it feels kinda bullshit that that's where I ended up, and it's terrible for a beginner tutorial. Never-mind the fact that dramatically complicates the amount of code I'll need.
smokemachine, @masukomi yes, you are right, that’s the reason. I really need to find a way to fix that. But if you are not going to use Postgres (and you are going to use SQLite) you could install it with —force…
masukomi, @smokemachine a) thanks b) owing to time constraints I've gone off in another direction with what I'm working on, but I'll try that on the next personal project. Not really a fan of making a project for others when I have to tell them to force-install specific dependencies.
bocs, For the first day of #AdventOfCode living in UTC+0, I actually have to be up at stupid o'clock anyway. In the interests of speed, which I usually do not care about, given the opportunity I shall start day 1 in #perl in which the thing will take moments. I'll clean it up into #raku because, well, one ought to. I'll then start again in #Julia because that's what I want to learn this time around.
I see a lot of exotic things, or rust, or R. Where's my perl tribesfolk?!
mjgardner, @bocs I’m in the #Perl tribe but wasn’t going to participate in #AdventOfCode. Should I?
sjn, I just submitted a talk to the #Perl and #RakuLang track at #FOSDEM. Deadline for submission is tomorrow (Friday Dec 1st), and it's not too late to share! 😄
WGAvanDijk, TPRF (The Perl and Raku Foundation) is organising a Raku & perl devroom at FOSDEM. Sadly, no booth for Raku & Perl. Still, plenty of interesting stands.
https://fosdem.org/2024/news/2023-11-20-accepted-stands-fosdem-2024/
CIAvash, If you're looking for a more powerful tool(and regex) than #grep, #ripgrep, …, then rak is the answer
#rak #RakuLang #CLI #LibreSoftware
App::Rak - 21st century grep / find / ack / ag / rg on steroids
https://raku.land/zef:lizmat/App::Rak
masukomi, Just realized it's #Hacktoberfest If you're looking for a small task to help with this month maybe check out one of these:
#ChickenScheme
a tiny command line widget to show your progress through the day.
https://github.com/masukomi/days_progress#RakuLang
a library for making pretty tables on the command line.
https://github.com/masukomi/Prettier-Tablea library for making bar charts
https://github.com/masukomi/Terminal-Graphing-BarChartCLI time tracking (many "good first issue" issues)
https://github.com/masukomi/hey_3
masukomi, Side note re these and all of my other repos: contributions from newb coders, and coders who are just new to the language are 100% welcome.
masukomi, (edited ) As I continue to use my CLI time tracking app, I find myself thankful that #RakuLang makes it so easy to make sentence-like command interactions.
At the same time, I'm finding that I want to support more ways to say the same thing. I.e. other sentence structures and ordering that convey the same details.
Fortunately #RakuLang has great built-in support for custom grammars, AND this would be nice limited-scope thing to learn how with.
UNfortunately i just haven't the time to dive into that 😿
dachary, @masukomi Vacation has arrived! Maybe something to fiddle with?
masukomi, @dachary to many projects! ;)
RogerBW, The Weekly Challenge 235: One, Zero #Perl #Raku #Rust #Postscript #PerlWeeklyChallenge #BlogFiredrakeOrg https://blog.firedrake.org/archive/2023/09/The_Weekly_Challenge_235__One__Zero.html
xfix,
RogerBW, @xfix Thanks; I tend to write Perl-style if it still works in Raku. Gradually fixing this.
RogerBW, #Raku #RakuLang people: I have a class which must be initialised before use, but that initialisation is more complex than simply setting field values. I can do this right now with
my $foo = MyClass.new; $foo.init(stuff);
but I find that ugly. I haven't found any examples of anew
method that will do the standard object setup and then run my initialisation code on this new instance of it. Is this a thing? Pointers welcome.
lizmat, I think https://docs.raku.org/language/classtut#TWEAK is what you're looking for
alchemistsstudio, 🌎Embrace equinox with some art🌍
This ceramic globe and earth themed raku fired vase capture the essence of change, much like our seasons!
Please follow along to see more clay transformations and let me know what you think of these pieces in the comments!
Happy equinox!
#FallEquinox #equinox #pottery #raku #ceramics #rakupottery #art #MastoArt #earth #EarthArt #MastodonArt #introduction
A raku fired vase with the continents of earth depicted and blue water.
massa, #PerlWeeklyChallenge 235/01:
#RakuLangYou are given an array of integers.
Write a script to find out if removing ONLY one integer makes it strictly increasing order.
my answer:
sub remove-one(@_@hachyderm.io) { (^+@_@hachyderm.io).map({[<] @_@hachyderm.io[|(^$_), |($_+1 ..^ +@_@hachyderm.io)]}).any.so }
massa, Portuguese
massa, Portuguese @duran é meu arroz-com-feijão, né? então ... mas agradeço a admiração 😉
baffled,
sjn, #RakuLang and #Perl are the 35mm focal length of #Programming languages. Only one of them is O(fun), though. 😁
mjgardner, @nichartley Other R... languages: REXX, Ring, Ruby
sjn, @mjgardner @leonerd This was a well-thought perspective; Thanks for sharing!
Though with my post, I'm trying to illuminate another something in common between #RakuLang and #Perl, which I found the video above made a point of in a really nice manner.
Namely that the focus on TIMTOWTDI in these – which by some people is perceived as a detriment – in fact is one of their greatest strengths.
With this said, take another look at the video, from the 2m15s mark and onward... What do you think?
nobodyinperson, Can we please have an alias 'but' for the 'and' binary operator in programming languages?
if outside and moving_slowly ⇒ if outside but moving_slowly
if online and not connected ⇒ if online but not connectedSuch semantics made :perl: #Perl a bliss to write in some cases (if not ⇒ unless), although Perl doesn't have this 'but' alias. Probably #rakuLang can change itself at runtime to add this alias 😅
nobodyinperson, @mjgardner Luckily I didn't write or publish anything serious in #Perl, let alone something that someone else would review. It was just one of my first programming languages to learn and I really liked these 'unless' and 'until' keywords because I think they make certain cases much more readable. But okay, if that's considered bad practice, oh well 🤷
mjgardner, @nobodyinperson Oh yes,
unless
anduntil
definitely make simple negative conditions read like English. I use them in tiny #Perl snippets sometimes: https://social.sdf.org/@mjgardner/111067530338170318
jbzfn,