Skip to content

Instantly share code, notes, and snippets.


Kartik Singhal k4rtik

View GitHub Profile
k4rtik / coq-platform.log
Created November 9, 2021 22:18
coq platform install log on macOS arm64
View coq-platform.log
kartik@Kira platform-2021.09.0 % ./
====================== JUST COQ OR COMPLETE PLATFORM ? =======================
This script installs the Coq Platform version 2021.09.0, that is:
- the Coq compiler and Coq's standard library
- optionally CoqIDE, a GTK3 based graphical user interface
- optionally various widely used libraries and plugins
- optionally an extended set of libraries and plugins
The script uses opam, the OCaml package manager, to do all the work.
k4rtik /
Created April 26, 2020 16:46
SML/NJ install script for 64-bit install in ~/.local
cd /tmp
mkdir -p smlnj && cd smlnj
tar -xzf config.tgz
mkdir -p ~/.local
env INSTALLDIR=~/.local config/ -default 64
k4rtik / snapcraft.yaml
Created April 25, 2020 16:52
Experimental snapcraft.yaml for SML/NJ
View snapcraft.yaml
name: smlnj
title: Standard ML of New Jersey
version: "110.97"
summary: The Standard ML of New Jersey system
description: |
Standard ML of New Jersey (abbreviated SML/NJ) is a
compiler for the Standard ML '97 programming language
with associated libraries, tools, and documentation.
View coqtop killed
[52791.541304] coqtop invoked oom-killer: gfp_mask=0x100dca(GFP_HIGHUSER_MOVABLE|__GFP_ZERO), order=0, oom_score_adj=0
[52791.541307] CPU: 6 PID: 17667 Comm: coqtop Tainted: G U 5.2.8-arch1-1-ARCH #1
[52791.541308] Hardware name: Dell Inc. XPS 13 9370/0F6P3V, BIOS 1.11.1 07/11/2019
[52791.541308] Call Trace:
[52791.541315] dump_stack+0x5c/0x80
[52791.541318] dump_header+0x51/0x32d
[52791.541320] ? preempt_count_add+0x79/0xb0
[52791.541322] ? _raw_spin_lock+0x13/0x30
[52791.541323] ? preempt_count_add+0x79/0xb0
[52791.541324] ? _raw_spin_trylock+0x13/0x50
k4rtik /
Created August 15, 2019 21:21
Steps to get quipper to work
rm -rf ~/.cabal ~/.stack ~/.ghc ~/.ghcup
curl -sSL | sh
stack --resolver lts-7.24 setup
stack install cabal-install
export PATH=~/.stack/programs/x86_64-linux/ghc-tinfo6-8.0.1/bin:$PATH
cabal update
cabal install superdoc- random-1.1 mtl-2.2.1 primes- zlib- easyrender- Lattices fixedprec newsynth containers set-monad- QuickCheck
make -j8
docker build -t="dockerfile/ubuntu"
docker run -it dockerfile/ubuntu
## Inside the container
apt update
apt install -y libgmp3-dev freeglut3-dev zlib1g-dev libreadline-dev llvm-3.4 clang
wget -c
tar xf ghc-7.4.2-x86_64-unknown-linux.tar.bz2
cd ghc-7.4.2
ln -s /usr/lib/x86_64-linux-gnu/ /usr/lib/
k4rtik / gentags
Created August 24, 2017 22:09
For generating cscope tags for a C/C++ project
View gentags
if [ ! -d "$CSCOPE_DIR" ]; then
mkdir "$CSCOPE_DIR"
echo "Finding files ..."
find "$PWD" -name '*.[ch]' \
k4rtik /
Created October 27, 2016 16:22
Datalink layer for implementing IP over UDP
View parallel-cleanup-format
#!/usr/bin/env bash
# note: clang-tidy only accepts one file at a time, but we can run it
# parallel against disjoint collections at once.
find . \( -name \*.c -or -name \*.cpp -or -name \*.cc -or -name \*.h \) | xargs -n1 -P4 cleanup-tidy
# clang-format accepts multiple files during one run, but let's limit it to 12
# here so we (hopefully) avoid excessive memory usage.
find . \( -name \*.c -or -name \*.cpp -or -name \*.cc -or -name \*.h \) | xargs -n12 -P4 cleanup-format -i
View cleanup-format
#!/usr/bin/env bash
clang-format -style="{BasedOnStyle: llvm, IndentWidth: 4, AllowShortFunctionsOnASingleLine: None, KeepEmptyLinesAtTheStartOfBlocks: false}" "$@"