plietar / advent-2021

The Advent of Code, but it's a different language every day

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Advent of Code, but it's a different language every day

Solutions

Languages

This is a tentative list of languages that haven't been used yet, subject to change:

  • C++
  • Haskell
  • OCaml
  • Idris
  • Ruby
  • Bash
  • C#
  • Swift
  • ObjC
  • Scala
  • Kotlin
  • Prolog

Structure

Every day of the advent calendar is located in a separate directory. Each directory contains a Makefile with build instructions suitable to the specific language. The Makefile should expose two targets, build/part1 and build/part2, each one of them an executable file that solves the respective parts of the problem. Each executable reads the input data on stdin and produces the output on stdout.

Additionally, each subdirectory contains a default.nix, describing the dependencies necessary to build or execute the solution.

Rules

Solutions may only use the standard library that comes with the default installation, with some exceptions.

Assembly

The assembly solution may use the read, write and mmap functions from the C runtime. The first two are necessary in order to load the input data and produce the output, the latter is used to allocate memory. On Linux, we could have replaced the method calls with system calls, but that is not portable and not officially supported on macOS.

Coq

Coq does not provide a way to perform the necessary I/O used to load the input and produce the data. In fact, there is no such thing as a Coq executable.

Instead, the Coq definitions should be extracted into OCaml, and a thin layer of OCaml code is used to provide the necessary I/O.

As an extended goal, the solution should include a proof of termination and correctness.

About

The Advent of Code, but it's a different language every day


Languages

Language:Assembly 23.8%Language:Pony 14.2%Language:Coq 9.9%Language:Java 9.3%Language:Makefile 5.6%Language:PHP 5.2%Language:JavaScript 4.6%Language:F# 4.5%Language:Rust 3.5%Language:Go 3.5%Language:Perl 3.3%Language:Nix 3.2%Language:Awk 3.1%Language:Lua 1.9%Language:Python 1.4%Language:OCaml 1.1%Language:C 0.8%Language:Standard ML 0.7%Language:Shell 0.1%