Skip to content

Instantly share code, notes, and snippets.

View jamesdbrock's full-sized avatar

James Brock jamesdbrock

View GitHub Profile
@VictorTaelin
VictorTaelin / itt-coc.ts
Last active January 26, 2025 18:02
ITT-Flavored Calculus of Constructions Type Checker
// A nano dependent type-checker featuring inductive types via self encodings.
// All computation rules are justified by interaction combinator semantics,
// resulting in major simplifications and improvements over old Kind-Core.
// Specifically, computable annotations (ANNs) and their counterpart (ANN
// binders) and a new self encoding based on equality (rather than dependent
// motives) greatly reduce code size. A more complete file, including
// superpositions (for optimal unification) is available on the
// Interaction-Type-Theory repository.
// Credits also to Franchu and T6 for insights.
@kamenchunathan
kamenchunathan / Json.purs
Created March 16, 2023 16:07
playing with parser combinators
module Data.Json (Json(..), JsonValue(..)) where
import Prelude
import Data.String (joinWith)
import Data.Tuple (Tuple(..))
data JsonValue
= JsonString String
| JsonNumber Number
@GuillaumeDesforges
GuillaumeDesforges / nixos_python_patch_venv_bins.md
Last active April 21, 2025 03:30
How to: make Python dependencies installed via pip work on NixOS

EDIT: check out fix-python instead, make Python run "as usual" on NixOS!

How to: make Python dependencies installed via pip work on NixOS

The issue

  • You are using NixOS
  • You start working on a Python project
  • You manage the dependencies in a classic Python virtual environment using pip or poetry
@gdamjan
gdamjan / future-vs-task.py
Created December 23, 2021 13:40
futures are lazy, tasks are eager (in async python)
import asyncio
async def test(s, n):
print(f' {s} started')
await asyncio.sleep(n)
print(f' {s} ends')
async def main():
@jul1u5
jul1u5 / Gradually Typed Hasktorch.md
Last active September 3, 2021 09:49
Google Summer of Code 2021 Final Report

Report for GSoC 2021 (Gradually Typed Hasktorch)

This is the final report for the GSoC 2021 project - Gradually Typed Hasktorch. Gradually Typed Hasktorch is a new tensor API for Hasktorch. It has been initiated by my mentor, Torsten Scholak, and as part of GSoC I helped with streamlining this new API.

Student: Julius Marozas Mentor: Torsten Scholak

Index

@Gabriella439
Gabriella439 / me.md
Created July 23, 2021 00:59
That's me!

As I come out as trans to people, most are supportive, but a few people remain skeptical and question my feelings and experiences. I try to field their concerns to the best of my ability, but one particular concern they raise is so common and so far off the mark that I feel compelled to share my thoughts on this. My intention is not to shame them, but rather to use this as an opportunity to share my own experiences.

Their concern typically goes like this: they believe that many people who transition do so because they are too easily suggestible and that they have been over-exposed to trans role models (either friends or people on social media).

@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active April 12, 2025 00:19
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u

@privatenumber
privatenumber / light-dark-image.svg
Last active October 22, 2024 05:40
Light/dark mode SVG image
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AndrasKovacs
AndrasKovacs / FlatParseNotes.hs
Created March 20, 2021 16:46
Session notes about flatparse library
-- flatparse: hackage 0.1.1.1
-- example: smaltt (demo for fast elaborator): switching from megaparsec to flatparse would speed up more than 2x overall
-- 1 year ago:
-- parsec : ridiculously slow, CPS implementation
-- attoparsec : (resumable, CPS), "high-performance" data parsing, binary parsing, not language parsing
-- fringe, modern:
-- parsnip: (unpublished on hackage) (by Kmett, on github) : really the high-performance raw data parsing (not language parsing)
@mbbx6spp
mbbx6spp / nix-yarn2nix-bundix-packaging.org
Created November 15, 2018 21:41
Quick notes on what worked to package a frontend yarn JS project and how to update gems in an existing Ruby project using bundix for Nix based configuration.

Random Nix Project Packaging (yarn2nix, bundix -l)

Setting up a nodejs project via yarn2nix in Nix for existing project

  • nix-shell -p yarn yarn2nix nodejs
  • copied the Nix skeleton files in place (./z/etc/lib/{version,nixpkgs}.nix ./z/etc/overlays/default.nix)
  • generated package.nix using yarn2nix
  • add these Nix expressions in the root