Harsh Agarwal

72 posts

Harsh Agarwal

Harsh Agarwal

@harsh_agw

Software Developer

Bengaluru, India Katılım Kasım 2015
132 Takip Edilen17 Takipçiler
Sabitlenmiş Tweet
Harsh Agarwal
Harsh Agarwal@harsh_agw·
Introducing postings 🔎 A search engine built to reason about modern full-text search architecture. github.com/harshagw/posti… 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.
English
3
0
9
2.6K
Harsh Agarwal
Harsh Agarwal@harsh_agw·
@TheGracia_here This is awesome. I went down the same rabbit hole last year and built my own VM in Go. x.com/harsh_agw/stat…
Harsh Agarwal@harsh_agw

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.

English
0
0
4
495
Vadim
Vadim@VadimStrizheus·
Happy Monday Founders! Share what you’re building this week. 👇
Vadim tweet media
English
268
2
160
11.5K
Build in Public
Build in Public@buildinpublic·
What are you working on this week?
English
420
7
228
21.7K
Harsh Agarwal
Harsh Agarwal@harsh_agw·
@trikcode Can we even call it vibe coding if they have real programming skills?
English
0
0
1
13
Wise
Wise@trikcode·
Vibe coders with the programming skills, wins.
English
155
55
745
30.1K
Harsh Agarwal
Harsh Agarwal@harsh_agw·
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 👇
English
2
0
6
74
Harsh Agarwal
Harsh Agarwal@harsh_agw·
Building a search engine from scratch in Go. Repository: github.com/harshagw/posti… A detailed post on the internal workings is coming soon.
Harsh Agarwal@harsh_agw

Added fuzzy search, regex search, and prefix search⚡️ Check it out - github.com/harshagw/posti… 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.

English
1
1
4
2.6K
Harsh Agarwal
Harsh Agarwal@harsh_agw·
Added fuzzy search, regex search, and prefix search⚡️ Check it out - github.com/harshagw/posti… 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.
Harsh Agarwal@harsh_agw

Introducing postings 🔎 A search engine built to reason about modern full-text search architecture. github.com/harshagw/posti… 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.

English
0
0
4
2.7K
Harsh Agarwal
Harsh Agarwal@harsh_agw·
Building this in Go to understand search engine internals 👇 github.com/harshagw/posti…
Harsh Agarwal@harsh_agw

Introducing postings 🔎 A search engine built to reason about modern full-text search architecture. github.com/harshagw/posti… 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.

English
0
0
3
1.4K
Harsh Agarwal
Harsh Agarwal@harsh_agw·
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 🚀
English
0
0
2
66
Harsh Agarwal
Harsh Agarwal@harsh_agw·
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.
English
3
1
5
713
Harsh Agarwal
Harsh Agarwal@harsh_agw·
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
English
0
0
6
93
Harsh Agarwal
Harsh Agarwal@harsh_agw·
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
Harsh Agarwal@harsh_agw

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 🧪

English
0
0
3
643
Harsh Agarwal
Harsh Agarwal@harsh_agw·
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
Harsh Agarwal@harsh_agw

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 🧪

English
0
0
2
1.3K
Harsh Agarwal
Harsh Agarwal@harsh_agw·
Viri now runs classes on bytecode: methods, fields, this, inheritance, all working end to end. Same semantics as the interpreter, different execution machinery underneath. 🦾 Check out: github.com/harshagw/viri
English
0
0
5
80
Harsh Agarwal
Harsh Agarwal@harsh_agw·
This clicked while building Viri. A for loop is faster than recursion because every function call creates a new stack frame. New frame, new locals, new VM state to manage. The overhead adds up fast. On LeetCode, this feels like folklore. When you build a compiler and VM yourself, the cost is impossible to ignore.
English
1
0
6
63
Harsh Agarwal
Harsh Agarwal@harsh_agw·
Wrapped up Writing a Compiler in Go by Thorsten Ball while building Viri (github.com/harshgaw/viri). An amazing resource for building a real compiler step by step. Highly recommend checking it out. Now onto new territory: classes. Not covered in the book, so this is pure design and experimentation. Actively working on it and will merge the PR soon. Next focus is optimizations to push performance further now that the VM is shaping up. Follow along. If you know good books or resources on compiler optimizations, let me know.
English
0
0
5
76