Redis in Rust: Testing redis-cli + GET/SET support

And I’m back. It’s been a busy month with the [Genuary]([Genuary 2023]) series and life in general, but I’m still thinking about Redis in general 😄.

Up this time, let’s see what the official redis-cli app does when talking to our client and actually start handling some commands. Specifically, the very basic commands: SET and GET. With that, we would actually have a (very very basic) keystore up and running!

read more...


Cloning Redis in Rust: RESP [Part 1]

Recently, I read through Build Your Own Redis with C/C++. C/C++ are ugly, so let’s run through it in Rust!

My goal: implement some large subset of Redis (both server and client) in Rust. For any features I implement, it should be compatible with Redis off the shelf. I should be able to use their client with my server and their server with my client and it should just work.

No idea if this is going to work out, but it sounds like an interesting problem!

First task: the REdis Serialization Protocol (RESP).

read more...


AoC 2022 Day 13: List Parsinator

Source: Distress Signal

Part 1

Given pairs of Signals (where a Signal is a nested list ;example: [[1],[2,3,4]]), count how many pairs are ‘in order’.

One Signal is less than the other if:

  • Both are an integer and the first is less than the second
  • Both are a list and the first value is less than the second
    • If the first values are the same, compare the second
    • If the first has fewer elements, it is treated as less than the second
  • When comparing an integer and a list, wrap the integer as a single element list and compare them

read more...


AoC 2022 Day 11: Monkeyinator

Source: Monkey in the Middle

Part 1

Simulate a collection of ‘monkeys’. Each monkey will have a number of items which it will then apply a mathematical operation to, then always divide by 3, then test divisibility to pass to one of two other monkeys. Return as answer the product of the two highest number of times a monkey applies it’s main function to individual items after 20 steps.

Note: Monkeys will always be evaluated in order (so monkey 1 will evaluate any items passed by monkey 0 again in the same round).

read more...


AoC 2021 Day 10: Chunkinator

Source: Syntax Scoring

Part 1: Given a sequence of () [] {}, and <> with nesting allowed. Find the first syntax error (where the wrong closing symbol is used). Scoring 3, 57, 1197, and 25137 respectively for each error, calculate the total error score.

read more...