Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/b1nus/aoc20.wat
Advent of Code 2023 in the WebAssembly Text Format.
https://github.com/b1nus/aoc20.wat
Last synced: 17 days ago
JSON representation
Advent of Code 2023 in the WebAssembly Text Format.
- Host: GitHub
- URL: https://github.com/b1nus/aoc20.wat
- Owner: B1nus
- Created: 2024-10-25T16:56:14.000Z (about 2 months ago)
- Default Branch: reading-files
- Last Pushed: 2024-12-01T14:46:04.000Z (21 days ago)
- Last Synced: 2024-12-01T15:33:58.967Z (21 days ago)
- Language: WebAssembly
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Advent of Code 2020 in WAT
Solving [Advent of Code 2020](https://adventofcode.com/2020) in the [WebAssembly Text Format](https://developer.mozilla.org/en-US/docs/WebAssembly/Understanding_the_text_format), the "human-readable" version of WebAssembly. I'm doing this because I need to have a deep understanding of WebAssembly for an upcoming project.# WASI
I'm using [WASI](https://wasi.dev/) for printing to the terminal. To run my files you first need to install the compiler [`wabt`](https://github.com/WebAssembly/wabt) and the runtime [`wasmtime`](https://wasmtime.dev/). Then you can run my programs with: `wat2wasm 5.wat --output=- | wasmtime <(cat)`.> [!NOTE]
> I am not reading the files with WASI because it is a pain. I use `$ wl-paste | sed ':a;N;$!ba;s/\n/\\n/g' | wl-copy < <(cat)` to take the input from my clipboard and format it with `\n` as newlines. So yes I am cheating a little bit.