The server now speaks the real Redis wire format (RESP). You can connect with redis-cli and it will work.
Once the server understands RESP, every Redis client in the world can talk to it. redis-cli, redis-py, the Go and Java drivers — they all send RESP. That compatibility is huge.
make 02-resp-parserIn another terminal:
redis-cli -p 6380 PING # -> PONG
redis-cli -p 6380 SET foo hi # -> "['SET', 'foo', 'hi']" (just echoes for now)If you don't have redis-cli, the parser still works over nc — you just have to type the raw RESP bytes:
printf '*1\r\n$4\r\nPING\r\n' | nc localhost 6380
# -> +PONG- The server logs every parsed command as a Python list
PINGalready returnsPONG(simple string) — that's the only command we've wired so far- Commands like
SET foo hicome back as bulk strings showing the parsed shape
| File | Purpose |
|---|---|
server.py |
RESP parser + RESP encoder + minimal command dispatch |
GUIDE.md |
The RESP grammar from scratch |
EXERCISES.md |
Hand-write RESP frames, handle partial reads |
Step 3 wires up a real in-memory dict so SET foo hi actually stores hi and GET foo returns it.