Similar article I read 10 years ago that covers some of the same ground, with some pretty SVG's as well.
HN user
elcaro
% biff
2026 M05 28, Thu 17:27:46
Ahh, the month of M05
I also use this one everyday. I learned the quick one back in the day, but I value never ever having to stop and re-tie my laces.
Under the "Countries Visited" section it says "been lucky to run on all seven continents, including antarctica!", but it doesn't look like they've been to Australia.
Answering for myself, I started looking into APL, but at the time, learning the keymaps for the symbols seemed difficult, so I started learning array lang techniques with J, and ended up liking it.
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.
I wa recently playing with this pattern in J, where it can be expressed like so
~:"1/~&.#:i.2^8
See it here: https://jsoftware.github.io/j-playground/bin/html2/#base64=b...First thing I thought of
I was also a big fan of the Panorama feature that used to be built in.
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-...
FWIW, I solved this in J as follows
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`.
Another Unicode article that mentions Swift, but not Raku :(
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.
I went looking for a web browser!
> "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)
I know cygx already replied, but to be clear, function signatures have been available in Perl since 2015. They were added (as experimental) in 5.20, and are now enabled by default with `use v5.36` or later.
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.
This is exactly what Raku does. Neither strings nor arrays have a `.length` method because it's arbitrary.
[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.
The closest thing these days is probably p5js (Processing in JS).
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.I'll repeat the sentiment that "always" and "never" rules usually have their fair share of exception.
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)Discussion of the ligature issue (and a screenshot) in the Reddit post comments.
https://old.reddit.com/r/programming/comments/z18gb6/comment...
One potential use case could be in creating bindings for other languages that do not have an expect like module. Since it reportedly has a "saner interface than libexpect", it might be less hassle creating FFI bindings to mini-expect.
> 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.
isn't it more like Python 3
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.
The first operation where I split to lines, then join, then split again... was annoying me. So now I've got this
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)Just for fun, I tried it in Raku.
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 also has a specific string type (Str) that is not just a bag of bytes. Strings are normalized (NFC) when they are created, and multi-codepoint graphemes are represented internally using synthetic codepoints (negative integers), but this is all opaque to the user. This also means that string indexing in Raku is O(1).
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.