elcaro
2026 M05 28, Thu 17:27:46
Ahh, the month of M05
Some of the knowledge you acquire from one array lang can translate to the others, but the semantics are not 1:1 (ie. J is not just ASCII APL).
As it currently stands, I dabble in almost all the array langs, but of the ones I use, I think best in J. It's got a lot of convenience in it's large set of primitives, and there's no "indirection" between the character you want, and the one you type. Still, it's not without it's shortcomings.
I think I would probably still recommend BQN to most people looking to get into array programming, as it removes some warts in APL/J.
You lose some convenience functions (base conversion, fixed-point, etc) but you get a language which is more uniform and intuitive. And FWIW, I had the keymaps learned within the first day I started to play with it.
It's still a learning curve regardless of which lang you learn, but it will change how you think.
~:"1/~&.#:i.2^8
See it here: https://jsoftware.github.io/j-playground/bin/html2/#base64=b...These days I'm using the Panorama Tab Groups [1] extension, which provide a practically identical experience the the old built in Panorama.
[1] https://addons.mozilla.org/en-GB/firefox/addon/panorama-tab-...
F =: >@{.@(\: #@>)@(#~ (2 >: +/@e.&'aeoiu')@>)
which I think maybe composes a little better
This doesn't include the splitting. I would imagine I would be feeding this function from a boxed list from a word list, like: F 'b' fread 'dict.txt'
Also `;:` is unreliable on hyphenated words, etc. Better to use `cut`.
Raku's Str type has a `.chars` method that counts graphemes. It has a separate `.codes` method to count codepoints. It also can do O(1) string indexing at the grapheme level.
That Zalgo "word" example is counted as 4 chars, and the different comparisons of "Å" are all True in Raku.
You can argue about the merits of it's approach (indeed several commenters here disagree that graphemes are the "one true way" to count characters), but it feels lacking to not at least _mention_ Raku when talking about how different programming languages handle Unicode.
> "Produce" is a term I've never seen used this way before, and I assume it is unique to Raku.
More commonly referred to in the functional languages as a `scan`, but yes, it seems that `produce` might be unique to Raku. I've not seen `accumulate` outside of Python, but there's a lot of langs so who knows.code_report (Conor Hoekstra) has discussed the difference names of `scan` on a couple occasions, eg: https://twitter.com/code_report/status/1246494250537291776
Connor has declared a fondness of APL's where fold and scan show a clear visual relation: `/` & `\`. I suspect Raku was shooting for something similar with it's choices:
[f] list # or list.reduce(f)
[\f] list # or list.produce(f)
All new features must now go through an experimental phase after the smartmatch debacle. Signatures stayed in experimental status a little longer than most new features due to an unfortunate change with respect the order of function signatures and function prototypes. Provided you weren't using prototypes (which you almost never need) then they've been largely stable since 2015.
Most distro's under current support ship with at least Perl 5.24, so you can use them almost anywhere.
[0] > "\c[FACE PALM]".chars
1
[1] > "\c[FACE PALM]".codes
1
[2] > "\c[FACE PALM]".encode.bytes
4
[3] > "\c[FACE PALM]".encode
utf8:0x<F0 9F A4 A6>
[4] > "\c[FACE PALM]".encode('utf-16')
utf16:0x<D83E DD26>
FWIW, to get the "length" of an array, the method is `.elems`. > Personally I think this kind of computer-control is the perfect environment for teaching computing. Rather than writing apps or webapps, I feel like the idea of just writing code to do what you the user would do anyways, but better, is a fantastic introduction to computing & programming.
AHK is how I got into programming. I started with a few hotstrings, slowly added more functionality, a GUI, etc. While writing a specific tool, I learned about ReGex, and would often refer to the RegEx table in the AHK docs.Eventually, I attempted to write a tools to audit network device config with AHK, and a colleague said "why don't you write it in Perl". In looking up Perl, I learned about Python and kinda them at the same time (though interestingly, I still prefer Perl to this day). I also never realised RegEx was a thing people struggled with because I learned it almost immediately after getting into "programming", so I was just part of the learning process.
All in all, I credit AHK with getting me into coding.
function setup() {
createCanvas(640, 480)
}
function draw() {
background(0, 100, 200)
strokeWeight(100)
stroke(200, 200, 0)
line(0, 0, 640, 480)
}
There's an online editor so pre-teens (or indeed post-teens) can get started right away (https://editor.p5js.org) but I'll admit there's still quite a hurdle if you want to host yourself, or run offline.And while I agree that [closed, open) intervals are often the best choice... sometimes what you want is [closed, closed], or (open, open), and it's nice to use a language that makes that easy.
For example, Raku makes it easy to do:
[closed, closed] with ($a .. $b)
[closed, open) with ($a ..^ $b)
(open, open) with ($a ^..^ $b)
(open, closed] with ($a ^.. $b)https://old.reddit.com/r/programming/comments/z18gb6/comment...
> right from the beginning, the say turns me off, computers do not speak
This seems a bit of an odd argument. You've never heard the phrase "The sign says ...", or asked someone "What does the error message say?"That said, `say` is just a normal function, and you could always bind a new function and use that instead.
Not in the slightest. Python 3 made breaking changes to the CPython code base (yes that's a simplification). There's enough backwards incompatibility to consider them different languages, but I'd guess that there might still be bits and pieces of code that is identical (or largely unchanged) between the Python 2 and 3 implementations.
Raku - on the other hand - does not use any of the Perl code base; it's a completely different runtime written from the ground up.
say qx< cal -hy >.lines.skip.batch(9)
.map({ |([Z] .join.comb(22).batch(3)) })
.map({ |(.[2] ~ .[0].trim, |.[3 .. *]) })
.grep(*.trim.chars).join("\n")
.subst(/\s+ ^^ \s\s+ 1»/, ' 1', :g) say qx< cal -hy > # Command output as string
.lines.skip.join("\n").split(/\n\n+/) # Skip year & split groups
.map({ |([Z] .lines.join.comb(22).batch(3)) }) # Single column structure
.map({ |(.[2] ~ .[0].trim, |.[3 .. *]) }) # Month name on first row
.grep(*.trim.chars).join("\n") # Join non-blank lines
.subst(/\s+ ^^ \s\s+ 1»/, ' 1', :g) # Collapse weeks together
I was never going to beat APL... Though I imagine some clever Rakoons could probably find a few places where this can be golfed down.Raku passes all the tests. He mentions he didn't find any language that upper-cases "baffle" correctly but Raku does.
Here's my REPL test
> my $n = "noe\x[0308]l"
noël
> $n.chars
4
> $n.flip
lëon
> $n.substr(0, 3)
noë
> my $b = "baffle"
baffle
> $b.substr(2, 1).uniname
LATIN SMALL LIGATURE FFL
> $b.uc
BAFFLE
> "noe\x[0308]l" eq "no\x[00EB]l"
True
HN doesn't handle the cat emojis, so they are not included, but they worked fine.