Stands for ahead-of-time , not attack on titan
Various fun programs using the typescript type language only. Witness the technological terrors I have created.
- TS provides no type-level arithmetic
- The compiler bails out of computing types of certain recursive depth (2000 is too much for example)
You'll need either bun or tsnode or to compile the run.ts
file with tsc
. The run.ts
file uses the typescript compiler api to print the values of type declarations. Or just hover a symbol in your editor, if you have tooling set up.
npm i
# bun
bun run run.ts programs/sieve.ts
# ts-node
ts-node run.ts programs/sieve.ts
# manually
./node_modules/.bin/tsc --target es6 --moduleResolution node --module commonjs run.ts
node run.js programs/sieve.ts
module | description |
---|---|
Int | Binary integer implementation which supports addition, subtraction, multiplication, bitwise and/xor/flip/left shift. |
Function | Lightweight support for higher-order functions (haven't explored too much as of yet) |
List | Tuple-based lists with operations like eq, from, set and tail. Also supports map and filter via the function module. |