<?xml version="1.0" encoding="utf-8" standalone="yes"?><?xml-stylesheet href="/feed.css?v=208f42b55cff" type="text/css"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:site="https://lalitm.com/feed/ns#"><channel><title>Lalit Maganti (Tag: Til)</title><link>https://lalitm.com/tags/til/</link><description>Recent content tagged Til on Lalit Maganti</description><site:notice>This is a feed.
Feeds let you subscribe to updates from this site using a feed reader. Copy this page's URL from your address bar and paste it into your reader.
New to feeds? Read: https://aboutfeeds.com</site:notice><docs>https://aboutfeeds.com</docs><generator>Hugo -- gohugo.io</generator><language>en</language><lastBuildDate>Tue, 16 Jun 2026 02:36:00 +0100</lastBuildDate><atom:link href="https://lalitm.com/tags/til/index.xml" rel="self" type="application/rss+xml"/><item><title>TIL: Iroh: peer-to-peer networking for app developers</title><link>https://lalitm.com/post/til-iroh/</link><pubDate>Tue, 16 Jun 2026 02:36:00 +0100</pubDate><guid>https://lalitm.com/post/til-iroh/</guid><description>I came across Iroh (via, via) today as it hit 1.0 and found it a really interesting solution to a problem I knew existed but had not thought a lot about.
Judging from the comment sections, it seems pretty clear that lots of people are confused as to exactly what Iroh is. I don’t think their launch post does their product justice at all, and their tagline is “IP addresses break, dial keys instead” which sounds cool, but if you think about it for just a second, you’ll end up with lots of questions. The biggest one is: “so how is this different from a mesh VPN like Tailscale, ZeroTier, Netbird, etc.?”
It’s only after reading a lot of developers’ comments on the threads that I feel I understand: Iroh is aimed at application developers who want to communicate P2P between machines running their app, while mesh networks are aimed at network admins who want to connect devices they own/manage together.</description><content:encoded>&lt;p&gt;I came across &lt;a href="https://www.iroh.computer/"&gt;Iroh&lt;/a&gt;
(&lt;a href="https://news.ycombinator.com/item?id=48542480"&gt;via&lt;/a&gt;,
&lt;a href="https://lobste.rs/s/cslljn/iroh_1_0_dial_keys_not_ips"&gt;via&lt;/a&gt;) today as it hit
1.0 and found it a really interesting solution to a problem I knew existed but
had not thought a lot about.&lt;/p&gt;
&lt;p&gt;Judging from the comment sections, it seems pretty clear that &lt;em&gt;lots&lt;/em&gt; of people
are confused as to exactly &lt;em&gt;what&lt;/em&gt; Iroh is. I don&amp;rsquo;t think their
&lt;a href="https://www.iroh.computer/blog/v1"&gt;launch post&lt;/a&gt; does their product justice at
all, and their tagline is &amp;ldquo;IP addresses break, dial keys instead&amp;rdquo; which sounds
cool, but if you think about it for just a second, you&amp;rsquo;ll end up with lots of
questions. The biggest one is: &amp;ldquo;so how is this different from a mesh VPN like
Tailscale, ZeroTier, Netbird, etc.?&amp;rdquo;&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s only after reading a lot of developers&amp;rsquo; comments on the threads that I feel
I understand: Iroh is aimed at &lt;em&gt;application&lt;/em&gt; developers who want to communicate
P2P between machines running their app, while mesh networks are aimed
at &lt;em&gt;network admins&lt;/em&gt; who want to connect devices they own/manage together.&lt;/p&gt;
&lt;p&gt;Imagine you&amp;rsquo;re developing a peer-to-peer messaging app where, on one side, the
user is on a mobile device which constantly roams between WiFi/mobile data (so
doesn&amp;rsquo;t have a stable IP address), and the other side is a laptop sitting behind
a NAT and a CGNAT.&lt;/p&gt;
&lt;p&gt;If I want to get these folks to talk to each other, I need some mechanism to
deal with two problems at once: the mobile&amp;rsquo;s address keeps changing as it roams,
and neither side has a stable public IP the other can reach directly. Now,
historically to fix these problems, the developer would need to have an
intermediary server which both endpoints talk to so they can share state, create
a protocol to exchange IP addresses, and do NAT hole-punching to set up the
connection, falling back to acting as a real relay if none of that is possible
[1].&lt;/p&gt;
&lt;p&gt;What Iroh does instead is standardise this as a set of libraries and protocols
as well as offer it as a managed service that you can just drop into your app.
They also appear to be leaning heavily on standards like QUIC instead of
reinventing the wheel, which is always nice to see.&lt;/p&gt;
&lt;p&gt;Overall, this is a pretty neat idea for a difficult problem! I&amp;rsquo;m definitely
curious to try it out; I don&amp;rsquo;t have a use case in mind, but I&amp;rsquo;m now on the
lookout for one!&lt;/p&gt;
&lt;p&gt;[1] If you want to learn more on this, I would strongly suggest reading this
excellent
&lt;a href="https://tailscale.com/blog/how-nat-traversal-works"&gt;Tailscale article&lt;/a&gt; which I
learned a lot from myself.&lt;/p&gt;</content:encoded></item><item><title>TIL: Number in man page titles (e.g. sleep(3))</title><link>https://lalitm.com/til-number-in-man-page-titles-e-g-sleep-3/</link><pubDate>Mon, 17 Nov 2025 13:10:00 +0000</pubDate><guid>https://lalitm.com/til-number-in-man-page-titles-e-g-sleep-3/</guid><description>If you do Linux systems programming, you will have likely pored over man pages, either on the command line or, my personal preference, using the excellent man7.org or linux.die.net. I’ve always seen the numbers in sleep(3) and read(2) and idly wondered what they meant, but never actually bothered to look them up.
That is, until a review comment on a pull request:
// Behaves like man 2 basename
reviewer: nit: it’s not a syscall, so “man 2” is incorrect
So I looked it up. The answer was in the man(1) page (also accessible via the delightful man man command):
The table below shows the section numbers of the manual followed by the types of pages they contain.
1 Executable programs or shell commands 2 System calls (functions provided by the kernel) 3 Library calls (functions within program libraries) (... less common section numbers) So my colleague was right and the code should have read // behaves like man 3 basename as basename(3) is a libc library call.</description><content:encoded>&lt;p&gt;If you do Linux systems programming, you will have likely pored over &lt;code&gt;man&lt;/code&gt; pages, either on the command line or, my personal preference, using the excellent &lt;a href="https://man7.org"&gt;man7.org&lt;/a&gt; or &lt;a href="https://linux.die.net/man/"&gt;linux.die.net&lt;/a&gt;.
I&amp;rsquo;ve always seen the numbers in &lt;a href="https://man7.org/linux/man-pages/man3/sleep.3.html"&gt;&lt;code&gt;sleep(3)&lt;/code&gt;&lt;/a&gt; and &lt;a href="https://man7.org/linux/man-pages/man2/read.2.html"&gt;&lt;code&gt;read(2)&lt;/code&gt;&lt;/a&gt; and idly wondered what they meant, but never actually bothered to look them up.&lt;/p&gt;
&lt;p&gt;That is, until a review comment on a pull request:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;// Behaves like man 2 basename&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;reviewer: nit: it&amp;rsquo;s not a syscall, so &amp;ldquo;man 2&amp;rdquo; is incorrect&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So I looked it up. The answer was in the &lt;a href="https://man7.org/linux/man-pages/man1/man.1.html"&gt;&lt;code&gt;man(1)&lt;/code&gt;&lt;/a&gt; page (also accessible via the delightful &lt;code&gt;man man&lt;/code&gt; command):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The table below shows the section numbers of the manual followed by the types of pages they contain.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; 1 Executable programs or shell commands
2 System calls (functions provided by the kernel)
3 Library calls (functions within program libraries)
(... less common section numbers)
&lt;/code&gt;&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;So my colleague was right and the code should have read &lt;code&gt;// behaves like man 3 basename&lt;/code&gt; as &lt;a href="https://man7.org/linux/man-pages/man3/basename.3.html"&gt;&lt;code&gt;basename(3)&lt;/code&gt;&lt;/a&gt; is a libc library call.&lt;/p&gt;
&lt;p&gt;And there&amp;rsquo;s more to these numbers than what the &lt;code&gt;man man&lt;/code&gt; page describes: various letters can also be attached as suffixes to the numbers. For example, &lt;code&gt;p&lt;/code&gt; indicates a POSIX man page like with &lt;a href="https://man7.org/linux/man-pages/man3/free.3p.html"&gt;&lt;code&gt;free(3p)&lt;/code&gt;&lt;/a&gt; and &lt;code&gt;x&lt;/code&gt; indicates X documentation like with &lt;a href="https://man7.org/linux/man-pages/man3/ncurses.3x.html"&gt;&lt;code&gt;ncurses(3x)&lt;/code&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s embarrassing to admit I&amp;rsquo;ve been using man pages for years but only learned this today.&lt;/p&gt;</content:encoded></item><item><title>TIL: Diátaxis: Systematic technical documentation</title><link>https://lalitm.com/til-diataxis-systematic-technical-documentation/</link><pubDate>Sun, 02 Nov 2025 23:44:00 +0000</pubDate><guid>https://lalitm.com/til-diataxis-systematic-technical-documentation/</guid><description>A few weeks ago, I wrote about “The Documentation System” and how valuable I found it. As I dug deeper into researching how best to apply the principles outlined there, I came across Diátaxis. Written by the same author after they left Divio, Diátaxis is a distillation of all the principles with much more guidance in how to apply the framework (e.g. giving more examples), diving more into the philosophy and in general being a more comprehensive view into how to write great technical docs.
I’m blown away by how well the framework (and Diátaxis makes clear it is a framework not a rigid set of rules) is explained. It’s patently obvious that the author really understands technical documentation and they truly have given a gift to the industry by writing it up.
Finding Diátaxis has only made me more motivated to deeply absorb its principles and see how to best apply it to all technical documentation I refactor and/or write going forward.</description><content:encoded>&lt;p&gt;A few weeks ago, I &lt;a href="https://lalitm.com/til-the-documentation-system-divio/"&gt;wrote&lt;/a&gt; about &amp;ldquo;The Documentation System&amp;rdquo; and how valuable I found it. As I dug deeper into researching how best to apply the principles outlined there, I came across &lt;a href="https://diataxis.fr/"&gt;Diátaxis&lt;/a&gt;. Written by the same author after they left &lt;a href="https://www.divio.com/"&gt;Divio&lt;/a&gt;, Diátaxis is a distillation of all the principles with much more guidance in how to apply the framework (e.g. giving more examples), diving more into the philosophy and in general being a more comprehensive view into how to write great technical docs.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m blown away by how well the framework (and Diátaxis &lt;a href="https://diataxis.fr/how-to-use-diataxis/#use-diataxis-as-a-guide-not-a-plan"&gt;makes clear&lt;/a&gt; it is a framework &lt;strong&gt;not&lt;/strong&gt; a rigid set of rules) is explained. It&amp;rsquo;s patently obvious that the author really understands technical documentation and they truly have given a gift to the industry by writing it up.&lt;/p&gt;
&lt;p&gt;Finding Diátaxis has only made me more motivated to deeply absorb its principles and see how to best apply it to all technical documentation I refactor and/or write going forward.&lt;/p&gt;</content:encoded></item><item><title>TIL: Public File Hosting with 0x0.st</title><link>https://lalitm.com/til-public-file-hosting-with-0x0-st/</link><pubDate>Sat, 25 Oct 2025 15:13:00 +0100</pubDate><guid>https://lalitm.com/til-public-file-hosting-with-0x0-st/</guid><description>Sometimes you run into a truly inspirational piece of software that it’s a wonder even exists. I found 0x0.st recently and it very much falls into this bucket.
It’s essentially a simple, no-account, temporary file hosting site where you can just upload a file using a simple HTTP POST and the site will host it for you for between 30 days and 1 year depending on the size of the file. Uploading a file is as simple as:
curl -F 'file=@yourfile.ext' https://0x0.st and you’ll get back a URL that you can share or use in the future.
I thought all the services like this had long since disappeared especially in the age of increasing scrutiny by government of content that websites host. It turns out though that from this discussion on HN, there are actually a bunch of similar services (transfer.sh, bashupload.com, chunk.io) but 0x0.st was the only one which I was able to access without an error.</description><content:encoded>&lt;p&gt;Sometimes you run into a truly inspirational piece of software that it&amp;rsquo;s a wonder even exists. I found &lt;a href="https://0x0.st/"&gt;0x0.st&lt;/a&gt; recently and it very much falls into this bucket.&lt;/p&gt;
&lt;p&gt;It&amp;rsquo;s essentially a simple, no-account, temporary file hosting site where you can just upload a file using a simple HTTP POST and the site will host it for you for between 30 days and 1 year depending on the size of the file. Uploading a file is as simple as:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-fallback" data-lang="fallback"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -F &amp;#39;file=@yourfile.ext&amp;#39; https://0x0.st
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;and you&amp;rsquo;ll get back a URL that you can share or use in the future.&lt;/p&gt;
&lt;p&gt;I thought all the services like this had long since disappeared especially in the age of increasing scrutiny by government of content that websites host. It turns out though that from this discussion on &lt;a href="https://news.ycombinator.com/item?id=35491520"&gt;HN&lt;/a&gt;, there are actually a bunch of similar services (transfer.sh, bashupload.com, chunk.io) but 0x0.st was the only one which I was able to access without an error.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m particularly impressed by the &lt;a href="https://movsw.0x0.st/@0x0"&gt;transparency&lt;/a&gt; of the owner of 0x0.st about the challenges they face and how they deal with the problems of abuse, malware etc. Many of these are precisely what I thought were insurmountable of hosting a service like this but apparently there are people out there willing to overcome them!&lt;/p&gt;</content:encoded></item><item><title>TIL: `will-change` and `isolation` CSS properties</title><link>https://lalitm.com/til-will-change-and-isolation-css-properties/</link><pubDate>Fri, 24 Oct 2025 00:20:00 +0100</pubDate><guid>https://lalitm.com/til-will-change-and-isolation-css-properties/</guid><description>The Perfetto UI is a fascinating project to work on because it often faces performance problems which you wouldn’t see in more “normal” webapps. I learn about all sorts of weird web features by reviewing PRs for the UI.
Two such features I just learned about:
will-change (PR): a hint, to be used sparingly, to tell the browser that a certain property of a DOM element will change in the near future. isolation (PR): I feel MDN didn’t do a great job of explaining so I asked Claude which gave a much more useful answer: isolation is a CSS property that creates a new stacking context for an element. Think of a stacking context as a self-contained z-index universe. Elements within one stacking context can layer on top of each other, but their z-index values only matter relative to siblings within that same context.</description><content:encoded>&lt;p&gt;The Perfetto UI is a fascinating project to work on because it often faces performance problems which you wouldn&amp;rsquo;t see in more &amp;ldquo;normal&amp;rdquo; webapps. I learn about all sorts of weird web features by reviewing PRs for the UI.&lt;/p&gt;
&lt;p&gt;Two such features I just learned about:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/will-change"&gt;will-change&lt;/a&gt; (&lt;a href="https://github.com/google/perfetto/pull/3350/files#diff-c57fa71e0c282ce81f65b10226043f6d89c4105afd3f5ec5813b8d9d5e034101R128"&gt;PR&lt;/a&gt;): a hint, to be used sparingly, to tell the browser that a certain property of a DOM element will change in the near future.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/isolation"&gt;isolation&lt;/a&gt; (&lt;em&gt;&lt;a href="https://github.com/google/perfetto/pull/3381/files#diff-c57fa71e0c282ce81f65b10226043f6d89c4105afd3f5ec5813b8d9d5e034101R119"&gt;PR&lt;/a&gt;&lt;/em&gt;):
I feel MDN didn&amp;rsquo;t do a great job of explaining so I asked Claude which gave a much more useful answer:
&lt;blockquote&gt;
&lt;p&gt;isolation is a CSS property that creates a new stacking context for an element. Think of a stacking context as a self-contained z-index universe. Elements within one stacking context can layer on top of each other, but their z-index values only matter relative to siblings within that same context.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;/ul&gt;</content:encoded></item><item><title>TIL: The Documentation System (Divio)</title><link>https://lalitm.com/til-the-documentation-system-divio/</link><pubDate>Sun, 19 Oct 2025 19:38:00 +0100</pubDate><guid>https://lalitm.com/til-the-documentation-system-divio/</guid><description>The Perfetto team spent a lot of time earlier this year rewriting our documentation to be more useful for the average developer. We struggled a lot to figure out “what is the best way to structure our documentation”.
When reading Examples are the best documentation today, I came across The Documentation System, an approach to structuring developer documentation. Reading through it, I couldn’t help but marvel at how clear and concisely it laid out the ideas we were struggling to come up with from first principles.
Specifically, I really like how it breaks down documentation into four quadrants:
Tutorials: take your user through a series of steps to complete some task with your project. How-to guides: solve a real world problem with your project. Reference guides: give technical explanations of how things work. Explanations: clarify a particular topic or area and how the project fits into the bigger tech landscape. I think we got most of this right in our documentation rewrite but we definitely muddled some of these areas together, making our pages less clear than they could be. I plan on spending some time later this year correcting our docs to match this system closer.</description><content:encoded>&lt;p&gt;The Perfetto team spent a lot of time earlier this year rewriting our documentation to be more useful for the average developer. We struggled a lot to figure out &amp;ldquo;what is the best way to structure our documentation&amp;rdquo;.&lt;/p&gt;
&lt;p&gt;When reading &lt;a href="https://rakhim.exotext.com/examples-are-the-best-documentation"&gt;Examples are the best documentation&lt;/a&gt; today, I came across &lt;a href="https://docs.divio.com/documentation-system/"&gt;The Documentation System&lt;/a&gt;, an approach to structuring developer documentation. Reading through it, I couldn&amp;rsquo;t help but marvel at how clear and concisely it laid out the ideas we were struggling to come up with from first principles.&lt;/p&gt;
&lt;p&gt;Specifically, I really like how it breaks down documentation into four quadrants:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a href="https://docs.divio.com/documentation-system/tutorials/"&gt;&lt;strong&gt;Tutorials&lt;/strong&gt;&lt;/a&gt;: take your user through a series of steps to complete some task with your project.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.divio.com/documentation-system/how-to-guides/"&gt;&lt;strong&gt;How-to guides&lt;/strong&gt;&lt;/a&gt;: solve a real world problem with your project.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.divio.com/documentation-system/reference/"&gt;&lt;strong&gt;Reference guides&lt;/strong&gt;&lt;/a&gt;: give technical explanations of how things work.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.divio.com/documentation-system/explanation/"&gt;&lt;strong&gt;Explanations&lt;/strong&gt;&lt;/a&gt;: clarify a particular topic or area and how the project fits into the bigger tech landscape.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I think we got &lt;em&gt;most&lt;/em&gt; of this right in our documentation rewrite but we definitely muddled some of these areas together, making our pages less clear than they could be. I plan on spending some time later this year correcting our docs to match this system closer.&lt;/p&gt;</content:encoded></item></channel></rss>