Skip to content

Instantly share code, notes, and snippets.


Program Analysis, a Big Happy Family

The idea behind program analysis is simple, right? You just want to know stuff about your program before it runs, usually because you don't want unexpected problems to arise (those are better in movies.) Then why looking at Wikipedia gives you headaches? Just so many approaches, tools, languages 🤯

In this article I would like to give a glimpse of an overarching approach to program analysis, based on ideas from abstract interpretation. My goal is not to pinpoint a specific technique, but rather show how they have common core concepts, the differences being due mostly to algorithmic challenges. In other words, static analysis have a shared goal, but it's a challenge to make them precise and performant.

Code is meant to be executed by a computer. Take the following very simple function:

fun cantulupe(x) = {
View LambdaCubeIn100Lines.hs
-- Based on:
import Data.List (delete, union)
{- HLINT ignore "Eta reduce" -}
-- File mnemonics:
-- env = typing environment
-- vid = variable identifier in Bind or Var
-- br = binder variant (Lambda or Pi)
-- xyzTyp = type of xyz
-- body = body of Lambda or Pi abstraction
domenkozar /
Created Jun 23, 2020
Haskell + GitHub Actions + Cachix
View Foo.hs
View puppeteer-cli.nix
# Using a specific checkout of nixpkgs makes it easy to debug as you know exactly what the deps are.
# This being said in production you should pass the global nixpkgs to this file.
let nixpkgs-src = builtins.fetchTarball {
url = "";
sha256 = "1c812ssgmnmh97sarmp8jcykk0g57m8rsbfjg9ql9996ig6crsmi";
{ pkgs ? (import nixpkgs-src {}) }:
with pkgs;
with stdenv.lib;
tazjin /
Last active Feb 9, 2022
Nix builder for Kubernetes
View gist:08ec29508ffcc7f7f3214bbf94f8a733

I think Gabriel's blogpost he explains how to work around nixos-rebuild's inflexibilities. However, I think everything that is being suggested is actually possible in nixos-rebuild already

They blog is still a good exercise to understanding what nixos-rebuild does behind the scenes though.

Deploy to a target machine, from a build machine, with pinned nixpkgs, and a specific nixos config:

nixos-rebuild switch \
 --build-host=build@build.service.consul \
HiImJulien / Swift Meets
Last active Jun 20, 2022
This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.
View Swift Meets

Swift Meets C/C++

This gist is a simple example on how to call a function written in swift from C/C++, without taking the detour via Objective-C/C++.


In this example we're going to invoke a function called say_hello, which, as the name already suggests, prints "Hello, World!" to the terminal.

ezalejski /
Created Feb 2, 2018 — forked from 3noch/
How to add a Keybase user to your repo using git-crypt
keybase pgp pull < user>
gpg --edit-key < user>
  > lsign
  > save
git-crypt add-gpg-user < user>
taktoa /
Last active Oct 26, 2019
A rant about pain points in Haskell, written as a response to

I started writing this polemic to answer your question, but I ended up touching on most of my gripes with Haskell in general, not just in a corporate context.


GHC is a modern compiler with an amazing RTS and tons of features, but I have some issues with it.

Monolithic and Hard to Contribute To