218 results for "":
The curse of strong typing
It happened when I least expected it.
Someone, somewhere (above me, presumably) made a decision. “From now on”, they declared, “all our new stuff must be written in Rust”.
I’m not sure where they got that idea from. Maybe they’ve been reading propaganda. Maybe they fell prey to some confident asshole, and convinced themselves that Rust was the answer to their problems.
On the subject of time
An ooc quine
While preparing my next post about ooc documentation yet again, I stumbled upon an old ooc quine of mine. Here it is in integrality for your pleasure:
q := 34 as Char
l := [
"q := 34 as Char"
"l := ["
"]"
"for (i in 0..2) {"
" l[i] println()"
"}"
"for (i in 0..12) {"
" q print(); l[i] print(); q println()"
"}"
"for (i in 2..12) {"
" l[i] println()"
"}"
]
for (i in 0..2) {
l[i] println()
}
for (i in 0..12) {
q print(); l[i] print(); q println()
}
for (i in 2..12) {
l[i] println()
}
Day 12 (Advent of Code 2022)
Alright! The day 12 puzzle involves path finding, and it seems like a good time to lean more heavily on the WASM embeds I’ve set up for the previous parts.
Let’s start by setting up the types we’ll want!
Types and parsing
Our input is a heightmap, like so:
Sabqponm
abcryxxl
accszExk
acctuvwj
abdefghi
Where 'a'..='z' is a square with a given elevation (from lowest to highest),
S is the start, and E is the end.
Day 3 (Advent of Code 2020)
Hello all, and welcome back to Advent of Code 2020, featuring Cool Bear.
Hey y’all!
Let’s get right to it.
The problem statement for Day 3 is as follows: we’re given a map, that looks like this:
..##.......
#...#...#..
.#....#..#.
..#.#...#.#
.#...##..#.
..#.##.....
.#.#.#....#
.#........#
#.##...#...
#...##....#
.#..#...#.#
And we imagine that it repeats infinitely to the right, like so:
Using the Shipyard private crate registry with Docker
Wait wait wait, so we’re not talking about nix yet?
Well, no! The service we have is pretty simple, and I want to complicate things a bit, to show how things would work in both the Dockerfile and the nix scenario.
And because I don’t like contrived examples, we’re going to do something somewhat real-world: we’re going to geo-locate visitors, and track how many visits we get from each country.
The iterative nature of art
Generating a docker image with nix
There it is. The final installment.
Over the course of this series, we’ve built a very useful Rust web service that shows us colored ASCII art cats, and we’ve packaged it with docker, and deployed it to https://fly.io.
We did all that without using nix at all, and then in the last few chapters,
we’ve learned to use nix, and now it’s time to tell docker build goodbye,
along with this whole-ass Dockerfile:
Aiming for correctness with types
The Nature weekly journal of science was first published in 1869. And after one and a half century, it has finally completed one cycle of carcinization, by publishing an article about the Rust programming language.
It’s a really good article.
What I liked about this article is that it didn’t just talk about performance, or even just memory safety - it also talked about correctness.
Just paying Figma $15/month because nothing else fucking works
My family wasn’t poor by any stretch of the imagination, but I was raised to avoid spending money whenever possible.
I was also taught “it’s a poor craftsman that blames their tools”, which apparently means “take responsibility for your fuckups”, but, to young-me, definitely sounded more like “you don’t deserve nice things”.
I was also taught from an early age that I was born a sinner, incapable of doing good by myself, and that all the earthly things were temptations, sent by the devil to corrupt me (further I guess?) but also temporary, and that I shouldn’t attach myself.