Recent submissions

Comment · 3 months ago
Comment · 5 months ago
% biff

2026 M05 28, Thu 17:27:46

Ahh, the month of M05

Comment · 9 months ago
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.
Comment · 1 year ago
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.
Comment · 1 year ago
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.

Comment · 1 year ago
Comment · 2 years ago
Comment · 2 years ago
Comment · 2 years ago
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`.

Comment · 3 years ago
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.

Comment · 3 years ago
I went looking for a web browser!
Comment · 3 years ago
Comment · 3 years ago
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.

Comment · 3 years ago
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`.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton