# fir (blogs) — RSS Amplifier

Recent posts from the 3 feeds in the RSS Amplifier directory that cover fir.

Page: <https://rssamplifier.com/topics/fir/blogs>  
Feed: <https://rssamplifier.com/topics/fir/blogs.md>

---

## [Unification and impl search](http://osa1.net/posts/2026-07-31-impl-search-unification.html)

_2026-07-31 · osa1.net - All posts_

At a high level Haskell’s typeclasses and Rust’s traits are the same feature, but they also differ quite a bit in details. Here’s an example: struct A; trait C\<T\> {} impl\<T\> C\<T\> for Option\<T\> {} // ∀ T . C\<Option\<T\>, T\> fn f\<P, Q\>(p: P, q: Q) where P: C\<Q\> {} fn main() { f(None, A); } - {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} data A = A class C a b instance C (Maybe t) t f :: C…

## [Macros in Fir](http://osa1.net/posts/2026-05-12-fir-macros.html)

_2026-05-12 · osa1.net - All posts_

Fir macros are fully deterministic programs that are distributed separately and that can introspect into the using program’s type-checked AST definitions. Deterministic execution of macros is necessary to be able to Cache macro results in the language server and between compilation of a package during development. Avoid the issues with build scripts in many languages that can run arbitrary code…

## [Languages should have opinionated interop features](http://osa1.net/posts/2026-05-10-interop-features.html)

_2026-05-10 · osa1.net - All posts_

A lesson we can derive from Rust’s error handling and async libraries, and Haskell’s effect system libraries, is that languages need to have opinionated (and efficient, flexible) interop features. If not and the language is flexible enough (with an expressive type system, and maybe also with metaprogramming features), users create their own solutions and the ecosystem gets fragmented. Consider…

## [A text editor I worked on in 2021-2023](http://osa1.net/posts/2026-05-07-my-text-editor.html)

_2026-05-07 · osa1.net - All posts_

I was just going through old files and saw a cool video of an old project that I thought I should share. In January 2021 I started working on a new text editor. Zed didn’t exist publicly at the time (it must’ve been under development) and two projects were getting a lot of hype: Alacritty because of its renderer Tree-sitter because IIRC Neovim was about to ship built-in support for tree-sitter…

## [Fir now compiles to C (+ extensible named types, associated types, modules, and more)](http://osa1.net/posts/2026-04-15-fir-devlog.html)

_2026-04-15 · osa1.net - All posts_

One of my original goals with Fir was to bootstrap it as early as possible. I was so determined, I committed the first code for the self-hosted compiler in the 322nd commit , on 11 April 2025, after less than a year of development in the open source 1 , when it was barely usable. To understand how early this is, we’re currently on commit 1,052, and in my opinion it only recently became somewhat…

## [Exceptions as shared secrets, demonstrated](http://osa1.net/posts/2026-03-13-exceptions-as-shared-secrets.html)

_2026-03-13 · osa1.net - All posts_

Robert Harper’s “Exceptions Are Shared Secrets” is an intriguing blog post, but it may come as a bit abstract unless you’re already familiar with the idea of accidental exception (or more generally, effect) handling, as the post has no code. In this post I want to give an example of the problems mentioned in the original post, and say a few words on how we might go about working around or fixing…

## [Containing contagious types with OCaml modules](http://osa1.net/posts/2026-03-10-containing-contagious-types.html)

_2026-03-10 · osa1.net - All posts_

In the previous post we looked at a way to extend product types with new fields and sum types with new constructors, using row types, in Fir. A problem with the approach was that it required adding type parameters to the type being extended. In the cases where the extended type is a sum type and different constructors are extended with different fields, we may even need more than one type…

## [Extensible named types in Fir](http://osa1.net/posts/2026-03-07-extensible-named-types-fir.html)

_2026-03-07 · osa1.net - All posts_

The front-end AST types are one of the most important types in a language implementation, and if we get them wrong nothing will be right in the rest of the implementation. These types should be cheap to allocate and efficient to use, but also extensible, as different tools will use them differently. A type checker may want to add inferred types to expressions, but for a formatter, those inferred…

## [How Fir formats comments](http://osa1.net/posts/2025-09-27-fir-formatter.html)

_2025-09-27 · osa1.net - All posts_

Fir formats comments by assigning comment tokens to non-comment tokens (only conceptually, not in the implementation, see below), and generating comments when formatting the tokens that “own” them. This keeps AST nodes small. The parser doesn’t know about comments at all, and code that doesn’t care about comments don’t allocate more or run more code for comments. Formatting source code with…

## [Fir is getting useful](http://osa1.net/posts/2025-09-04-fir-getting-useful.html)

_2025-09-04 · osa1.net - All posts_

A few months ago I implemented a PEG parser generator in Fir. It parses its own grammar and it’s also used to parse Fir . This week I finished another sizable 1 Fir project: a code formatter for Fir . It now formats most of the Fir code in the repo 2 . Fir is being designed and implemented from day one with tooling, libraries, and backwards compatibility in mind. The compiler’s front-end is…

## [Refer a Friend, Earn Rewards (Sponsored)](https://crawlproof.com/a/6eWc0E4iESyj)

_2025-09-03 · **Sponsored**_

Earn rewards when friends get the Graphite Business Card through your referral.

## [My GPU Fan Saga](https://shafq.at/my-gpu-fan-saga.html)

_2025-07-21 · Ayan Shafqat · Ayan Shafqat_

Having a problem-solving mindset is incredibly valuable and rewarding, especially when it leads to exciting DIY adventures. My latest experience with a noisy GPU fan turned into just such an opportunity. It guided me through fascinating explorations involving ATX power, MOSFET motor drivers, Pulse Width Modulation (PWM), ATTiny85's bit-banged 1-wire …

## [Fixed-Point Tutorial #2](https://shafq.at/fixed-point-tutorial-2.html)

_2025-03-27 · Ayan Shafqat · Ayan Shafqat_

Introduction I've received a lot of feedback on my blog posts over the past few months. I'm humbled and grateful for the suggestions, and I always look forward to hearing from readers. You'll often see that I leave my mistakes in the posts along with the corrections, giving credit where …

## [Vectorizing IIR Filters: What are you Recursing?](https://shafq.at/vectorizing-iir-filters.html)

_2025-02-12 · Ayan Shafqat · Ayan Shafqat_

Disclaimer: This article took quite a while to prepare. Although I’ve made every effort to fact-check and ensure the accuracy of the content, there may still be errors. If you notice any mistakes, please feel free to reach out and let me know! I like writing programs that run …

## [Strange Corners of C: Entering The Twilight Zone of the C Compiler](https://shafq.at/strange-corners-of-c.html)

_2025-02-10 · Ayan Shafqat · Ayan Shafqat_

C is a fascinating programming language, simple enough to learn in a few days, yet powerful enough to build the world's most complex systems. With its lightweight runtime, C runs everywhere! From microwave ovens to spacecrafts, and everything in between. Sometimes, I can’t help but wonder: Is the universe …

## [An Alternate Present: Sound Policy, Standardization, and Global Collaboration](https://shafq.at/an-alternate-present.html)

_2025-02-09 · Ayan Shafqat · Ayan Shafqat_

It has been just over five year since the government set in motion to breakup up tech monopolies. It was not a dramatic revolution, but enacting a series of incremental policy updates, revising tax codes, and introducing new guidelines for technology that touches every facet of our lives. Although this …

## [Float to Q1.15: A FizzBuzz for Audio Technical Interview](https://shafq.at/fizzbuzz-for-audio.html)

_2025-01-19 · Ayan Shafqat · Ayan Shafqat_

An easy-sounding “Float to Q1.15 ” challenge is proposed as an audio FizzBuzz interview question.

