Harsh Agarwal (@harsh_agw) profile picture

Software Developer

Bengaluru, India
Joined November 2015
Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)Photo by Harsh Agarwal (@harsh_agw)
Picking Viri back up again. This was a great recap of what’s happening under the hood.
Built a TUI debugger for Viri’s VM and I’m genuinely excited about this one. It steps through bytecode and shows everything live: stack, frames (ip / bp), locals, globals, constants, and closure cells. No abstractions, just execution. Watching this run makes the execution model explicit. Locals, arguments, and temporaries are just slots in a single stack array. Variables move to heap-allocated cells only when they escape, with stack slots holding references. A frame is simply an offset into the stack. Closures are functions paired with those cells. Would love to hear what helped make these ideas concrete for others. ⚙️🧠 Thanks @charmcli for the awesome lipgloss library! 🎨
1
2
139
Dropped by Cafe Cursor Bangalore @cursor_ai today. Was there only for a bit, but the energy was great. Cool to see what everyone’s building. 🚀 – at Bengaluru, India
5
150
We are live🔥. Check out the game
WE ARE LIVE! play in worlds inspired by Indian pop culture, all generated using @NanoBanana. > here is a quick video showing the actual gameplay > we are still early and would love any feedback, suggestions or any specific worlds you'd like to see! link in the first comment. built using @cursor_ai @NanoBanana @SarvamAI
2
3
131
Harsh Agarwal retweeted
incredible week in India. two things stood out: 1) the moment for builders is now. I’ve spent this year with builder communities around the world and the same energy keeps showing up: people building for their own local use cases, on their own terms. India might be the strongest example yet. 2) we’re still so early. many innings left in this game
12
3
1
82
4,420
Still can't believe it. We won 🥇 1st place at the @GoogleDeepMind × @cerebral_valley Hackathon Bangalore! 🎉 We built an AI-powered RPG where worlds, assets, dialogues, and quests are generated in real time using @NanoBanana. Every playthrough is unique.
1
1
1
15
1,061
built < 6h. Here's a breakdown of how everything came together behind the scenes 👇
lots of ppl asked about how we did it, so here we go! the why: > the idea was to push the limits of the new @NanoBanana model which is fast and cheap. building a game came to mind as they are a good representation of pushing creative limits. the how: > you type an idea > gemini-3.5-flash builds a game bible - clues, npcs, the story, rooms, street, etc. the bigger game mechanics like no of clues & npcs are always fixed. > nano banana paints a top-view street image (the background you walk on) > nano banana runs again and draws magenta outlines around every object (buildings, paths, trees, etc.). this is done so the next model can “see” where things are > gemini-3.5-flash looks at the clean street + the outlined copy and marks hotspots + edges (where you can walk / enter / talk) > at the same time, nano banana draws your player character > also in parallel: the 3 story rooms (interiors) start building in the background while you walk, so opening a door feels instant. some buildings on the street are just flavor and don’t open into a real room > the world is infinite - meaning if you enter the edge of a screen, it will create another screen with the previous frame as a reference > we now have all the elements to play. all of this is rendered in an HTML canvas in the browser, where you play. the gameplay: > every run is one mystery with one goal > enter a room, talk to an npc - each one guards 1 clue > gemini-3.5-flash writes the dialogue, then gemini tts speaks it out loud > explore, move around, pick up items, notice local nuances, engage with the npcs until you’ve got all 3 clues!
4
185
Harsh Agarwal retweeted
update: we are in the finals!!!!
2
3
2
50
137,058
Working on a search engine to really understand how it works 🧠 One optimization that actually moved the needle: Earlier, boolean queries built full in-memory lists for each term upfront. That meant decoding doc IDs plus extra data and allocating memory before knowing which documents would even survive AND / OR. Changed the execution model: Boolean queries now operate only on document IDs using bitmap-based set operations. All the heavier work (scores, lookups, extra decoding) happens only after the final document set is known. Net effect: less decoding, less memory pressure, simpler execution flow and faster query execution Building in public. Feedback and suggestions welcome 👇
2
6
191
Building a simple search engine called postings.🔍 Just published my first article on how it works. teapaw.org/harsh_agw/status/20099…
2
177
Building a search engine from scratch in Go. Repository: github.com/harshagw/postings A detailed post on the internal workings is coming soon.
Added fuzzy search, regex search, and prefix search⚡️ Check it out - github.com/harshagw/postings All of them fall out naturally from the FST-based term dictionary. Fuzzy queries use a Levenshtein distance automaton, regex queries use a regex automaton, and prefix queries are just a range scan over the FST to collect matching terms. Once terms are collected, the rest is straightforward: fetch postings and aggregate docs. The heavy lifting is done by the FST.
1
1
4
2,685
Added fuzzy search, regex search, and prefix search⚡️ Check it out - github.com/harshagw/postings All of them fall out naturally from the FST-based term dictionary. Fuzzy queries use a Levenshtein distance automaton, regex queries use a regex automaton, and prefix queries are just a range scan over the FST to collect matching terms. Once terms are collected, the rest is straightforward: fetch postings and aggregate docs. The heavy lifting is done by the FST.
Introducing postings 🔎 A search engine built to reason about modern full-text search architecture. github.com/harshagw/postings The system follows an LSM-style design: writes go to a mutable in-memory layer and flush into immutable on-disk segments. Segments are memory-mapped (mmap) for efficient reads, FST-backed dictionaries drive term lookups in the inverted index, and per-segment bitmap tombstones hide obsolete documents. In parallel, reading Introduction to Information Retrieval and studying @blevesearch’s production search engine design.
1
4
2,831
Building this in Go to understand search engine internals 👇 github.com/harshagw/postings
Introducing postings 🔎 A search engine built to reason about modern full-text search architecture. github.com/harshagw/postings The system follows an LSM-style design: writes go to a mutable in-memory layer and flush into immutable on-disk segments. Segments are memory-mapped (mmap) for efficient reads, FST-backed dictionaries drive term lookups in the inverted index, and per-segment bitmap tombstones hide obsolete documents. In parallel, reading Introduction to Information Retrieval and studying @blevesearch’s production search engine design.
3
1,446
Introducing postings 🔎 A search engine built to reason about modern full-text search architecture. github.com/harshagw/postings The system follows an LSM-style design: writes go to a mutable in-memory layer and flush into immutable on-disk segments. Segments are memory-mapped (mmap) for efficient reads, FST-backed dictionaries drive term lookups in the inverted index, and per-segment bitmap tombstones hide obsolete documents. In parallel, reading Introduction to Information Retrieval and studying @blevesearch’s production search engine design.
3
2
10
2,793
Finished Part 1 of Designing Data-Intensive Applications📕 Storage engines aren’t about storing bytes, they’re about choosing where the cost shows up. Hash indexes push work into memory and restarts, B-trees pay in random I/O to make reads and range queries predictable, LSM trees accept compaction and read amplification to keep writes sequential. Same data, different tradeoffs, very different behavior under load and failure. This part also frames the bigger picture: how data models shape what you can express, how query languages shift work between the user and the database, and how encoding and schema evolution determine whether systems handle change gracefully. Moving on to Part 2. Will share notes later 🚀
2
86
Introducing Viri Checkout the code - github.com/harshagw/viri Playground - harshagw.github.io/viri Viri feature set 🧠⚙️ – functions with closures – classes with methods and inheritance – lexical scoping and block scopes – loops, conditionals, and expressions – modules with import / export and resolution – runs as both a tree-walking interpreter and a compiler + bytecode VM (~3× faster) Follow along. Actively building and iterating.
3
1
4
743
Module resolution just landed in Viri’s compiler + VM 🚀 Built a real module system: – compiler builds the import graph, detects cycles, and topologically sorts modules – modules are compiled in order, with imports resolved to numeric indices at compile time – VM allocates module tables, executes modules sequentially, then wires exports Same language. Same semantics. Different execution model. The compiler + VM now has full feature parity with the interpreter and runs ~3× faster ⚡. Code: github.com/harshagw/viri
6
107
Building Viri, a programming language to understand how languages actually work. Started with a tree-walking interpreter, now building a compiler + bytecode VM with the same semantics. Supports functions, closures, classes, modules, loops, and control flow. Follow along and check it out: github.com/harshagw/viri
Viri website is live 🚀 - harshagw.github.io/viri/ I finally gave the language a proper home. The site has a clear overview of what Viri is and a full grammar reference. Next up: an in-browser playground 🧪
3
661
Building Viri, a tiny programming language to understand how languages actually work. Started with a tree-walking interpreter, now building a compiler and bytecode VM with the same semantics. Follow along and check it out: github.com/harshagw/viri
Viri website is live 🚀 - harshagw.github.io/viri/ I finally gave the language a proper home. The site has a clear overview of what Viri is and a full grammar reference. Next up: an in-browser playground 🧪
2
1,308