Skip to content

Instantly share code, notes, and snippets.

View program-analysis.md

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: http://augustss.blogspot.com/2007/10/simpler-easier-in-recent-paper-simply.html
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
domenkozar / README.md
Created Jun 23, 2020
Haskell + GitHub Actions + Cachix
View README.md
View Foo.hs
{-# LANGUAGE
DeriveGeneric,
FlexibleInstances,
FlexibleContexts,
AllowAmbiguousTypes,
ScopedTypeVariables,
TypeApplications,
TypeFamilies,
TypeOperators,
PartialTypeSignatures,
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 = "https://github.com/NixOS/nixpkgs/archive/56d94c8c69f8cac518027d191e2f8de678b56088.tar.gz";
sha256 = "1c812ssgmnmh97sarmp8jcykk0g57m8rsbfjg9ql9996ig6crsmi";
};
in
{ pkgs ? (import nixpkgs-src {}) }:
with pkgs;
with stdenv.lib;
@tazjin
tazjin / thoughts.md
Last active Nov 25, 2021
Nix builder for Kubernetes
View thoughts.md
View gist:08ec29508ffcc7f7f3214bbf94f8a733

I think Gabriel's blogpost http://www.haskellforall.com/2018/08/nixos-in-production.html 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
HiImJulien / Swift Meets CCxx.md
Last active Nov 5, 2021
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 CCxx.md

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


Analytics

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
ezalejski / keybase+git-crypt.md
Created Feb 2, 2018 — forked from 3noch/keybase+git-crypt.md
How to add a Keybase user to your repo using git-crypt
View keybase+git-crypt.md
keybase pgp pull <keybase.io user>
gpg --edit-key <keybase.io user>
  > lsign
  > save
git-crypt add-gpg-user <keybase.io user>
@taktoa
taktoa / haskell-pain-points.md
Last active Oct 26, 2019
A rant about pain points in Haskell, written as a response to https://redd.it/7rwuxb
View haskell-pain-points.md

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

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