Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/michaeladler/aoc-2020
My solutions for the Advent of Code 2020
https://github.com/michaeladler/aoc-2020
advent-of-code advent-of-code-2020 aoc aoc2020 lua
Last synced: 18 days ago
JSON representation
My solutions for the Advent of Code 2020
- Host: GitHub
- URL: https://github.com/michaeladler/aoc-2020
- Owner: michaeladler
- License: apache-2.0
- Created: 2022-03-24T17:11:01.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-24T21:33:55.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T01:45:06.274Z (2 months ago)
- Topics: advent-of-code, advent-of-code-2020, aoc, aoc2020, lua
- Language: Lua
- Homepage:
- Size: 193 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CI](https://github.com/michaeladler/aoc-2020/actions/workflows/ci.yml/badge.svg)](https://github.com/michaeladler/aoc-2020/actions/workflows/ci.yml)
# AoC 2020
My second [Advent of Code](https://adventofcode.com/2020) event.
This year I used [LuaJIT](https://luajit.org/).## Lessons Learned
* LuaJIT is amazingly fast (the fastest scripting language as of 2020)
* [luaprompt](https://github.com/dpapavas/luaprompt) is great for rapid prototyping
* Lack of 64-bit integers in LuaJIT can be a problem
**Workarounds**:
* use a shared library (e.g. written in C) and use LuaJIT's awesome FFI.
* use Lua 5.4 which is quite fast too
* It is rather annoying that tables cannot be used as keys in other tables; use hacks like `string.format` to serialize the table and use it as a key
* Lua's default behavior to return `nil` instead of an out-of-bounds error for accessing non-existing table keys is *great*
* [Penlight's](http://stevedonovan.github.io/Penlight/api/index.html) most useful feature was the `__tostring` implementations for tables (which helped a lot in the REPL)