jtobin.io

About Archive PGP Software Professional
Atom git.jtobin.io

© 2025 Jared Tobin. CC BY 4.0.

  • Revenge of the Builders

    17 January 2025

    I wanted to make a quick addendum to my last post in that I did some further experimenting with Data.ByteString.Builder on both the base16 encoding and decoding tasks, comparing results with the impure direct-allocation-and-write-based implementations I mentioned previously.

    • haskell
    • performance
  • Fast Haskell, Redux

    16 January 2025

    In this post I’m going to incrementally optimise a simple base16 (hexadecimal) encoding routine and illustrate what sort of performance boost each optimisation yields. Hopefully it can be used to glean a bit about what tends to make Haskell code fast – especially code that deals with bytestrings.

    • haskell
    • performance
  • Retvrning to X

    21 December 2024

    I nuked all of my social media accounts years ago and never looked back. My general take is that all legacy web 2.0-style social media stuff needs to be ground under a boot, and then the boot filled with cement and sank to the bottom of a particularly deep ocean. Just in case.

    • admin
  • Faster Signatures on secp256k1

    25 November 2024

    In my last post I mentioned that both the Schnorr and ECDSA signature schemes on secp256k1 could be made faster via the so-called wNAF method for elliptic curve point multiplication (short for the cumbersome “w-ary non-adjacent fo...

    • cryptography
    • haskell
  • Signatures on secp256k1

    19 October 2024

    I’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 HMAC-DRBG and SHA-2 Libraries

    07 October 2024

    Just FYI, I’ve dropped a few simple libraries supporting SHA-{256,512}, HMAC-SHA{256, 512}, and HMAC-DRBG. You can find the repos here:

    • cryptography
    • haskell
  • Reservoir Sampling

    22 September 2024

    I have a little library called sampling floating around for general-purpose 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 2024

    Some 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 2020

    Long 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 long-frozen 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 2019

    In my last post I first introduced hnock, a little interpreter for Nock, and then demonstrated it on a hand-rolled decrement function. In this post I’ll look at how one can handle the same (contrived, but illustrative)...

    • urbit
  • A Nock Interpreter

    31 January 2019

    I 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
    • language-engineering
  • Transforming to CPS

    04 August 2018

    I recently picked up Appel’s classic Compiling with Continuations and have been refreshing my continuation-fu more generally.

    • haskell
    • language-engineering
  • Embedded DSLs for Bayesian Modelling and Inference: a Retrospective

    02 July 2018

    Why does my blog often feature its typical motley mix of probability, functional programming, and computer science anyway?

    • statistics
    • mathematics
    • language-engineering
    • haskell
  • Fubini and Applicatives

    27 June 2018

    Take 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
    • language-engineering
  • Byzantine Generals and Nakamoto Consensus

    22 January 2018

    You can recognize truth by its beauty and simplicity.

    – Richard Feynman (attributed)

    • consensus
  • Recursive Stochastic Processes

    01 March 2017

    Last 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 2017

    In my last two posts about the Giry monad I derived the thing from its categorical and measure-theoretic 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 2017

    In my last post I went over the categorical and measure-theoretic 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 2017

    The 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 2017

    Here’s a short one.

    • haskell
    • recursion
  • Promorphisms, Pre and Post

    26 November 2016

    To 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 2016

    Some time ago I came across a way to in-principle perform inference on certain probabilistic programs using comonadic structures and operations.

    • probabilistic-programming
    • language-engineering
    • haskell
  • A Simple Embedded Probabilistic Programming Language

    17 October 2016

    What does a dead-simple probabilistic programming language look like? The simplest thing I can imagine involves three components:

    • probabilistic-programming
    • language-engineering
    • haskell
  • Randomness in Haskell

    01 October 2016

    Randomness 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 2016

    Suppose 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
  • flat-mcmc Update and v1.0.0 Release

    07 April 2016

    I’ve updated my old flat-mcmc library for ensemble sampling in Haskell and have pushed out a v1.0.0 release.

    • haskell
    • statistics
  • Encoding Statistical Independence, Statically

    16 February 2016

    Applicative functors are useful for encoding context-free effects. This typically gets put to work around things like parsing or validation, but if ...

    • haskell
    • statistics
    • language-engineering
  • Time Traveling Recursion Schemes

    09 February 2016

    In 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...

    • haskell
    • recursion
  • Monadic Recursion Schemes

    20 January 2016

    I 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 2016

    I previously wrote about implementing merge sort using recursion schemes. By using a hylomorphism we could express the algorithm concisely and true to its high-level description.

    • haskell
    • recursion
  • Yo Dawg We Heard You Like Derivatives

    08 January 2016

    I noticed this article by Tom Ellis today that provides an excellent ‘demystified’ introduction to automatic differentiation. His exposition is exceptionally clear and simple.

    • haskell
    • language-engineering
    • recursion
  • A Tour of Some Useful Recursive Types

    09 December 2015

    I’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 2015

    Merge sort is a famous comparison-based 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 2015

    I’ve released a number of libraries for doing Markov Chain Monte Carlo (MCMC) in Haskell.

    • haskell
    • statistics
  • Practical Recursion Schemes

    06 September 2015

    Recursion 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 2014

    Automatic 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.

    • language-engineering
    • haskell
  • Sharing in Haskell EDSLs

    30 May 2014

    Lately 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 deeply-embedded languages.

    • language-engineering
    • 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