Raku Programming Language

RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
RL_Dane,
@RL_Dane@fosstodon.org avatar

Lol, and folks, I made a funny (in bash!)

#!/usr/bin/env bash

CD - uses my ulocate script and fzf to jump to any directory found within my home directory

set -u undeclared variables as errors

function warn {
echo "$" >&2
}
function swoon { # (something in between a warn and a die ;)
warn "$
"
exit 0
}
function die {
warn "$*"
exit 1
}

RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
profoundlynerdy,
@profoundlynerdy@bitbang.social avatar

What are some underappreciated superpowers that and/or has EXCLUDING and ?

RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
cnx,
@cnx@larkspur.one avatar

TFW rewriting the clipboard manager from to saved 20 times of memory :blobfoxnotlikethis: The service does literally nothing most of the time waiting for an event and keeps all states in the file system and Rakudo still manages to eat up a whooping 168 MB of RAM :floofWoozy: I really like the language but its reference (and now also only) implementation’s performance (or lack thereof) really stops me from keep using it.

BTW, fun fact: if you chop a string in Raku and Perl then concatenate their results together you get the original one :ym_rofl:

RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
rakulang,
@rakulang@fosstodon.org avatar

@RogerBW

Solution to 1. with shortcutting:

sub uniqueoccurrences(@a) {
@a.repeated.head =:= Nil
}

https://docs.raku.org/type/Any#method_repeated

Also note that The Raku Programming Language uses the tag, to not interfere with the good people doing Raku pottery.

RogerBW,
@RogerBW@emacs.ch avatar

@rakulang Thanks, I'll tweak the tag for future posts. I tend not to use the sexier language features in favour of a portable polyglot approach (also because I find them hard to parse when I come back to the code later).

RogerBW,
@RogerBW@emacs.ch avatar
alchemistsstudio,
@alchemistsstudio@mstdn.social avatar

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.

A multi-coloured raku pottery vase with various shades of blues, pinks and purples.

RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
RogerBW,
@RogerBW@emacs.ch avatar
samebchase,
@samebchase@fantastic.earth avatar

I want to try out https://www.morling.dev/blog/one-billion-row-challenge/ in

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,
@lizmat@mastodon.social avatar

@samebchase

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,
@samebchase@fantastic.earth avatar

@lizmat Let me try this out.

For comparision with single threaded wc -l i mplementation:

  1. Go takes 23 seconds.
  2. Common Lisp (SBCL) takes 70 seconds.

CL => 3x Go
Raku => 10x CL

The Nil while read thing that you've given runs in 20 seconds.

The race and atomic increment thing, I killed it after 3 mins.

mjgardner,
@mjgardner@social.sdf.org avatar

@Perl Per @PerlRakuFoundation's announcement yesterday,* The & 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 track with its own process: https://science.PerlCommunity.org

ology,
@ology@fosstodon.org avatar

@mjgardner @Perl @PerlRakuFoundation Woo! I just submitted two: {Beginning,Advanced} Algorithmic Music with Perl - Thanks for announcing! :D

VZ,
@VZ@fosstodon.org avatar

I really like , in theory, and would like to use it more, but whenever I have something to write, I still often end up with using 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,
@mjgardner@social.sdf.org avatar

@VZ’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?’

’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,
@mjgardner@social.sdf.org avatar

@VZ @leonerd IMHO is great but it’s also a classic case of Fred Brooks’ “second-system effect”: https://archive.org/details/mythicalmanmonth00broo/page/53

RogerBW,
@RogerBW@emacs.ch avatar
Greguti,

J'ai réalisé un en terre cuite et puis je l'ai cui en et puis j'ai mis des émaux dessus et puis je l'ai cui en cuisson . 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.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • raku
  • ngwrru68w68
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • megavids
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • provamag3
  • JUstTest
  • All magazines