Skip to content
View alirezaudev's full-sized avatar

Organizations

@gocasts-bootcamp @Almas-Company @alirezaudev-archive

Block or report alirezaudev

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Content in all repositories owned by your account will be closed.
Maximum 250 characters. Please don’t include any personal information such as legal names or email addresses. This note will only be visible to you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
alirezaudev/README.md
Alireza Mousavi, backend engineer since 2021. I like knowing why things are built the way they are, so I keep going one layer down. So far: Go and Laravel in production, algorithm practice in Go, Python and PHP, and Redis, DNS and HTTP rebuilt in Go. Now: operating system and networking internals. Next: my own SQLite from scratch, then system design in depth.

ttype GitHub stars

A typing test for people who live in the terminal. I kept tabbing out to a browser to warm up, so I wrote the thing I kept opening. Code modes (Go, SQL, Python, shell, regex), keystroke replays, a wpm chart, and a heatmap of the keys you actually miss. One static Go binary.

ttype: one sentence typed with one typo, and the results screen

curl -fsSL https://raw.githubusercontent.com/alirezaudev/ttype/main/install.sh | sh

Rebuilt from scratch, in Go

I rebuild tools I use every day to see how they work, with the standard library only. Each one came down to one trade-off:

                          The problem What I did What it costs
Redis A hundred clients share one map. A command that reads and then writes must not have another client land in between. One goroutine owns the map. Every command is a message to it, so each one runs whole. Commands run one at a time, on one core. Real Redis makes the same trade.
DNS A reply repeats the same name in every record and has to fit in 512 bytes. Point back at bytes already sent (name compression). Every parser now follows pointers written by strangers. A hostile packet can loop them forever, so I stop at 20 hops.
HTTP On a reused connection, a handler that skips the body leaves the next request starting mid-sentence. Drain whatever the handler didn't read before parsing the next request. Mine reads all of it, so a client can make me read 10 GB nobody asked for. net/http drains 256 KB, then hangs up.

Silver medal, Quera Tech Olympics 2024 (PHP/Laravel) · practice and older work in alirezaudev-archive

Pinned Loading

  1. ttype ttype Public

    A typing test for people who live in the terminal

    Go 31 1

  2. redis-from-scratch redis-from-scratch Public

    Redis server from scratch in Go: one goroutine owns the data, so there are no locks

    Go 1

  3. dns-server-from-scratch dns-server-from-scratch Public

    DNS server from scratch in Go: parses and follows name compression, with a cap on pointer hops

    Go

  4. http-server-from-scratch http-server-from-scratch Public

    HTTP/1.1 server from scratch in Go: keep-alive, and draining unread bodies between requests

    Go