
Signatures on secp256k1
19 October 2024I’ve released a library supporting BIP340 Schnorr signatures and deterministic ECDSA on the elliptic curve secp256k1. Get it while it’s hot – for when you just aren’t feelin...
 cryptography
 haskell

New HMACDRBG and SHA2 Libraries
07 October 2024Just FYI, I’ve dropped a few simple libraries supporting SHA{256,512}, HMACSHA{256, 512}, and HMACDRBG. You can find the repos here:
 cryptography
 haskell

Reservoir Sampling
22 September 2024I have a little library called sampling floating around for generalpurpose sampling from arbitrary foldable collections. It’s a bit of a funny project: I originally hacked it together quickly, just to get something done, so it’s not a very good library qua library – it has plenty...
 statistics
 haskell

More Recursive Stochastic Processes
01 September 2024Some years ago I wrote about using recursion schemes to encode stochastic processes in an embedded probabilistic programming setting. The crux of it was that recursion schemes allow one to “factor out” the probab...
 statistics
 recursion
 haskell

Kelvin Versioning
25 February 2020Long ago, in the distant past, Curtis introduced the idea of kelvin versioning in an informal blog post about Urbit. Imagining the idea of an ancient and longfrozen form of Martian computing, he described this versi...
 protocols
 urbit

Email for l33t h4x0rz
11 February 2020(UPDATE 2024/09/08: while hosting your own mailserver is not covered in this post, I recommend you check out Simple NixOS Mailserver for a borderline trivial way to do it.)
 admin

Basic Hoonery
04 February 2019In my last post I first introduced hnock, a little interpreter for Nock, and then demonstrated it on a handrolled decrement function. In this post I’ll look at how one can handle the same (contrived, but illustrative)...
 urbit

A Nock Interpreter
31 January 2019I wrote a little Nock interpreter called hnock some months ago and just yesterday updated it to support the latest version of Nock, 4K. Nock – the base layer VM of Urbit – is a very simple little “functio...
 haskell
 urbit

Crushing ISAAC
07 October 2018(UPDATE 2020/06/30: the good people at tweag.io have since published a Nix shell environment that appears to make testing arbitrary PRNGs much less of a pain. I recommend you check it out!)
 statistics
 cryptography
 languageengineering

Transforming to CPS
04 August 2018I recently picked up Appel’s classic Compiling with Continuations and have been refreshing my continuationfu more generally.
 haskell
 languageengineering

Embedded DSLs for Bayesian Modelling and Inference: a Retrospective
02 July 2018Why does my blog often feature its typical motley mix of probability, functional programming, and computer science anyway?
 statistics
 mathematics
 languageengineering
 haskell

Fubini and Applicatives
27 June 2018Take an iterated integral, e.g. \(\int_X \int_Y f(x, y) dy dx\). Fubini’s Theorem describes the conditions under which the order of integration can be swapped on this kind of thing while leaving its value invariant. If Fubini’s conditions are met, you can con...
 haskell
 mathematics
 languageengineering

Byzantine Generals and Nakamoto Consensus
22 January 2018You can recognize truth by its beauty and simplicity.
– Richard Feynman (attributed)
 consensus

Recursive Stochastic Processes
01 March 2017Last week Dan Peebles asked me on Twitter if I knew of any writing on the use of recursion schemes for expressing stochastic processes or other probability distributions. And I don’t! So I’ll write some of what I do know myself.
 statistics
 recursion
 haskell

The Applicative Structure of the Giry Monad
26 February 2017In my last two posts about the Giry monad I derived the thing from its categorical and measuretheoretic foundations. I kind of thought that those posts wouldn’t be of much interest to people but they turned out to be a hit. I clearly can’t tell what the internet like...
 mathematics
 statistics
 haskell

Implementing the Giry Monad
13 February 2017In my last post I went over the categorical and measuretheoretic foundations of the Giry monad, the ‘canonical’ probability monad that operates on the level of probability measures.
 mathematics
 statistics
 haskell

Foundations of the Giry Monad
10 February 2017The Giry monad is the canonical probability monad that operates on the level of measures, which are the abstract constructs that canonically represent probability distributions. It’s sort of the baseline by which all other probability monads can be judged.
 mathematics
 statistics
 haskell

Rotating Squares
04 January 2017Here’s a short one.
 haskell
 recursion

Promorphisms, Pre and Post
26 November 2016To the.. uh, ‘layperson’, pre and postpromorphisms are probably well into the WTF category of recursion schemes. This is a mistake  they’re simple and useful, and I’m going to try and convince you of this in short order.
 haskell
 recursion

Comonadic Markov Chain Monte Carlo
26 October 2016Some time ago I came across a way to inprinciple perform inference on certain probabilistic programs using comonadic structures and operations.
 probabilisticprogramming
 languageengineering
 haskell

A Simple Embedded Probabilistic Programming Language
17 October 2016What does a deadsimple probabilistic programming language look like? The simplest thing I can imagine involves three components:
 probabilisticprogramming
 languageengineering
 haskell

Randomness in Haskell
01 October 2016Randomness is a constant nuisance point for Haskell beginners who may be coming from a language like Python or R. While in Python you can just get away with something like:
 haskell

On Measurability
18 July 2016.. this one is pretty dry, I’ll admit. David Williams said it best:
 mathematics

Making a Market
20 April 2016Suppose you’re in the derivatives business. You are interested in making a market on some events; say, whether or not your friend Jay will win tomorrow night’s poker game, or that the winning pot will be at least USD 100. Let’s examine some rules about how you should do business if you want this venture to succeed.
 probability
 statistics

flatmcmc Update and v1.0.0 Release
07 April 2016I’ve updated my old flatmcmc library for ensemble sampling in Haskell and have pushed out a v1.0.0 release.
 haskell
 statistics

Encoding Statistical Independence, Statically
16 February 2016Applicative functors are useful for encoding contextfree effects. This typically gets put to work around things like parsing or validation, but if ...
 haskell
 statistics
 languageengineering

Time Traveling Recursion Schemes
09 February 2016In Practical Recursion Schemes I talked about recursion schemes, describing them as elegant and useful patterns for expressing general computation. In that article I introduced a number of things relevant to working with the recursi...

Monadic Recursion Schemes
20 January 2016I have another few posts that I’d like to write before cluing up the whole recursion schemes kick I’ve been on. The first is a simple note about monadic versions of the schemes introduced thus far.
 haskell
 recursion

Sorting Slower with Style
19 January 2016I previously wrote about implementing merge sort using recursion schemes. By using a hylomorphism we could express the algorithm concisely and true to its highlevel description.
 haskell
 recursion

Yo Dawg We Heard You Like Derivatives
08 January 2016I noticed this article by Tom Ellis today that provides an excellent ‘demystified’ introduction to automatic differentiation. His exposition is exceptionally clear and simple.
 haskell
 languageengineering
 recursion

A Tour of Some Useful Recursive Types
09 December 2015I’m presently at NIPS and so felt like writing about some appropriate machine learning topic, but along the way I wound up talking about parameterized recursive types, and here we are. Enjoy!
 haskell
 recursion

Sorting with Style
02 December 2015Merge sort is a famous comparisonbased sorting algorithm that starts by first recursively dividing a collection of orderable elements into smaller subcollections, and then finishes by recursively sorting and merging the smaller subcollections together to reconstruct the (now sorted) original....
 haskell
 recursion

Markov Chains à la Carte
14 October 2015I’ve released a number of libraries for doing Markov Chain Monte Carlo (MCMC) in Haskell.
 haskell
 statistics

Practical Recursion Schemes
06 September 2015Recursion schemes are elegant and useful patterns for expressing general computation. In particular, they allow you to ‘factor recursion out’ of whatever semantics you may be trying to express when interpreting programs, keeping your interpreters concise, your concerns separated, and your code more maintainable.
 haskell
 recursion

Automasymbolic Differentiation
06 July 2014Automatic differentiation is one of those things that’s famous for not being as famous as it should be (uh..). It’s useful, it’s convenient, and yet fewer know about it than one would think.
 languageengineering
 haskell

Sharing in Haskell EDSLs
30 May 2014Lately I’ve been trying to do some magic by way of nonstandard interpretations of abstract syntax. One of the things that I’ve managed to grok along the way has been the problem of sharing in deeplyembedded languages.
 languageengineering
 haskell

Basic EC2 Management with Ansible
21 December 2013(UPDATE 2016/08/15: Here be monsters. This code is ancient, the style is not really idiomatic Ansible, and it’s likely that nothing works anymore.)
 infrastructure