Skip to content

Instantly share code, notes, and snippets.

@raiph
raiph / .md
Last active April 20, 2023 16:00
Raku's "core"
View .md

Then mathematical neatness became a goal and led to pruning some features from the core of the language.

— John McCarthy, History of Lisp

If you prefer programming languages with a tidy and tiny core, you're in for a treat. This article drills down to the singleton primitive at the heart of Raku's metamodel ("model of a model") of a model of computation ("how units of computations, memories, and communications are organized")1.

The reason I've written this article

It began with u/faiface's reddit post/thread "I'm impressed with Raku"2. One of their sentences in particular stood out for me:

@raiph
raiph / .md
Created March 2, 2023 14:31
Rebuttal of "Message passing to shared stateful objects/actors/processes is still a form of shared state."
View .md

Message passing to shared stateful objects/actors/processes is still a form of shared state. You cannot "replace shared state with message passing".

(from http://lambda-the-ultimate.org/node/5504#comment-95421)

My understanding is that this is a profound misunderstanding of the actor model.

My understanding is that the actor model involves zero shared state. (That is, zero shared state between actors. An actor may or may not also not share state temporarily within itself (where itself is its current behavior), or temporally, between incarnations of itself (cf "Sussman and Steele ... concluded Actors were essentially closures that never return but instead invoke a continuation" from The History of Scheme" paper).)

The closest I currently see to anything that could be thought of as "state", but is not if you think about it, is an "address" that is rationally presumed to be the "mailbox" of some actor, or a "message" that is rationally presumed to encode some information. In reality neither is "state" bu

@raiph
raiph / .md
Created December 11, 2022 13:20
ChatGPT answer on StackOverflow to a Raku question (that of course wasted everyone's time, even if it was easy to spot)
View .md

To pipe in a string to a Raku program, you can use the echo command to output the string and pipe it to the Raku program. For example, if your Raku program is called my_program.raku, you can use the following command:

echo "my string" | raku my_program.raku

Alternatively, you can pass the string as an argument to the Raku program by using the -e option with the echo command, like this:

echo -e "my string" | raku my_program.raku
@raiph
raiph / .md
Last active July 1, 2022 20:20
Nice looking (but complicated to code and not accessible for blind) footnoted links for Reddit, SO, GH gists. (View raw to see underlying markdown.)
View .md

To future me and any other readers:

  • The Reddit rendering (which you should see if you click the foregoing link) of this gist's underlying markdown hopefully renders the footnotes in the Reddit footnotes bullet below such that they look the same style as seen in the StackOverflow footnotes bullet of the GH gist rendering of this gist. I say "hopefully" in the sense they do look the same using my laptop as I write this in Feb 2022, and in the sense I'm hoping it'll remain that way. But of course things might look different on your system, and any of these platforms can change their rendering at any time.
  • Use this footnote approach if you like, but it's complicated, and, worse, probably horrible for the blind, and, worst of
@raiph
raiph / .md
Created July 1, 2022 17:17
Dimash official YT channel subscriber count growth
View .md

​ @A moment with Musasia 😍

This comment is mostly just somewhere to store some info. It may well interest no one else but me.

In my above comment I wrote "His official YT channel had grown to about a million subscribers about a year ago. I think it's now approaching 2 million". I realized after I'd written it that I was quite unsure about the exact number a year ago. So I investigated. It turns out it is approaching 2M but was about 1.3M a year ago, not 1M. This comment corrects the record with the summary I just gave plus a ridiculous amount of detail below that will almost certainly interest no one but me.


Before I get to the hard data, let me say a bit about where I'm coming from.

@raiph
raiph / gist:ce552c18af72f9609eaef1c2eb39a2ba
Created June 29, 2022 14:36
Dame Debra James: final advice
View gist:ce552c18af72f9609eaef1c2eb39a2ba
Find a life worth enjoying
Take risks
Love deeply
Have no regrets
@raiph
raiph / .md
Created April 30, 2022 22:34
Longevity diet
View .md
@raiph
raiph / .md
Last active January 29, 2022 23:37
`quasi`
View .md

"a quasi is like a little templating language for the raku code"

Please consider choosing a word other than quasi. Using quasi introduces conceptual complexity that is unnecessary and, imo, harmful. Given that what it does is a "Transform of a syntax template" with the transform being "To AST", please consider one or more of ToAST, toAST, and/or toast, and perhaps encourage the lie-to-children simplicity of "template of AST".

@raiph
raiph / trans.md
Last active January 22, 2021 22:33
trans DWEM
View trans.md

What this is

My documentation of P6's .trans routine for anyone who reads it.

It may be a step toward updating the official doc and/or cleaning up the relevant spec tests and/or functionality.

I have tried to be clear enough that a future me will be able to make sense of it, and hopefully anyone else who reads this.

It's supposedly exhaustive (definitely exhausting!).