Things I Like About Nim

Method Call Syntax In Nim, a.f(b) is really just syntactic sugar for f(a, b). Note: they look like methods but aren’t attached to the type/object at all. Which function to call will be figured out at compile time, just like normal function calls. You can use this to implement pseudo extension methods on standard types like strings: import nim_utils/files, os, strformat proc makeBackup(filename: string) = let backupPath = fmt"{filename}.bak" case filename. [Read More]

Ocaml Memory Model Notes

Non-Atomic Variables var1: [t1 -> v1; t2 -> v2] where var1 is the name of the variable, tx are timestamps, and vx are the values of the variable at those timestamps. Note that t(n+1) must be greater than t(n) Domains Domains are separate spheres of execution. Each thread would have their own Domain, for instance. Frontier Domains have a frontier, which establishes which variables it can see at which timestamp. [Read More]

Unification Algorithm Notes

Unification Algorithm type term = | Var of string | Term of string * term list You either have a type variable with a name, or a type constructor with a name and a list of arguments. Unification takes a list of term pairs which have to be made matching. Unification returns a list of substitutions, where a substitution is a pair of a string and a term, aka the variable name that should be substituted with the term. [Read More]

OCaml Effects

I’ve been interested in algebraic effects in programming languages for a while, but they’ve been theoretical-only for a while. That’s soon to change though! OCaml early on adopted algebraic effects and handlers as a way to implement concurrency, something that had been lacking in the language until now. But changing the langugage’s memory model, runtime, garbage collector, etc. proved to be a long task. OCaml 5.0 is on the horizon at last and includes an implementation of algebraic effects. [Read More]

Terminal Setup

A lot of people at work have been asking me how I set up my terminal, so I wrote this up to send to them. Hope you enjoy! Install ZSH The shell I use is zsh. To install it, follow these instructions Install oh-my-zsh oh-my-zsh is a plugin/theming library thingie for zsh. Follow these instructions to install Make sure to take a look at the plugins and enable any that might be useful for you. [Read More]

S3 on Flashblade

I currently work for a company called Pure Storage. One of their products is called Flashblade. I couldn’t find any examples on how to use Flashblade’s S3 capabilities programmatically anywhere online, so I’m putting this out to hopefully help people realize they can move their object store into their data center with very little changes to their code. Code Snippets Most of the work with the libraries I’ve used involves figuring out how to get the client configured properly. [Read More]

Programming Articles and Talks

Here’s a collection of talks or articles that I really enjoy. The Error Model Joe Duffy describes the error model in an experimental programming language that he worked on. Starts off by describing different ways that programming languages give programmers to express and deal with errors. He discusses the pros and cons of each strategy, and then goes on to describe how they designed around those problems to create something truly unique. [Read More]