<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet href="/static/styles/feed.xsl" type="text/xsl"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
   <title>Adhesh Athrey</title>
   <link>/</link>
   <description>Recent content on Adhesh Athrey</description>
   <language>en-IN</language>
   <webMaster>Adhesh Athrey</webMaster>
   <copyright></copyright>
   <lastBuildDate>Sat, 07 Nov 2026 20:46:33 +0000</lastBuildDate>
   <atom:link href="/feed.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>On the Art of Engineering</title>
      <link>/posts/on-the-art-of-engineering/index.html</link>
      <pubDate>Mon, 11 May 2026 00:00:00 +0000</pubDate>
      <author>Adhesh Athrey</author>
      <guid>/posts/on-the-art-of-engineering/index.html</guid>
      <description>&lt;p&gt;If you ever ask an engineer what engineering entails, you will usually get some noun. Compilers, circuits, engines, bridges. The fancy names and nouns differ, but the verbs repeat. Every engineering domain is a discipline of constrained modelling and creation, imagining something that does not exist, representing it as a human understandable model, and then persuading reality to accept that representation at an acceptable cost, all for the goal of making our lives easier or better. Maybe modernism too eh.&lt;/p&gt;&#xA;&lt;p&gt;The art is not in the tools, but rather in the judgments the tools cannot make for you, and a man&#39;s imperfect vision of a perfect solution.&lt;/p&gt;&#xA;&lt;h2 id=&#34;constraints-are-the-material&#34;&gt;Constraints are the material&lt;/h2&gt;&#xA;&lt;p&gt;Science questions you on the fact. Engineering tells what is possible with sacrifices.&lt;/p&gt;&#xA;&lt;p&gt;The budget may be mass, watts, milliseconds, dollars, memory footprint or the number of people who can understand the system at any point in time (big ask if it is 3 in the morning). A vision of a solution that disregards constraints is not ambitious, it is unfinished and crude. The first act of engineering is therefore not construction but questioning yourself on what is it that you need AND accounting. Yes accounting, what are we spending, and on what?&lt;/p&gt;&#xA;&lt;p&gt;A bridge spends steel to buy span. A database spends memory to buy latency. A compiler spends compile time to buy runtime. Optimization is never free. It is the deliberate choice of which scarcity to tolerate. And the most annoying of it all, is the situation when the constraints are in a conflict, how does a good Engineer choose between multiple constraints that are equally important?&lt;/p&gt;&#xA;&lt;h2 id=&#34;models-are-the-workbench&#34;&gt;Models are the workbench&lt;/h2&gt;&#xA;&lt;p&gt;Every field reasons through models. Beam theory, type systems, queueing models, finite elements, statics. A model is a compression of reality that keeps the part you need and throws the rest away. Nothing but a proposition to reality, to bargain your needs.&lt;/p&gt;&#xA;&lt;p&gt;The engineer&#39;s question is not &amp;quot;is this model true?&amp;quot; but &amp;quot;is this model true enough for the decision at hand?&amp;quot; A type system that ignores aliasing is fine until two references mutate the same object. A benchmark that ignores the cache is fine until the working set grows madly.&lt;/p&gt;&#xA;&lt;p&gt;So the art here is knowing, which part of your model is important and load bearing, and which part is eye-candy.&lt;/p&gt;&#xA;&lt;h2 id=&#34;interfaces-are-where-ignorance-is-hidden&#34;&gt;Interfaces are where ignorance is hidden&lt;/h2&gt;&#xA;&lt;p&gt;No one holds a complex system in their head. We build them out of parts that other people designed, tested, and documented. Abstractions are the contracts that make this possible.&lt;/p&gt;&#xA;&lt;p&gt;A good interface hides a decision and makes a fair promise. A bad interface hides a bug and whacks you in the face on a fine good day. The art is choosing the seams. Where to fold or cut the system so that each side can be understood, visualized, tested, and replaced without messing up the whole.&lt;/p&gt;&#xA;&lt;p&gt;Every abstraction leaks. Well it is meant to?? Well, I don&#39;t know, but the art is not avoiding leaks, but to let what you want the other side to see and pass through the joints. It is putting them where failure is observable and cheap and importantly, stupid easy to understand.&lt;/p&gt;&#xA;&lt;h2 id=&#34;margins-are-how-we-live-with-uncertainty-the-compromises-we-are-okay-with&#34;&gt;Margins are how we live with uncertainty, the compromises we are okay with&lt;/h2&gt;&#xA;&lt;p&gt;Every field has some vocabulary or fancy nomenclature for the same idea. DO NOT DESIGN TO THE EDGE.&lt;/p&gt;&#xA;&lt;p&gt;Civil engineers call it a safety factor. Mechanical engineers call it tolerance or something. SREs call em an error budget. Some or the other fancy term, they all mean the same.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Engineering is the art of modelling materials we do not wholly understand, into shapes we cannot precisely analyse so as to withstand forces we cannot properly assess, in such a way that the public has no reason to suspect the extent of our ignorance.&lt;br&gt;&lt;br&gt;&#xA;~ A. R. Dykes&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Margins are not timidity or fear of failure. They are the price of uncertainty that you can&#39;t calculate, just paid in advance. And the art is knowing how much to buy.&lt;/p&gt;&#xA;&lt;h2 id=&#34;judgment-is-the-personality-part&#34;&gt;Judgment is the personality part&lt;/h2&gt;&#xA;&lt;p&gt;Give two engineers the same constraints, the same everything, and they will still produce different things. Why?&lt;/p&gt;&#xA;&lt;p&gt;The difference is judgment, knowing what is worth solving, when good enough is realllly good enough, when to break an abstraction, when to stop optimizing, and when a warning sign is worth a week of investigation (Or maybe AI tokens nowadays). Intuition is abstract, but good intuition remains falsifiable. The best engineers I have seen hold strong opinions loosely and test them cheaply or well try to ig.&lt;/p&gt;&#xA;&lt;h2 id=&#34;engineering-is-a-social-act&#34;&gt;Engineering is a social act&lt;/h2&gt;&#xA;&lt;p&gt;Drawings, specifications, units, schemas, tests, commit messages, incident reviews. All these exists because the artifact must survive contact with other people AND to appease others.&lt;/p&gt;&#xA;&lt;p&gt;Ambiguity is a defect. An unmaintainable system is an unfinished one (thanks to unplanned AI sloppery, this is the hardest). The system includes the people who operate it, who debug it at questionable times, and the people who inherit it after you leave. Engineering is not done when the thing works. It is done when the thing can keep working without you. Well technically it is never done, because you pawned it off on someone else, but you get it.&lt;/p&gt;&#xA;&lt;h2 id=&#34;the-common-core&#34;&gt;The common core&lt;/h2&gt;&#xA;&lt;p&gt;Strip away the fancy nomenclatures and the same stance remains. Treat constraints as the medium, models as instruments, interfaces as promises, feedback as the method, margins as the price of uncertainty, and judgment as the part that cannot be outsourced.&lt;/p&gt;&#xA;&lt;p&gt;That is why engineering is an art. Not because the finished result is aesthetic or perfect, but because it requires choosing well when the rules do not choose for you but instead fight you back.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Journey</title>
      <link>/posts/Journey.html</link>
      <pubDate>Tue, 31 Dec 2024 00:00:00 +0000</pubDate>
      <author>Adhesh Athrey</author>
      <guid>/posts/Journey.html</guid>
      <description>&lt;h1 id=&#34;lets-start-off-by-defining-what-this-entails&#34;&gt;Let&#39;s start off by defining what this entails.&lt;/h1&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;This page is meant to be a space for me to track my time as I grow.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;This page is by no means a perfected piece of content, but rather an attempt to record my time.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Anything from what I am building, or what I am reading all the way to what I ate belongs here (I eat a lot :x ).&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h1 id=&#34;tldr-of-2024&#34;&gt;TLDR of 2024.&lt;/h1&gt;&#xA;&lt;p&gt;I have no written records for much of 2024, but as I write this on the last day of 2024, I have come to a conclusion, 2024 was riddled with &lt;span style = &#34;color:#689d6a;&#34;&gt;everything&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Ups and downs, just like any other human on this rock, I too had them, from the crazy &lt;span style = &#34;color:#689d6a;&#34;&gt;&lt;em&gt;LFGs&lt;/em&gt; &lt;/span&gt; when a piece of code I wrote worked at 12 in the night, to &lt;span style = &#34;color:#689d6a;&#34;&gt;&lt;em&gt;disappointment&lt;/em&gt;&lt;/span&gt; of opening the results tab on PESU app at 12 in the night and more.&lt;/p&gt;&#xA;&lt;p&gt;But regardless I have learnt a lot, thanks to the most important &lt;span class=accent&gt;主義&lt;/span&gt; that I learnt back in 2023.&lt;/p&gt;&#xA;&lt;p&gt;The places or the oppurtunities I have had feels surreal looking back at it, so surreal that it&#39;s as though it was all by fluke, the dice rolled the right number every time.&lt;/p&gt;&#xA;&lt;p&gt;I guess this is what &lt;span class=accent&gt;Imposter Syndrome&lt;/span&gt; is. The feeling of believeing you dont belong to where you stand, is filled to the brim. But no reason to give up, be in a state of bewilderment or be hung up on it. Even if it is true, not a lot of people get a chance to stand where I am, so the only right path is to prove otherwise.&lt;/p&gt;&#xA;&lt;p&gt;Well before we run to 2025, thanks to myself (Yes, ofcourse me too), my family and friends, because none of this would&#39;ve been true without them.&lt;/p&gt;&#xA;&lt;h6 id=&#34;but-what-is-span-classaccentspan-you-ask&#34;&gt;But what is &lt;span class=accent&gt;主義&lt;/span&gt; you ask?&lt;/h6&gt;&#xA;&lt;p&gt;Hmm well the simple translation of it from Japanese to English is &lt;span class=accent&gt;&lt;em&gt;&lt;em&gt;Principle&lt;/em&gt;&lt;/em&gt;&lt;/span&gt;, and my principle is&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;span class=accent&gt;&lt;em&gt;If I dont challenge myself no one will.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Yes well if I dont challenge myself or even bet on myself no one is going to, there&#39;s no choice but to get up and grind, to race &lt;span class=accent&gt;&lt;em&gt;the me&lt;/em&gt;&lt;/span&gt; from yesterday.&lt;/p&gt;&#xA;&lt;p&gt;At the bottomline, I am more than glad if i can win over the yesterday&#39;s me today in any way possible.&lt;/p&gt;&#xA;&lt;p&gt;Funny enough this was my &lt;span class=accent&gt;&lt;em&gt;New Year&#39;s Resolution&lt;/em&gt;&lt;/span&gt; going into 2024. As we approach the end of 2024, I want to start 2025 with a new addition to my &lt;span class=accent&gt;主義&lt;/span&gt;.&lt;/p&gt;&#xA;&lt;h6 id=&#34;what-is-it-going-to-be&#34;&gt;What is it going to be?&lt;/h6&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;&lt;span class=accent&gt;&lt;em&gt;Retrace and Repair.&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;Record everything that goes wrong, work upon it and fix it.&lt;/p&gt;&#xA;&lt;p&gt;Leave nothing under the &lt;span class=accent&gt;&lt;em&gt;gone wrong&lt;/em&gt;&lt;/span&gt; column.&lt;/p&gt;&#xA;&lt;p&gt;Mistakes are proofs that I can optimise more, not a reason for getting hung up on something.&lt;/p&gt;&#xA;&lt;h1 id=&#34;with-that-lets-start-2025&#34;&gt;With that lets start 2025!!&lt;/h1&gt;&#xA;&lt;p&gt;Why is it empty??&lt;/p&gt;&#xA;&lt;p&gt;Duhh, not even 24 hours has passed by -_-&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Adhesh Athrey</title>
      <link>/index.html</link>
      <pubDate>Sun, 29 Dec 2024 00:00:00 +0000</pubDate>
      <author>Adhesh Athrey</author>
      <guid>/index.html</guid>
      <description>&lt;h1 id=&#34;adhesh-athrey&#34;&gt;Adhesh Athrey&lt;/h1&gt;&#xA;&lt;p&gt;Hello world! I&#39;m Adhesh Athrey, a final-year undergraduate computer science student at PESU. I like building anything that looks cool, so that&#39;s more or less how I pick what to work on.&lt;/p&gt;&#xA;&lt;p&gt;I interned at LinkedIn as a summer intern in the Core Infra org. I was previously a research intern at &lt;a href=&#34;https://www.theinnovationlab.in&#34;&gt;PES Innovation Lab&lt;/a&gt;, and I&#39;m currently a member of the lab since 2025.&lt;/p&gt;&#xA;&lt;p&gt;Lately I&#39;ve been exploring FPGAs. I&#39;m also working on &lt;a href=&#34;https://github.com/sculite/sqlite/&#34;&gt;sculite&lt;/a&gt;, a fork of SQLite that uses the GPU to accelerate queries.&lt;/p&gt;&#xA;&lt;h2 id=&#34;writing&#34;&gt;Writing&lt;/h2&gt;&#xA;&lt;p&gt;There is a high chance that some work here is incomplete.&#xA;&lt;br&gt;Infact this site is quite incomplete.&lt;/p&gt;&#xA;&lt;p&gt;Why? Well i would never put anything out if I wanted perfection or completion, sounded like a reason for procrastination, so here we are, we move the right direction step by step.&lt;/p&gt;&#xA;&lt;p&gt;This site serves as a testament to my journey of progress, showcasing my interests and various projects and honestly anything.&lt;/p&gt;&#xA;</description>
    </item>
    <item>
      <title>Projects</title>
      <link>/projects.html</link>
      <pubDate>Sat, 04 May 2024 00:00:00 +0000</pubDate>
      <author>Adhesh Athrey</author>
      <guid>/projects.html</guid>
      <description>&lt;h1 id=&#34;projects&#34;&gt;Projects&lt;/h1&gt;&#xA;&lt;p&gt;All of my projects are on &lt;a href=&#34;https://github.com/DedLad&#34;&gt;Github&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;annahttpsgithubcomanna-ssganna&#34;&gt;&lt;a href=&#34;https://github.com/anna-ssg/Anna&#34;&gt;Anna&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A lightning-fast static site generator written in Go.&lt;/p&gt;&#xA;&lt;p&gt;This project is maintained by &lt;a href=&#34;https://github.com/DedLad&#34;&gt;Adhesh Athrey&lt;/a&gt;, &lt;a href=&#34;https://github.com/polarhive&#34;&gt;Nathan Paul&lt;/a&gt;, &lt;a href=&#34;https://github.com/anirudhsudhir&#34;&gt;Anirudh Sudhir&lt;/a&gt;, and &lt;a href=&#34;https://github.com/bwaklog&#34;&gt;Aditya Hegde&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;Link to the &lt;a href=&#34;/posts/building-anna&#34;&gt;blog&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;hivehttpsgithubcomdedladhive&#34;&gt;&lt;a href=&#34;https://github.com/DedLad/hive&#34;&gt;Hive&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A Bitcask clone in GoLang&lt;/p&gt;&#xA;&lt;p&gt;I will be writing a dedicated blog on this soon&lt;/p&gt;&#xA;&lt;h2 id=&#34;eventloophttpsgithubcomhomebrew-ec-fosseventloop&#34;&gt;&lt;a href=&#34;https://github.com/homebrew-ec-foss/eventloop&#34;&gt;Eventloop&lt;/a&gt;&lt;/h2&gt;&#xA;&lt;p&gt;A Full Stack event management platform project.&lt;/p&gt;&#xA;&lt;p&gt;FOSS project maintained by &lt;a href=&#34;https://github.com/DedLad&#34;&gt;Adhesh Athrey&lt;/a&gt;, &lt;a href=&#34;https://github.com/anirudhsudhir&#34;&gt;Anirudh Sudhir&lt;/a&gt;, and &lt;a href=&#34;https://github.com/bwaklog&#34;&gt;Aditya Hegde&lt;/a&gt; over at &lt;a href=&#34;https://github.com/homebrew-ec-foss/&#34;&gt;HSP&lt;/a&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;</description>
    </item>
    <item>
      <title>Building anna</title>
      <link>/posts/building-anna/index.html</link>
      <pubDate>Thu, 04 Apr 2024 00:00:00 +0000</pubDate>
      <author>Adhesh Athrey</author>
      <guid>/posts/building-anna/index.html</guid>
      <description>&lt;blockquote&gt;&#xA;&lt;p&gt;This post is WIP(work-in-progress) and has been authored by &lt;a href=&#34;https://github.com/DedLad&#34;&gt;Adhesh&lt;/a&gt;, &lt;a href=&#34;https://github.com/bwaklog&#34;&gt;Aditya&lt;/a&gt;, &lt;a href=&#34;https://github.com/polarhive&#34;&gt;Nathan&lt;/a&gt; and &lt;a href=&#34;https://github.com/anirudhsudhir&#34;&gt;Anirudh&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;There are several amazing static site generators(SSG) out there, like &lt;a href=&#34;https://gohugo.io/&#34;&gt;Hugo&lt;/a&gt; and&#xA;&lt;a href=&#34;https://www.11ty.dev/&#34;&gt;11ty&lt;/a&gt;. Building your own SSG is an amazing learning&#xA;experience. It also motivates one to maintain and improve their personal site.&lt;/p&gt;&#xA;&lt;p&gt;Building personal blogs from the ground up can be a &lt;em&gt;tedious process&lt;/em&gt;. Some of us&#xA;have had our hands deep in vanilla HTML and CSS, which isn&#39;t fun to maintain. We&#xA;all want to get to the point and share our thoughts on the web. But, there is a&#xA;small hurdle that stops us from doing so.&lt;/p&gt;&#xA;&lt;p&gt;Maintaining your personal site is like working with your own Neovim&#xA;configuration. Every issue fixed would lead to an entirely unrelated bug. There&#xA;is a lot of time spent fixing things rather than getting productive work done.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;A static site generator is an immensely useful application&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;images/lighthouse.png&#34; alt=&#34;Lighthouse scores of the anna-docs page&#34;&gt;&#xA;&lt;figcaption&gt;&lt;p&gt;Lighthouse scores of the anna-docs page&lt;/p&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;p&gt;It can simplify the whole process: allowing you to spend time and energy&#xA;on quality content. Keep reading to find out how we designed anna.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;&#xA;&lt;p&gt;ACM-PESU ECC conducts the ACM Industrial Experience Program (AIEP), an annual program that spans six weeks.&lt;/p&gt;&#xA;&lt;p&gt;It involves students working as a team to develop an industrial-level project.&#xA;AIEP intends to give students hands-on experience with real-world projects.&#xA;It is an excellent opportunity to interact with like-minded individuals.&lt;/p&gt;&#xA;&lt;p&gt;Our AIEP team consisted of &lt;a href=&#34;https://github.com/DedLad&#34;&gt;Adhesh&lt;/a&gt;, &lt;a href=&#34;https://github.com/bwaklog&#34;&gt;Aditya&lt;/a&gt;,&#xA;&lt;a href=&#34;https://github.com/polarhive&#34;&gt;Nathan&lt;/a&gt;, and &lt;a href=&#34;https://github.com/anirudhsudhir&#34;&gt;Anirudh&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;Our mentors (cool senior names!) gave us some great ideas for our team of four freshers.&#xA;We were puzzled whether to build a distributed Postgres clone or a load balancer.&lt;/p&gt;&#xA;&lt;p&gt;Deep discussions over a week got us to the topic of making blog sites and how tiring it is to work with, which only gets worse as you&#xA;write more and more content for your internethome.&lt;/p&gt;&#xA;&lt;p&gt;This and inspirations from &lt;a href=&#34;https://github.com/anirudhRowjee/saaru&#34;&gt;Saaru&lt;/a&gt; and &lt;a href=&#34;https://github.com/NavinShrinivas/sapling&#34;&gt;Sapling&lt;/a&gt; pushed us to tackle this problem with our own SSG.&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;    ___&#xA;   /   |  ____  ____  ____ _&#xA;  / /| | / __ \/ __ \/ __ `/&#xA; / ___ |/ / / / / / / /_/ /&#xA;/_/  |_/_/ /_/_/ /_/\__,_/&#xA;&#xA;A static site generator in Go&#xA;&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;h2 id=&#34;the-small-but-big-decision&#34;&gt;The small but big decision!&lt;/h2&gt;&#xA;&lt;p&gt;Anna is written in &lt;a href=&#34;https://go.dev&#34;&gt;Go&lt;/a&gt;.&#xA;We considered writing it in Rust, but it came with a steep learning curve.&#xA;Go is a powerful language and has excellent concurrency support, which suited our requirements to build a performant application.&lt;/p&gt;&#xA;&lt;h3 id=&#34;whats-in-a-name&#34;&gt;What&#39;s in a name?&lt;/h3&gt;&#xA;&lt;p&gt;Probably the first thing that the four of us came across when joining ACM and HSP was the famous &lt;a href=&#34;https://github.com/anirudhRowjee/saaru&#34;&gt;Saaru&lt;/a&gt; repository, one of the projects that inspired our ssg.&#xA;Saaru is a thin lentil soup, usually served with rice and is a &lt;a href=&#34;https://en.wikipedia.org/wiki/Kannada&#34;&gt;Kannada&lt;/a&gt; word.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;In Kannada, rice is referred to as &#39;anna&#39; (ಅನ್ನ) pronounced &lt;i&gt;/ɐnːɐ/&lt;/i&gt;&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This was just a playful stunt that we engaged in.&#xA;We planned on beating Saaru at site render times, optimizing at runtime.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;genesis&#34;&gt;Genesis&lt;/h2&gt;&#xA;&lt;p&gt;We began the project in a unique manner, with each of us creating our own prototype of the SSG.&#xA;This was done to familiarize everyone with the Go toolchain.&lt;/p&gt;&#xA;&lt;p&gt;The first version of the SSG did just three things.&#xA;It rendered markdown (stored in files in a content folder in the project directory) to HTML.&#xA;This HTML was injected into a layout.html file and served over a local web server.&#xA;Later, we implemented a front matter YAML parser to retrieve page metadata&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;what-made-us-develop-this-to-a-great-extent&#34;&gt;What made us develop this to a great extent?&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Beginner-friendly: An easy setup wizard, ready to use layouts, and themes.&#xA;We wanted the process of typing out a blog and putting it up on your site to be short and simple.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Speed: Render sites in a flash (hugo – written in Go, is remarkably fast)&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Maintainable: This ssg would be used by us, hence it should be easy to fix bugs and add new features&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Learning curve: None of us had really shipped a production-ready application.&#xA;Since AIEP is all about making industry-ready projects, we chose to use Go: so we could spend more &lt;strong&gt;writing&lt;/strong&gt; code&#xA;and not worrying about our toolchain or escaping dependency hell.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;Owning a piece of the internet: Aditya and Anirudh registered their own domain names.&#xA;Now their anna sites live on &lt;a href=&#34;https://hegde.live&#34;&gt;hegde.live&lt;/a&gt; and &lt;a href=&#34;https://sudhir.live&#34;&gt;sudhir.live&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;benchmarks-can-anna-lift&#34;&gt;Benchmarks! Can anna lift??&lt;/h2&gt;&#xA;&lt;p&gt;In simple terms, to beat Saaru&#39;s render time (P.S. we did beat the initial version!).&#xA;Something you probably never notice while deploying, but it is what pushed us to spend hours on this.&lt;/p&gt;&#xA;&lt;p&gt;Adhesh was pretty excited to pick up Go and implement profiling, shaving&#xA;milliseconds off build times, when he implemented parallel rendering using goroutines.&lt;/p&gt;&#xA;&lt;h3 id=&#34;we-cook-&#34;&gt;We cook! 🍳&lt;/h3&gt;&#xA;&lt;p&gt;Here are some images that demonstrate build times, profiling et-al when having thousands of markdown files or in this case&#xA;just copy-pasting a single markdown file en-mass!&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;images/bench.png&#34; alt=&#34;Hyperfine benchmarks comparing the render times of anna, Saaru and 11ty&#34;&gt;&#xA;&lt;figcaption&gt;&lt;p&gt;Hyperfine benchmarks comparing the render times of anna, Saaru and 11ty&lt;/p&gt;&lt;/figcaption&gt;&#xA;&lt;/figure&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;2 weeks into the project, we had a PR bringing parallel rendering and profiling to the table&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;profiling&#34;&gt;Profiling&lt;/h2&gt;&#xA;&lt;p&gt;For those who love to get technical, anna has a profiling flag and a debug endpoint(available during live reload).&#xA;This flag prints the profile data of the rendering process to stdout.&#xA;The debug endpoint displays the data for site render in the live reload mode, which can be visualised by navigating to the specified pprof endpoint&lt;/p&gt;&#xA;&lt;!-- Here&#39;s the CPU profile generated while rendering this site.&#xA;This is an SVG showing how much time each function call takes, the number of times it ran in a given test sample and various other useful information.&#xA;&#xA;![CPU profile of an anna render generated using pprof](images/cpu_prof.svg)&#xA;&#xA;You may wanna zoom-in about 3-4x times to get to see how our ssg works --&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;live-reload&#34;&gt;Live Reload&lt;/h2&gt;&#xA;&lt;p&gt;anna can be run in a serve mode which serves the rendered site over localhost.&#xA;It also includes live reload, which performs a re-render of the site for every change made to the markdown content.&#xA;It also injects a script which auto-refreshes the browser on a site re-render.&lt;/p&gt;&#xA;&lt;h3 id=&#34;initial-version&#34;&gt;Initial version&lt;/h3&gt;&#xA;&lt;p&gt;The initial version consisted of a multi-goroutine system.&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;A new goroutine would be spawned to walk the required content directories.&#xA;If the current path being walked was a file, the path would be passed to another function along with its current modification time.&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;li&gt;&#xA;&lt;p&gt;The previous mod time of the file would then be retrieved from a map holding the mod times of all the files:&lt;/p&gt;&#xA;&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;If the given file was freshly created, its modification time would be added to the map.&lt;/li&gt;&#xA;&lt;li&gt;If there was no change in the mod time, no changes would be made.&lt;/li&gt;&#xA;&lt;li&gt;If there was a change between the current and previous mod times, a re-render of the site would be performed.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;ol start=&#34;3&#34;&gt;&#xA;&lt;li&gt;The site re-render function checks if a child process is running:&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;For the first render, when a process has not been created, a new process is created that runs anna (&amp;quot;go run main.go --serve&amp;quot;)&lt;/li&gt;&#xA;&lt;li&gt;For successive renders, the existing process is killed and a new process is spawned once again that runs the application.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;This prototype was not very efficient as it created and killed processes for every change.&#xA;It had multiple goroutines attempting to walk the directories at the same time, which also required multiple mutual exclusion locks to prevent data races.&#xA;This was designed as a standalone component and integrating this proved to be challenging.&lt;/p&gt;&#xA;&lt;h3 id=&#34;improvements&#34;&gt;Improvements&lt;/h3&gt;&#xA;&lt;p&gt;The updated version of live reload utilised two goroutines.&lt;/p&gt;&#xA;&lt;p&gt;The main goroutine used the initial file walker, with one important change: it sequentially traversed the directory without spawning new goroutines.&#xA;For any modification to a file in the current traversal, a vanilla render of the entire site would be performed.&#xA;The goroutine would then sleep for a specified duration (currently 1 second) before attempting the next directory traversal.&lt;/p&gt;&#xA;&lt;p&gt;The secondary goroutine ran a local web server that served the rendered/ directory.&lt;/p&gt;&#xA;&lt;p&gt;This eliminated all locks and avoided the creation and destruction of child processes.&lt;/p&gt;&#xA;&lt;h3 id=&#34;browser-reload-wip&#34;&gt;Browser reload (WIP)&lt;/h3&gt;&#xA;&lt;p&gt;When anna performs a re-render of the site, the browser is automatically refreshed to reflect the latest changes.&#xA;This involved utilising server-sent events(SSE).&#xA;A script was injected into all pages that polled a particular port.&#xA;On receiving an event sent by anna during the re-render, the script would reload the page.&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;(The following content is WIP)&lt;/p&gt;&#xA;&lt;h2 id=&#34;a-big-rewrite-when-we-went-for-a-tdd-approach&#34;&gt;A big rewrite (when we went for a TDD approach)&lt;/h2&gt;&#xA;&lt;p&gt;Starting off this project, we kept adding functionality without optimization.&#xA;We did not have a proper structure; PRs would keep breaking features and overwriting functions written by team-mates.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;We dived into the codebase to rebuild the application following a TDD-approach.&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h3 id=&#34;a-new-proposed-rendering-system&#34;&gt;A new proposed rendering system&lt;/h3&gt;&#xA;&lt;h4 id=&#34;maingo&#34;&gt;main.go&lt;/h4&gt;&#xA;&lt;p&gt;Firstly, we refactored main.go to only handle flags.&#xA;The rest of the program logic was moved to other packages.&#xA;A benchmark for main.go was also written to time the entire application.&lt;/p&gt;&#xA;&lt;h4 id=&#34;pkg-modules&#34;&gt;pkg/ modules&lt;/h4&gt;&#xA;&lt;p&gt;Modules previously part of &lt;code&gt;cmd/anna/utils.go&lt;/code&gt; and &lt;code&gt;cmd/anna/main.go&lt;/code&gt; were to be split between &lt;code&gt;pkg/parsers/&lt;/code&gt;, &lt;code&gt;pkg/engine/&lt;/code&gt; and &lt;code&gt;pkg/helper&lt;/code&gt;&lt;/p&gt;&#xA;&lt;pre&gt;&lt;code class=&#34;language-text&#34;&gt;pkg&#xA;├─── helpers&#xA;│   ├─── helpers.go&#xA;│   └─── helper_test.go&#xA;├─── engine&#xA;│   ├─── anna_engine.go&#xA;│   ├─── anna_engine_test.go&#xA;│   ├─── engine.go&#xA;│   ├─── engine_test.go&#xA;│   ├─── user_engine.go&#xA;│   ├─── user_engine_test.go&#xA;│   └─── engine_integration_test.go&#xA;└─── parsers&#xA;    ├─── parser.go&#xA;    ├─── parser_test.go&#xA;    └─── parser_integration_test.go&#xA;&lt;/code&gt;&lt;/pre&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wrote unit and integration tests for the parser and engine package&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;h4 id=&#34;splitting-the-render-pipeline&#34;&gt;Splitting the render pipeline&lt;/h4&gt;&#xA;&lt;p&gt;Currently, there are three kinds of files that have to be rendered.&#xA;One set includes user-defined files such as &lt;code&gt;index.md&lt;/code&gt;, &lt;code&gt;docs.md&lt;/code&gt; and various posts. These are specific to a user.&lt;/p&gt;&#xA;&lt;p&gt;The second set of files that are rendered include &lt;code&gt;tags.html&lt;/code&gt; and &lt;code&gt;posts.html&lt;/code&gt;, which are present on every site rendered by anna.&lt;/p&gt;&#xA;&lt;p&gt;The third set of files included the tag-sub pages.&#xA;For every tag, there would be a corresponding sub-page containing all of the posts with the same tag.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Split the rendering system to make parallelisation easier by switching to a three method system.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Render &amp;quot;user defined&amp;quot; pages which include all markdown files and posts (This method has been parallelised, Render tags and tag-sub pages separately, which could be parallelised in the future&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;useful-features&#34;&gt;Useful features&lt;/h2&gt;&#xA;&lt;h3 id=&#34;tags&#34;&gt;Tags&lt;/h3&gt;&#xA;&lt;p&gt;You can tag posts by hand, at the start of each markdown file and you get a&#xA;nice sub-page on your site so readers can discover similar content or browser&#xA;by category.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Organizing posts into collections based on tags&lt;/li&gt;&#xA;&lt;li&gt;Reverse search for posts of a certain category&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h3 id=&#34;to-search-or-not-to-search-&#34;&gt;To search or not to search? 🤔&lt;/h3&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;That is the question &amp;gt; Is our &lt;em&gt;static site&lt;/em&gt; becoming dynamic and at what cost?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;We were wondering if we’d need a search function on our site since Google and&#xA;any other web-crawler index our site anyway.&#xA;If we needed to implement it, we had a constraint: do not use an API.&#xA;It had to be static and local to be user-friendly to work with.&#xA;We implemented a JSON index generator that uses &amp;quot;Deep Data Merge&amp;quot; to index posts on our site.&lt;/p&gt;&#xA;&lt;p&gt;This index is generated during the site render and functions without any lag or noticeable delay when searching across posts.&#xA;We mean to re-write it using WASM if necessary.&lt;/p&gt;&#xA;&lt;p&gt;Here&#39;s a gif demonstrating search&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;images/search.gif&#34; alt=&#34;Demonstration of the search feature in anna&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;js-integration-as-plugins&#34;&gt;JS integration as plugins&lt;/h3&gt;&#xA;&lt;p&gt;We added a field to the frontmatter which lets you pick and add certain JS&#xA;based snippets to your site.&#xA;This way, you get to add &lt;code&gt;highlight.js&lt;/code&gt; support, analytics scripts and donation page widgets; that you can source from the &lt;code&gt;static/scripts&lt;/code&gt; folder and toggle as needed per-markdown page.&lt;/p&gt;&#xA;&lt;h3 id=&#34;wizard&#34;&gt;Wizard&lt;/h3&gt;&#xA;&lt;p&gt;An important ease-of-use feature was a GUI; a web-based wizard that let&#39;s a new user&#xA;setup anna along with a couple of easter eggs along the way 🍚&lt;/p&gt;&#xA;&lt;p&gt;The wizard lets a user pick a theme, enter your name, pick navbar elements, and&#xA;validates fields using regex checks so you don’t need to worry about relative&#xA;paths in baseURLs, canonical links, and sitemaps. After successfully completing&#xA;the setup, the wizard launches a live preview of your site in a new tab.&lt;/p&gt;&#xA;&lt;figure&gt;&#xA;&lt;img src=&#34;images/wizard.gif&#34; alt=&#34;Demonstration of the GUI wizard in anna&#34;&gt;&#xA;&lt;/figure&gt;&#xA;&lt;h3 id=&#34;raw-html&#34;&gt;Raw HTML&lt;/h3&gt;&#xA;&lt;p&gt;What if you&#39;d want to add a contact form to your site? or embed YouTube videos or iframes of your choosing?&lt;/p&gt;&#xA;&lt;p&gt;Anna let&#39;s us do that! Although, the point of a static site generator is to&#xA;quickly get to writing and focusing on the content.&#xA;You can still embed js elements and iframe as needed to showcase any interesting YouTube videos or to just rickroll people!&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;changelog-showcasing-important-additions-which-are-yet-to-be-added-to-this-blog&#34;&gt;changelog: showcasing important additions, which are yet to be added to this blog&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Deep Data Merge&lt;/li&gt;&#xA;&lt;li&gt;Style feed.xml&lt;/li&gt;&#xA;&lt;li&gt;Site bootstrapping&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;next-steps&#34;&gt;Next steps&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wizard theme repo&lt;/li&gt;&#xA;&lt;li&gt;Performance: Explore memory-mapping, etc&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;hr&gt;&#xA;&lt;h2 id=&#34;feedback--learnings&#34;&gt;Feedback? / Learnings&lt;/h2&gt;&#xA;&lt;p&gt;We have a lot of things in store and bugs to squash!&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;Feel free to ask any questions / send feature requests you&#39;d like to see?&lt;/p&gt;&#xA;&lt;/blockquote&gt;&#xA;&lt;p&gt;This blog post misses out of many not-so well documented features and learnings that&#xA;we got during midnight calls and the patches we kept sending each other fixing trivial but&#xA;interesting issues.&#xA;Have a look at our &lt;a href=&#34;https://github.com/anna-ssg/anna/issues&#34;&gt;GitHub&lt;/a&gt;, for more&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;Today, we use &lt;a href=&#34;https://github.com/anna-ssg/anna/releases/latest&#34;&gt;anna&lt;/a&gt; on our personal sites:&#xA;&lt;a href=&#34;https://hegde.live&#34;&gt;hegde.live&lt;/a&gt; // &lt;a href=&#34;https://sudhir.live&#34;&gt;sudhir.live&lt;/a&gt; // &lt;a href=&#34;https://polarhive.net&#34;&gt;polarhive.net&lt;/a&gt;&lt;/p&gt;&#xA;&lt;p&gt;01100001 01101110 01101110 01100001&lt;/p&gt;&#xA;</description>
    </item>
  </channel>
</rss>
