Skip to content

Instantly share code, notes, and snippets.

View isubasinghe's full-sized avatar
👨‍🎓
Trying to study hard

Isitha Subasinghe isubasinghe

👨‍🎓
Trying to study hard
View GitHub Profile
@isubasinghe
isubasinghe / hamt.c
Created December 15, 2023 11:31 — forked from robalni/hamt.c
#include <stdio.h>
#include <string.h>
#include <stdint.h>
static uint64_t hash_str(char *data) {
uint64_t prime = 0x100000001b3;
uint64_t hash = 0xcbf29ce484222325;
for (size_t i = 0; data[i]; i++) {
hash ^= (unsigned char)data[i];
hash *= prime;
@isubasinghe
isubasinghe / WellTyped.hs
Created August 24, 2023 10:48 — forked from AndrasKovacs/WellTyped.hs
Well-typed interpreter from the Idris tutorial (http://eb.host.cs.st-andrews.ac.uk/writings/idris-tutorial.pdf) in Haskell.
{-# LANGUAGE
LambdaCase, GADTs, TypeOperators, TypeFamilies, DataKinds #-}
data Type = TInt | TBool | Type :=> Type
-- Needs GHC >= 7.8
type family Interp (t :: Type) where
Interp TInt = Int
Interp TBool = Bool
Interp (a :=> b) = Interp a -> Interp b
@isubasinghe
isubasinghe / CoC.ml
Created March 27, 2023 07:04 — forked from Hirrolot/CoC.ml
How to implement dependent types in 80 lines of code
type term =
| Lam of (term -> term)
| Pi of term * (term -> term)
| Appl of term * term
| Ann of term * term
| FreeVar of int
| Star
| Box
let unfurl lvl f = f (FreeVar lvl)
@isubasinghe
isubasinghe / borrow_inference.md
Created November 27, 2021 12:16 — forked from paniq/borrow_inference.md
Borrow Inference

Borrow Inference

by Leonard Ritter, Duangle GbR

This document has only historical significance and does not describe the borrow checker as it is now implemented. Please see this document for a more recent description.

This is a description of borrow inference, an alternative to borrow checking that requires no declarative annotations to support proper management of unique values and borrowed references at compile time.

@isubasinghe
isubasinghe / type-systems.txt
Created November 11, 2021 08:43 — forked from dicej/type-systems.txt
Type system learning notes
Classes
* Keith Devlin - Introduction to Mathematical Thinking - https://www.coursera.org/learn/mathematical-thinking
* Michael Genesereth - Introduction to Logic - https://www.coursera.org/learn/logic-introduction
* Robert Harper - Homotopy Type Theory - http://www.cs.cmu.edu/~rwh/courses/hott/
Books and Articles
* Benjamin C. Pierce - Types and Programming Languages - https://www.cis.upenn.edu/~bcpierce/tapl/
* x775 - Introduction to Datalog - https://x775.net/2019/03/18/Introduction-to-Datalog.html
* Bartosz Milewski - Category Theory For Programmers - https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/
* Benjamin C. Pierce et al. - Software Foundations - https://softwarefoundations.cis.upenn.edu/

#Distributed System Course List

##Systems

  • Cornell CS 614 - Advanced Course in Computer Systems - Ken Birman teaches this course. The readings cover more distributed systems research than is typical (which I am in favour of!). In fact, there's barely anything on traditional internal OS topics like filesystems or memory management. There's some worthwhile commentary at the bottom of the page.

  • Princeton COS 518 - Advanced Operating Systems - short and snappy reading list of two papers per topic, covering some interesting stuff like buffering inside the operating system, and L4.

@isubasinghe
isubasinghe / zigzag-encoding.README
Created December 28, 2020 11:57 — forked from mfuerstenau/zigzag-encoding.README
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation