Adnan Husain
Final-year computer science. Most of what is on this sheet is Rust: an emulator, a search tool, a crawler, a blockchain, and a bot that races a block.
Every figure is the real rule, running. Click a part to read it.
Lucknow, India · saiyedadnanhussain@gmail.com ·
github.com/Adnan-Husayn
Work
CHIP-8 emulator
rust · sdl2
An interpreter for a 1970s virtual machine: 35 instructions, 4 KB of memory, and a display that draws sprites by XOR, so anything overlapping erases rather than stacks.
The interpreter loop and the display refresh run on separate clocks. Share one and instruction throughput fights frame timing — fast enough to feel responsive and the display tears; slowed to 60 Hz and the games crawl.
language: Rust · display: 64 × 32 · opcodes: 35 · status: complete
A grep clone
rust · memmap · regex
Line-by-line matching spent most of its time allocating rather than comparing. Memory-mapping the file and matching over borrowed slices removed the copies entirely.
Profiling put the allocator above the matcher. Memory-mapping hands you the file as one borrowed slice, so a match becomes a pair of offsets into memory the kernel already paged in. Nothing is copied in order to be looked at.
language: Rust · approach: mmap + slices · allocations: none per line · status: complete
Concurrent web crawler
rust · tokio · reqwest
Throughput is bounded by other people's servers, not by my code, so the work is restraint: capped concurrency, per-host rate limits, a frontier that cannot grow without end.
The frontier is a bounded channel rather than a growing queue. When it fills, producers block — that is the point. Back-pressure means one slow host stalls its own branch instead of letting the queue eat memory until the process dies.
language: Rust · runtime: Tokio · limit: per-host · status: complete
husaynex
rust
A blockchain written from first principles: blocks, hashes, a difficulty target, and a loop that keeps guessing until the leading digits come out right.
Difficulty is a target the hash must fall under, not a count of leading zeros, because a target tunes smoothly and zeros come in steps of sixteen. The nonce is an integer you increment — there is no cleverness in the search at all.
language: Rust · consensus: proof of work · written: from scratch · status: complete
Solana arbitrage bot
rust · tokio · jito
Two exchanges disagree on a price for a few hundred milliseconds. Polling returned too late, so market state lives in memory and WebSocket pushes mutate it in place.
State sits behind an Arc<RwLock<…>>: many readers evaluating, one writer applying each push. Channels were the alternative, but then every consumer keeps its own copy of the book and they drift under load. One shared truth, briefly locked.
language: Rust · venues: Raydium · Orca · ingestion: WebSocket push · status: in progress
Notes — in progress
- What XOR sprites taught me about state — in draft
- Polling is a bet that nothing happened — in draft
- Reading a binary with no documentation — outlined