Welcome! We notice you're using an outdated browser, which will result in a degraded experience on this site. Please consider a modern, fully supported browser.

webbureaucrat

The articles are just window-dressing for code snippets I want to keep.

Latest Articles

  1. Iced for Desktop Development in Rust

    As someone who loves Elm and has recently fallen in love with Rust, I was delighted to learn there are not just one but two Rust frameworks modeled on the Elm Architecture. If you're not familiar, the Elm Architecture is a pain-free way of developing fast, responsive, asynchronous-by-default front-ends. Let's see it in action by developing a simple "Hello, world" app.


  2. Setting and Reading Session Cookies in Rust with Actix Web

    In case it's not readily apparent, I've been having some trouble picking a backend stack recently, but, at the risk of jinxing it, I really think Rust is the backend for me, and Actix Web is a blindingly fast MVC framework for Rust with an elegant and functional middleware system. As with all web apps, my first challenge is persisting and managing state between requests, so let's get into user session management in Actix Web.


  3. Writing a (Nix-Friendly) Hello World Web App in Haskell with Scotty

    Okay, so this article has been written before, and I don't have a lot new to add, but some of these tutorials are getting pretty old, and the ones that aren't use stack, which I personally am avoiding as it doesn't play well with NixOS, so at least for me, for future reference, this tutorial will be useful.


  4. Running and Connecting to Postgres Using Docker Compose

    Setting up a new development environment from scratch can feel like a slog. This is a quick copy-paste recipe for getting up and running quickly with Postgres in docker compose.


  5. Idris FizzBuzz Part IV: Main and .ipkg Files

    This is the fourth and final part of a walkthrough of FizzBuzz, a common interview problem, in Idris. If you haven't read the other parts, you can start with Part I. To show how to import and use libraries, we're going to divide this project into a library and an executable. Along the way, we will create .ipkg packages for both.


More articles can be found in the archive.

Tagged “bucklescript”

  1. Writing Service Workers in ReScript

    Does your SPA work fully offline? Would you like to define a caching strategy in an exhaustively type-safe way? If so, you might be interested in this Service Worker binding for ReScript (formerly BuckleScript / ReasonML). This article documents the binding by example, including two different caching strategies and a service worker registration example.


  2. Setting Up Webpack for ReScript

    As much as I strongly prefer ES6 modules, using them with ReScript (formerly BuckleScript / ReasonML) and ServiceWorkers just isn't practical right now. I'm writing this article so that I can easily grab the configuration the next time I need it. This is a beginner's guide because I am a webpack beginner, and, well, everyone is a ReScript beginner right now.


  3. Displaying Notifications in ReScript

    This article will serve to document and demonstrate the rescript-notifications npm package, a complete set of bindings for the JavaScript-compiling ReScript language (formerly BuckleScript/ReasonML). At the close of this article, the reader should be able to enable and display notifications in an entirely type safe and functional way.


  4. Writing Elm Ports in ReScript

    This is a post-rebrand update to my previous post, "How to Write Elm Ports in ReasonML." I rewrote the package in the new ReScript syntax so that people who aren't familiar with the old syntax can still read it. Recently I've published an npm package called res-elm and put it into production on a couple of projects. It's documented briefly by its README, but I think it deserves a full post. This post will walk through how to set up ports both into and out of an elm 0.19 project using ReScript.


Tagged “reasonml”

  1. Writing Service Workers in ReScript

    Does your SPA work fully offline? Would you like to define a caching strategy in an exhaustively type-safe way? If so, you might be interested in this Service Worker binding for ReScript (formerly BuckleScript / ReasonML). This article documents the binding by example, including two different caching strategies and a service worker registration example.


  2. Setting Up Webpack for ReScript

    As much as I strongly prefer ES6 modules, using them with ReScript (formerly BuckleScript / ReasonML) and ServiceWorkers just isn't practical right now. I'm writing this article so that I can easily grab the configuration the next time I need it. This is a beginner's guide because I am a webpack beginner, and, well, everyone is a ReScript beginner right now.


  3. Displaying Notifications in ReScript

    This article will serve to document and demonstrate the rescript-notifications npm package, a complete set of bindings for the JavaScript-compiling ReScript language (formerly BuckleScript/ReasonML). At the close of this article, the reader should be able to enable and display notifications in an entirely type safe and functional way.


  4. Writing Elm Ports in ReScript

    This is a post-rebrand update to my previous post, "How to Write Elm Ports in ReasonML." I rewrote the package in the new ReScript syntax so that people who aren't familiar with the old syntax can still read it. Recently I've published an npm package called res-elm and put it into production on a couple of projects. It's documented briefly by its README, but I think it deserves a full post. This post will walk through how to set up ports both into and out of an elm 0.19 project using ReScript.


Tagged “rescript”

  1. De-Microsofting Your Development Environment

    Anyone who has been following the web ecosystem over the last few years knows it has been rapidly consolidating under Microsoft. That consolidation economically threatens the open web. Diversifying your tooling could protect you as much as diversifying any investment, and it's much more convenient than you might think.


  2. Continuously Deploying to GitLab's NPM Package Registry

    In a previous article, we explored how to continuously deploy to the npmjs.com package registry. This is all well and good, but an advantage of CI/CD is that we can easily deploy wherever we want. This article will explore how to deploy an npm package to both npmjs.com and GitLab's own package registry, including how to change package names when necessary.


  3. Writing Elm Ports in ReScript - 0.3

    This is an update to a previous article following a breaking change in the res-elm binding. In short, the init function has been broken up into init and initWithOptions to allow for Elm initialization flags and Elm web applications. Recently I've published an npm package called res-elm and put it into production on a couple of projects. It's documented briefly by its README, but I think it deserves a full post. This post will walk through how to set up ports both into and out of an Elm 0.19 project using ReScript.


  4. Binding to a JavaScript Function that Returns a Variant in ReScript

    ReScript provides easy ways to bind to most JavaScript functions in a way that feels both native and safe. Conveniently, it even provides an @unwrap decorator for parametric polymorphism. However, there are a few places where we still have to fill in the gaps. This article documents how to bind to a JavaScript function that can return any one of several different types using ReScript variants.


Tagged “monad”

  1. Idris FizzBuzz Part II: Maybes, Infix Notation, and Idris Holes

    Let's conntinue on our journey of writing FizzBuzz in the Idris programming language. If you haven't already, I encourage you to read Part I for an introduction to the problem as well as some basic syntax, and, importantly, information on totality checking.


  2. Idris FizzBuzz Part I: Monads, Comments, and assert_smaller

    My journey of learning the Idris programming language continues! This article will start a tutorial series detailing how to write FizzBuzz in Idris. As before, my goal is to write without the assumption that all Idris learners already know Haskell. We will start by implementing modulo in Idris, and toward that goal we will go painfully slow because frankly this stuff is hard.


  3. Parsing JSON in ReScript Part III: Getting to the Point

    After having established some requirements and some basic utilities, we're ready for the fun part: putting the pieces together. At the end of this post, we will have our working parser.


  4. Parsing JSON in ReScript Part II: Building Blocks

    This is the second in a series of articles on how to build one's own, general-purpose parsing library. After having established a few expectations in the previous post, we are ready to begin building our utilities for our library. Let's start with some highly generalized utilities for functional programming.


Tagged “documentation”

  1. Writing Elm Ports in ReScript - 0.3

    This is an update to a previous article following a breaking change in the res-elm binding. In short, the init function has been broken up into init and initWithOptions to allow for Elm initialization flags and Elm web applications. Recently I've published an npm package called res-elm and put it into production on a couple of projects. It's documented briefly by its README, but I think it deserves a full post. This post will walk through how to set up ports both into and out of an Elm 0.19 project using ReScript.


  2. Writing Service Workers in ReScript

    Does your SPA work fully offline? Would you like to define a caching strategy in an exhaustively type-safe way? If so, you might be interested in this Service Worker binding for ReScript (formerly BuckleScript / ReasonML). This article documents the binding by example, including two different caching strategies and a service worker registration example.


  3. Displaying Notifications in ReScript

    This article will serve to document and demonstrate the rescript-notifications npm package, a complete set of bindings for the JavaScript-compiling ReScript language (formerly BuckleScript/ReasonML). At the close of this article, the reader should be able to enable and display notifications in an entirely type safe and functional way.


  4. Writing Elm Ports in ReScript

    This is a post-rebrand update to my previous post, "How to Write Elm Ports in ReasonML." I rewrote the package in the new ReScript syntax so that people who aren't familiar with the old syntax can still read it. Recently I've published an npm package called res-elm and put it into production on a couple of projects. It's documented briefly by its README, but I think it deserves a full post. This post will walk through how to set up ports both into and out of an elm 0.19 project using ReScript.