{"id":16668443,"url":"https://github.com/ekzhang/aoc21-alpha","last_synced_at":"2025-04-09T19:32:27.729Z","repository":{"id":107896617,"uuid":"439956700","full_name":"ekzhang/aoc21-alpha","owner":"ekzhang","description":"Advent of Code 2021 in 25 different languages, alphabet soup edition","archived":false,"fork":false,"pushed_at":"2021-12-25T19:55:32.000Z","size":96,"stargazers_count":13,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-23T21:23:24.854Z","etag":null,"topics":["advent-of-code","advent-of-code-2021","algorithms","alphabet-soup","competitive-programming","polyglot","programming-languages"],"latest_commit_sha":null,"homepage":"","language":"Crystal","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ekzhang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-19T20:02:38.000Z","updated_at":"2023-11-28T08:28:03.000Z","dependencies_parsed_at":"2023-03-15T08:30:17.684Z","dependency_job_id":null,"html_url":"https://github.com/ekzhang/aoc21-alpha","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekzhang%2Faoc21-alpha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekzhang%2Faoc21-alpha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekzhang%2Faoc21-alpha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ekzhang%2Faoc21-alpha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ekzhang","download_url":"https://codeload.github.com/ekzhang/aoc21-alpha/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248097973,"owners_count":21047346,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advent-of-code","advent-of-code-2021","algorithms","alphabet-soup","competitive-programming","polyglot","programming-languages"],"created_at":"2024-10-12T11:25:19.493Z","updated_at":"2025-04-09T19:32:27.721Z","avatar_url":"https://github.com/ekzhang.png","language":"Crystal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# aoc21-alpha\n\n[![](https://tokei.rs/b1/github/ekzhang/aoc21-alpha)](https://github.com/ekzhang/aoc21-alpha)\n\n_Advent of Code 2021, but I solve the puzzles with 25 different programming languages **starting with each letter of the alphabet**._\n\nThe goal of this exercise was to learn some less-common programming languages that I've been curious about, in various paradigms, compilation modes, and historical contexts. Whenever there was a choice between multiple excellent languages for a given day's puzzle, I chose the one that I had the least familiarity with.\n\nThis was obviously intellectually challenging and pretty tough on environment setup, but hey, challenge is an essential part of exploration! ✨\n\n## Learnings\n\nSee [`LEARNINGS.md`](./LEARNINGS.md) for some final observations about this experience.\n\n## Schedule\n\nTo make things a little more tractable, I'm going through the alphabet in reverse order, since the hardest problems are at the end.\n\n1. [Zig](https://ziglang.org/) — [problem](https://adventofcode.com/2021/day/1), [solution](./day1)\n2. [x86 Assembly](https://en.wikipedia.org/wiki/X86_assembly_language) — [problem](https://adventofcode.com/2021/day/2), [solution](./day2)\n3. [WebAssembly](https://webassembly.org/) — [problem](https://adventofcode.com/2021/day/3), [solution](./day3)\n4. [V](https://vlang.io/) — [problem](https://adventofcode.com/2021/day/4), [solution](./day4)\n5. [Unix Shell (Zsh)](https://www.zsh.org/) — [problem](https://adventofcode.com/2021/day/5), [solution](./day5)\n6. [TypeScript](https://www.typescriptlang.org/) — [problem](https://adventofcode.com/2021/day/6), [solution](./day6)\n7. [Scala](https://www.scala-lang.org/) — [problem](https://adventofcode.com/2021/day/7), [solution](./day7)\n8. [Ruby](https://www.ruby-lang.org/en/) — [problem](https://adventofcode.com/2021/day/8), [solution](./day8)\n9. [Q (SQL)](https://github.com/harelba/q) — [problem](https://adventofcode.com/2021/day/9), [solution](./day9)\n10. [Prolog](https://www.swi-prolog.org/) — [problem](https://adventofcode.com/2021/day/10), [solution](./day10)\n11. [OCaml](https://ocaml.org/) — [problem](https://adventofcode.com/2021/day/11), [solution](./day11)\n12. [Nim](https://nim-lang.org/) — [problem](https://adventofcode.com/2021/day/12), [solution](./day12)\n13. [MoonScript](https://moonscript.org/) — [problem](https://adventofcode.com/2021/day/13), [solution](./day13)\n14. [Lisp (SBCL)](https://common-lisp.net/) — [problem](https://adventofcode.com/2021/day/14), [solution](./day14)\n15. [Kotlin](https://kotlinlang.org/) — [problem](https://adventofcode.com/2021/day/15), [solution](./day15)\n16. [Julia](https://julialang.org/) — [problem](https://adventofcode.com/2021/day/16), [solution](./day16)\n17. [Idris](https://www.idris-lang.org/) — [problem](https://adventofcode.com/2021/day/17), [solution](./day17)\n18. [Haskell](https://www.haskell.org/) — [problem](https://adventofcode.com/2021/day/18), [solution](./day18)\n19. [Go](https://go.dev/) — [problem](https://adventofcode.com/2021/day/19), [solution](./day19)\n20. [F#](https://fsharp.org/) — [problem](https://adventofcode.com/2021/day/20), [solution](./day20)\n21. [Elixir](https://elixir-lang.org/) — [problem](https://adventofcode.com/2021/day/21), [solution](./day21)\n22. [Dart](https://dart.dev/) — [problem](https://adventofcode.com/2021/day/22), [solution](./day22)\n23. [Crystal](https://crystal-lang.org/) — [problem](https://adventofcode.com/2021/day/23), [solution](./day23)\n24. [Boolector (BTOR)](https://boolector.github.io/) — [problem](https://adventofcode.com/2021/day/24), [solution](./day24)\n25. [AssemblyScript](https://www.assemblyscript.org/) — [problem](https://adventofcode.com/2021/day/25), [solution](./day25)\n\n## Development\n\nFirst, create a `.env` file containing your session token from the Advent of Code website, so that the input data can be downloaded. For example:\n\n```\nSESSION=30b5d4e5790f02d4c32c71f59f10d5f2f6adfcf5b4c064c64a689ab02b4beb3e84bf74857e40cc9fe31088972fedeb64\n```\n\nThen, if you have [Python 3](https://python.org/) and [Just](https://github.com/casey/just) installed, as well as the language runtime for a given day's solution, you can load the input data and run the solution with:\n\n```\njust run \u003cday1|day2|...\u003e\n```\n\nEach day's solutions are located in their respective folder `dayN`. The source code reads from standard input, and it is executed using the script `run.sh`.\n\n## Complete Run\n\nIf you have all of the required packages for the 25 languages installed, you can run all of the solutions sequentially with the command:\n\n```\njust run-all\n```\n\nThis takes about a minute on my computer, since it needs to compile code in addition to running it.\n\n## Runtime Environment\n\nThis is my runtime environment for each language on macOS Monterey v12.0.1, M1 / ARM64 processor, with Rosetta 2 and Xcode CLT. I only used languages that I could install on my own machine; these instructions aren't guaranteed to work on other operating systems or processor architectures.\n\n- **Day 1:** Zig 0.10.0-dev.2028+ea913846c (`brew install zig --HEAD`).\n- **Day 2:** Apple clang version 13.0.0, target arm64-apple-darwin21.1.0.\n- **Day 3:** Binaryen version 102 (`brew install binaryen`).\n- **Day 4:** V 0.2.4 b72a2de (`brew install vlang`).\n- **Day 5:** Zsh 5.8 (x86_64-apple-darwin21.0).\n- **Day 6:** TypeScript 4.5.4 (`npm install -g typescript`).\n- **Day 7:** Scala 3.1.0 (`brew install coursier \u0026\u0026 cs install scala3 scala3-compiler`).\n- **Day 8:** Ruby 3.0.3p157 for arm64-darwin21 (`brew install ruby`).\n- **Day 9:** q version 2.0.20 (`brew install harelba/q/q`).\n- **Day 10:** SWI-Prolog 8.4.1 for arm64-darwin (`brew install swi-prolog`).\n- **Day 11:** OCaml 4.12.0 (`brew install opam \u0026\u0026 opam switch create 4.12.0`).\n- **Day 12:** Nim 1.6.2 [MacOSX: arm64] (`brew install nim`).\n- **Day 13:** MoonScript dev-1-b7efcd13 (`luarocks install moonscript --dev`), Lua 5.4.3, LuaRocks 3.8.0 (`brew install lua`).\n- **Day 14:** Roswell 21.10.14.111 (`brew install roswell`), SBCL 2.1.11 (`ros install sbcl`).\n- **Day 15:** Kotlin 1.6.10-release-923 (JRE 17.0.1+1) (`brew install kotlin`).\n- **Day 16:** Julia 1.7.0 (`brew install --cask julia`).\n- **Day 17:** Idris2 0.5.1, x86_64 version (`arch -x86_64 /usr/local/bin/brew install idris2`).\n- **Day 18:** GHC 8.10.7, Cabal 3.6.2.0 (`brew install ghc cabal-install`).\n- **Day 19:** Go 1.17.5, darwin/arm64 (`brew install go`).\n- **Day 20:** .NET Core SDK 3.1.416 (`brew install --cask dotnet-sdk`).\n- **Day 21:** Elixir 1.13.1, Erlang/OTP 24.2 (`brew install elixir`).\n- **Day 22:** Flutter 2.8.1, Dart 2.15.1 (`brew install --cask flutter`).\n- **Day 23:** Crystal 1.2.2 (`brew install crystal`).\n- **Day 24:** Boolector 3.2.0 (`brew tap mht208/formal \u0026\u0026 brew install boolector`).\n- **Day 25:** AssemblyScript 0.19.22.\n\nNote that while exact version numbers are provided above, the code will likely work with newer versions of these languages as well. Also, assume a global dependency on Python 3.9+, Node v16+, and NPM v8+.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekzhang%2Faoc21-alpha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fekzhang%2Faoc21-alpha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fekzhang%2Faoc21-alpha/lists"}