This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from colin on the programming languages discord: | |
(in regards to TaPL) | |
got a signed copy in my office | |
I said "Dr Pierce, could you please sign my book?" | |
and he looked repulsed and said | |
"I think you mean my book, you little sweat, bring it over, fatty" | |
I was like "but I'm holding it in front of you" | |
and he was like "sure thing kid, tell your story walking" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE BlockArguments #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE OverloadedLabels #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE FunctionalDependencies #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
{-# LANGUAGE TypeApplications #-} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(eval-when (:compile-toplevel | |
:load-toplevel) | |
(require :asdf) | |
(require :alexandria)) | |
(defpackage risc5-asm | |
(:use common-lisp) | |
(:import-from alexandria format-symbol)) | |
(in-package :risc5-asm) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[derive(Clone, Debug)] | |
enum Term | |
{ Abs(Box<Term>) | |
, App(Box<Term>, Box<Term>) | |
, Var(usize) | |
} | |
fn eval(t: Term, env: &mut Vec<Term>) -> Term | |
{ match t | |
{ Term::Abs(val) => Term::Abs(val) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from copy import deepcopy | |
import operator | |
from pprint import pprint | |
from fractions import Fraction | |
class Matrix: | |
def __init__(self, width, height): | |
self.width = width | |
self.height = height | |
self.size = max(width, height) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Huggable where | |
swap :: (a, b) -> (b, a) | |
swap (a, b) = (b, a) | |
newtype Star f a b = Star { runStar :: a -> f b } | |
newtype Forget r a b = Forget { runForget :: a -> r } | |
class Profunctor p where | |
dimap :: (a -> b) -> (c -> d) -> p b c -> p a d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::convert::TryInto; | |
use std::io::{BufRead, Read, Write}; | |
use std::process::exit; | |
const IMAGE_SIZE: usize = 242000; | |
const NUM_DEVICES: usize = 2; | |
const TIB: usize = 1471; | |
type Cell = i32; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
common lisp | |
zetalisp | |
scheme | |
standard ml | |
lean | |
ocaml | |
haskell | |
idris | |
myrddin | |
coq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE RankNTypes | |
, BlockArguments | |
, GADTs | |
, MultiParamTypeClasses | |
, OverloadedLabels | |
, DataKinds | |
, PolyKinds | |
, FunctionalDependencies | |
, AllowAmbiguousTypes | |
, TypeApplications |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <gc.h> | |
typedef enum { | |
APP, | |
CON, | |
COMB, | |
} tag_t; |
NewerOlder