Pinned oot

I finished a new large . It's probably the most detailed drawing I ever made.

The main figure in the drawing is based on a picture I took at the Gion Matsuri in some years ago. It is a dancer performing the old Japanese court dance "Ran-Ryo-O".

I used Derwent Inktense and Conté Aquaralle pencils as well as watercolour paint (various brands). The paper is Arches 56cmx76cm 300g/m2 rough watercolour paper.

Pinned oot

I finished my , on the last day of my holidays! It's the first time I've done such a large (50cmx70cm). It's based on a picture I took of a lotus in a pond in a temple (萬福寺) near . of the lotus pond watercolour

Pinned oot

I'm Wim, in Glasgow (Scotland).
I like , , , cooking and ().

I do research on , and runtimes (e.g. ) for , and .

I program in , , , ++,.

@wim_v12e is my main account, I use it mostly for the non-technical stuff. The computer stuff usually goes on @wim_v12e.

Pinned oot

I finished my . It's based on a picture of a scene from the Gion Matsuri that I took in Kyoto last summer. I used pencils, acrylic watercolour paint and bistre.

Wim 🅾 boosted
Wim 🅾 boosted
Wim 🅾 boosted

Happy Stanislav Petrov day, everyone – as bad as the world can be, I'm still glad it didn't end in 1983!

Wim 🅾 boosted

Mobutu Sese Seko, was a Democratic Republic of Congo dictator who renamed it Zaire. You will understand the best definition of KLEPTOCRACY when you study more about Mobutu. To feed his opulent lifestyle, Mobutu amassed so much wealth, between $5 billion and $ 15 billion, higher than the country's debts at that time. He made an airport within his palace to go shopping in France. I wrote about Mobutu's story sometimes back here

To be perfectly honest, I'm only doing all this so I can re-implement it in . Turns out it is really easy too:

role BoolBB[\b] {
method unBoolBB(\t,\f) {

and because Raku is gradually typed, the polymorphism is of course for free.

Show thread

Now you probably wonder, what good is all this anyway? Yu're thinking, "I'm a very busy man, I have other cases besides this one."
There are many uses for this encoding but what we are using it for is to compose interpreters. Essentially, if your algebraic data type represents an abstract syntax tree, then the BB encoding of it is a universal interpreter. Every particular implementation of the function is an interpreter, and they are composable.

Show thread
Wim 🅾 boosted

Kot upārjanā ṯerai ang

"Millions of Universes are the Limbs of His Being."

ਕੋਟਿ ਉਪਾਰਜਨਾ ਤੇਰੈ ਅੰਗਿ ॥

कोटि उपारजना तेरै अंगि ॥

Guru Granth Sahib, page 1156

We can also encode product types in this way:

newtype PairBB t1 t2 =
PairBB {
unPairBB :: forall a .
(t1 -> t2 -> a) -> a

fst p = unPairBB p (\x y -> x)
snd p = unPairBB p (\x y -> y)

bbp = PairBB $ \p -> p 42 "forty-two"

That means that the BB encoding provides a way to represent algebraic data types as polymorphic functions.

Show thread

There are other reasons why the Boehm-Berarducci encoding, but first I'd like to give another example: the encoding of the Boolean type

data Bool = True | False


newtype BoolBB =
BoolBB (forall a . a -> a -> a)

So this is a function of two arguments that returns something of the same type. With two selectors very similar to those for Maybe:

true = \t f -> t
false = \t f -> f

we can write

trueBB = BoolBB true
falseBB = BoolBB false

Show thread

And why do I think this is nice? Because I have encoded a sum type:

data Maybe b = Just b | Nothing

as a single function type which, if anything, is more like a product type. The record type syntax is just to provide a label for easy access to the function.

Show thread

With that warning, here is my implementation of a Maybe type in Boehm-Berarducci encoding:

newtype MayBB b = MayBB {
unMayBB :: forall a .
(b -> a)
-> a
-> a

and I think it's beautiful.

With these little helpers:

just x = \j' n' -> j' x
nothing = \j' n' -> n'

we get the following:

-- Plain Maybe
mb :: Maybe Int
mb = Just 42

mbn :: Maybe Int
mbn = Nothing

-- BB Maybe
mbb:: MayBB Int
mbb = MayBB $ just 42

mbbn :: MayBB Int
mbbn = MayBB nothing

Show thread

"Boehm-Berarducci's paper has many great insights. Alas, the generality of the presentation makes the paper very hard to understand. It has a Zen-like quality: it is incomprehensible unless you already know its results."

Wim 🅾 boosted
Wim 🅾 boosted

academic employment − 

The poet published some poems containing racial slurs. His friends had begged him to reconsider publishing them, his editor had pleaded with him to withdraw them, but he had insisted that they stay. The poems were commenting on prejudice, he pointed out, and not condoning it. They showed how derogatory words cause people to see others in terms of stereotypes rather than as individuals.

Wim 🅾 boosted

Some moths, like butterflies, can feature some interesting patterns. Like this Grammodes geometrica moth spotted at Coney Island, Singapore, on 30 June 2020. Luck played a part: I happen to be looking down at a patch of plants when I saw it.

On iNaturalist [ ]

#iNaturalist #Nature #Singapore #Photography #Insects #Moths #Lepidoptera

Wim 🅾 boosted

I just wanted to share with you this beautiful shot of my tools. Because they are so beautiful. #mastoArt

Wim 🅾 boosted

"I Will Wade Out" (E. E. Cummings) 

Show thread

"I Will Wade Out" (E. E. Cummings) 

Show more

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!