advent-of-code/2021
2021-12-09 10:48:05 -06:00
..
.gitignore Cleanup 2021-12-06 11:39:34 -06:00
1.test.ts Add test 2021-12-01 11:48:34 -06:00
1.ts Benchmarking 2021-12-01 16:41:27 -06:00
2.ts Lots of cleanup for nim solutions and day 2 solutions in nim 2021-12-02 11:00:05 -06:00
3.test.ts Day 3 part 1 done 2021-12-03 09:36:46 -06:00
3.ts Part 1 in nim 2021-12-03 11:47:18 -06:00
6.zig Day 7 part 1 brute-forced 2021-12-07 10:06:34 -06:00
common.nim Finish day 8 2021-12-08 11:33:18 -06:00
common.ts Day 2 part 1 done 2021-12-02 08:37:00 -06:00
common.zig Day 7 part 1 brute-forced 2021-12-07 10:06:34 -06:00
deps.ts Update fs mod 2021-12-01 10:49:24 -06:00
eight.nim Cleanup 2021-12-08 11:35:50 -06:00
five.nim Day 5 prt 2 2021-12-05 14:22:46 -06:00
four.nim Day 4 part 2 2021-12-05 10:32:03 -06:00
nine.nim Day 9 part 2 done 2021-12-09 10:48:05 -06:00
one.nim Forget this - not doing it tonight 2021-12-07 23:05:47 -06:00
readme.md Finish day 8 2021-12-08 11:33:18 -06:00
seven.nim WIP 2021-12-08 09:24:15 -06:00
six.nim Simplify 2021-12-06 09:51:20 -06:00
three.nim Remove echos 2021-12-03 15:54:22 -06:00
two.nim Cleanup whitespace 2021-12-02 11:37:53 -06:00

2021

This year, I've been tinkering a lot with Deno as a TypeScript runtime and have been really enjoying it. I'm hoping to write this year's AoC solutions using it.

Specifically, here's my deno --version output:

deno 1.16.3 (release, x86_64-unknown-linux-gnu)
v8 9.7.106.5
typescript 4.4.2

Enjoy!

EDIT: Since performance is not what I would like, it looks like I'm also doing some of these in Nim.

EDIT 2: I sprinkled some zig in there. I've been meaning to mess with it for a while.

Usage

Run these solutions like so:

deno run --unstable --allow-all $DAY.ts

And the Nim ones like so:

nim c -d:release -d:ssl --run $DAYMODULE.nim

And the Zig ones like so:

zig build-exe -O ReleaseFast 6.zig -femit-bin=build/zig-$DAY
./build/zig-$DAY

And if you want to measure memory usage with Deno programs:

mkdir -p build
deno compile --output build/$DAY --unstable --allow-all $DAY.ts
/usr/bin/time -v ./build/$DAY

Or for Nim programs:

mkdir -p build
nim c -d:release -d:ssl --outdir:build $DAYMODULE.nim
/usr/bin/time -v ./$DAYMODULE

Or for Zig programs:

mkdir -p build
zig build-exe -O ReleaseFast 6.zig -femit-bin=build/zig-$DAY
/usr/bin/time -v ./build/zig-$DAY

Days

  • Day 1: Deno, Nim
  • Day 2: Deno, Nim
  • Day 3: Deno, Nim
  • Day 4: Nim
  • Day 5: Nim
  • Day 6: Nim
  • Day 7: Nim
  • Day 8: Nim
  • Day 9
  • Day 10
  • Day 11
  • Day 12
  • Day 13
  • Day 14
  • Day 15
  • Day 16
  • Day 17
  • Day 18
  • Day 19
  • Day 20
  • Day 21
  • Day 22
  • Day 23
  • Day 24
  • Day 25