Arnaud Spiwack

Arnaud Spiwack

@aspiwack.bsky.social

Multi-classed Software Engineer/Constructive Mathematician. Sometimes plays video games sort of fast. Puts topoi in your computer.

224 followers23 following1.4K posts

Pinned

👋 Welcome (numerous) newcomers. I'm a Tokyo-based, French, polyglot software engineer, computer scientist, mathematician, and hobbyist speedrunner. I generally speak of programming languages and their theory, linguistics, science, video games, movies, books. And how the world is very funny indeed.

It's more important in Ocaml because Haskell's laziness precludes most types from crossing modes. The solution deployed in the paper is pretty involved, but maybe it's as canonical as it gets. I haven't fully digested it yet. But either way, it's important.

What I'm suggesting is that we can, and probably should, take this as the *definition* of multicategories (it's a tad more general: ordinary multicategories correspond to the case where contexts are a PROP generated by the pures).

Arnaud Spiwack@aspiwack.bsky.social

I noticed something the other day. If you have a monoidal category, and a subset P of objects, then arrows from arbitrary objects to objects of P form a multicategory. We'll say that this is a category of context and P are pure objects.

Something I realised while working on sheaves (because it turns out to be relevant) is that the multicategorical definition of coproduct is stronger than the categorical one. Because in the multi case, the branches have access to the context. In the cat case they don't.

Arnaud Spiwack@aspiwack.bsky.social

From a mathematics perspective, it may be a friendlier setting to speak about multicategories (which tend to be notationally heavy). Though I don't think it makes the definition of coproducts much less of a chore (see p92 in Shulman's tutorial).

If you have all finite products and coproducts, then the multi case is equivalent to products distributing over coproducts (exercise), which always hold for CCCs (also exercise). But multicategories let you speak of these stronger coproducts without requiring all that.

At the time it didn't have a name. There was no paper. And it got basically no interest at all. I'm really happy now. I've been looking forward to this moment for almost 15 years.

I noticed something the other day. If you have a monoidal category, and a subset P of objects, then arrows from arbitrary objects to objects of P form a multicategory. We'll say that this is a category of context and P are pure objects.

View full thread

From a mathematics perspective, it may be a friendlier setting to speak about multicategories (which tend to be notationally heavy). Though I don't think it makes the definition of coproducts much less of a chore (see p92 in Shulman's tutorial).

I noticed something the other day. If you have a monoidal category, and a subset P of objects, then arrows from arbitrary objects to objects of P form a multicategory. We'll say that this is a category of context and P are pure objects.

View full thread

The nice thing is that ordinary categorical structure on the category of context gives rise to structure on the multicategory (aka generalised multicategories). E.g. a symmetric monoidal category of context gives rise to symmetric multicategories.

I wonder don't know what notions of generalised multicategory are captured thus. Cruttwell and Shulman arxiv.org/abs/0907.2460 have a crazy general notion (and review of pre-existing notions). But I'm not motivated enough to try and figure this out.

arxiv.orgA unified framework for generalized multicategoriesNotions of generalized multicategory have been defined in numerous contexts throughout the literature, and include such diverse examples as symmetric multicategories, globular operads, Lawvere theorie...

I noticed something the other day. If you have a monoidal category, and a subset P of objects, then arrows from arbitrary objects to objects of P form a multicategory. We'll say that this is a category of context and P are pure objects.

View full thread

In fact, all ordinary multicategory are of this form. Let M be a multicategory. Take contexts to be lists of objects of M, and context arrows to be lists of parallel arrows in the obvious way. Taking pure objects to be the singletons recovers M.

This construction is an example of my earlier point: if M is representable, then the tensor product of M is emphatically not list concatenation (which is the monoidal product on contexts).

I noticed something the other day. If you have a monoidal category, and a subset P of objects, then arrows from arbitrary objects to objects of P form a multicategory. We'll say that this is a category of context and P are pure objects.

This multicategory is non-trivial in that P need not be closed by monoidal product, in particular the multicategory need not be representable. But if it is, the monoidal product on P can be a different operation than the monoidal product on contexts.

The Ocarina of Time remake is right around the corner. And the marketing is all around me. I wanted to take the opportunity to clarify a position: it's going to be a good game. Ocarina of Time is the most beloved video game of all times, and this is, for the most part, the same game.

Even if I'm slightly dismayed that significantly more people are going to play this game than the original (or the excellent 3DS version, which is likely to remain the highest quality version of this game).

I don't think this works super well for arbitrary relation equipments. First let's say that F is a functor if both: it maps arrows to arrows, and it maps composite relations R(f,g) to F(R)(F(f),F(g)).

Arnaud Spiwack@aspiwack.bsky.social

That is, for any object A, we have an arrow α_A : F A -> G A, such that for all R∈Rel(A,B), F(R) ⊆ G(R(α,α)) If F is a functor, parametric arrows should be natural, for instance. This should give us an algebraic framework to talk about what we've been doing in PLT. 6/7

Then, let f:A->B (and B double as the identity relation at B), we have F(B)(1,F(f)) = F(B(1,f)) ⊆ G(B(1,f))(α,α) = B(G)(α,G(f)∘α). This isn't enough to prove that α is natural. But if the target category of F and G is set, then companions are graphs.

And we this unfolds to ∀x y, y = F(f)(x) -> α(y) = G(f)(α(x)). And just a substitution further ∀x. α(F(f)(x)) = G(f)(α(x)). As desired. Presumably, sets is essentially the only category where this works. So it's more of a protosheaf theory than a protofunctor theory.

I was walking in a book store today, and I saw a manga series has obviously been drawn by the same author as Full Metal Alchemist. The style was unmistakable. Getting closer I recognised the character: it's Daemons of the Shadow Realm. An anime I watched just a few weeks ago.

But then, I hadn't recognised the style at all. The anime looks just completely generic (it's quite compelling though). Another anime I watched recently is Witch Hat Atelier. Here again a rather generic looking but compelling anime. Then I saw what the manga looked like.

As it happens it has a very strong style, which doesn't show up in the anime adaptation at all. What's going on? Is it a trend? I'm suspecting modern animation tools make it decently cheap to produce an adaptation but push you in more standardised style? I don't really know.

View full thread

Now, I don't know how practical this is. Everything appears to be desugared as a lens, this would introduce a lot of overhead, hopefully this can be optimised away in most cases. Also, I've come to distrust state-passing type system. They cause too many problems.

I'm not surprised that a borrowing-style system introduces such state passing though, it may be hard to avoid. Anyway, cool stuff, I'm looking forward to follow-ups.

View full thread

Another remarkable feature is that this eventually desugars to an ordinary linear λ-calculus, showing the relevance of borrowing-like features without having to introduce notions of ownership.

A nice feature is that borrows can be direct style since they can't be promoted (semantically). So when creating a unique resources, you can simply return it as a borrow (the action of giving back the borrow becomes deallocation).

We've usually been focused in the (horizontal) composition of lens to make deeper lenses. But there's also a (vertical) indexed applicative structure, and this is where their calculus emerge. This is about linear borrows, shared borrows are a whole 'nother beast.

I've got a love-hate relationship with the Dragon Ball anime (not Z, Z simply isn't worth your time). It's really well-crafted: it looks good, the voice actors are great, and above all the sound design is exceptional. But it's too long, and it has a lot of useless (or worse) filler episodes…

It captures a common duality in formal method (guarantee of correctness vs guarantee of a bug). Though it leaves me wondering: what is A? An actual value of type A, maybe?

View full thread

It's well worth playing: the presentation is truly excellent. The visual design is good, the animation is good, the writing is excellent, the VOICE ACTING is excellent. If you know me, you probably know that I constantly complain about voice acting in game. 3/4

Most of the time, I feel that they diminish the game. Not here though. I found myself relishing almost every single line. Looking forward to more lines of dialogue. What a treat! 4/4

I would describe it as an interactive detective novel; it's not a true detective game like Obra Dinn, as the game is in charge of most of the exposition. It has a bit of a old-style Point&Click adventure game feel (but it's not really one such either).

The first time I played Worldless, I didn't do anywhere near a 100% run. Aside: if you're intro metroidvanias at all, this game is a must play: it's a very unique and delightful take on the genre (and did I mention gorgeous?).

View full thread

But when I launched the game again, the game crashed before even reaching the title screen. So I can't even attempt the superboss which is behind the platforming challenge (and in fact, the only way to play the game at all is to erase my entire save data).

The first time I played Worldless, I didn't do anywhere near a 100% run. Aside: if you're intro metroidvanias at all, this game is a must play: it's a very unique and delightful take on the genre (and did I mention gorgeous?).

View full thread

I eventually figured it out: the game had started crashing every time it would give me an achievement (and I wouldn't get the achievement, but the game was saved, so I could continue from there).

It wasn't happening at first, somewhere along the way, my save got corrupted (probably) and I stopped getting achievement and got crash instead. So when I completed the hardest platforming challenge, the game crashed, as expected.

The first time I played Worldless, I didn't do anywhere near a 100% run. Aside: if you're intro metroidvanias at all, this game is a must play: it's a very unique and delightful take on the genre (and did I mention gorgeous?).

Anyway, I decided to sit down and finally do a 100% playthrough (on the Switch 2). When I started reaching close to the end, I started hitting a peculiar bug, whereby the game would crash at the end of some fights.

When we came up with Topiary our goals weren't too ambitious: make it cheap to write decent formatters for new languages, reducing the amount of stuff you have to maintain.

Topiary v0.8.0 -- Irresistible Ironwood -- is out! 🌳 New: Tree-sitter language injections (Markdown code blocks, OCaml in OCamllex and Menhir), much richer error reporting, better multi-line strings and a --check flag for CI. github.com/topiary/topi...

But it's really becoming uniquely strong now, leveraging the multi-language support for new features. To the point that it may eventually be worth moving to Topiary even if you already have a dedicated formatter for your language. (and, to be clear, I've got nothing to do with it, congrats team!)

One year later. I found this proposal dl.acm.org/doi/full/10.... . Idea: add a rule e⇓e to big-step semantics. Except you can't do that, because most rules only make sense when you evaluate to a value. So you do the dual thing: allow big-step under (unevaluated) evaluation contexts.

dl.acm.orgBig-Stop Semantics: Small-Step Semantics in a Big-Step Judgment | Proceedings of the ACM on Programming LanguagesAs is evident in the programming language literature, many practitioners favor specifying dynamic program behavior using big-step over small-step semantics. Unlike small-step semantics, which must dwe...
Arnaud Spiwack@aspiwack.bsky.social

And either way, big-step semantics doesn't tell you anything about partial evaluation. Partial evaluation is somewhat important (like it's 90% of GHC's optimisation). We need to find a way out of this mess. 6/6

Certainly a challenge is to make this observation less handwavy. The program doesn't blow up if you use a seed several times. It just doesn't have the desired distribution. But… what is the desired distribution? Does linearity show up in the semantics of probabilistic programs?

Arnaud Spiwack@aspiwack.bsky.social

Something popped back up from the back of my mind. Splitting random-number generators seem to be an example of linear comonoid. In that it's imperative that you don't use the same seed twice. And the natural associated monad is a linear reader monad.