from/prod
← All companies

THE COMPANY INDEX TRACKED BLOG

Abhinav Sarkar

Ideas, decisions, and lessons from the team.

abhinavsarkar.net (opens on the source site)
25Posts tracked
2 months agoLatest publication
0.3Posts / month over the last 12 months

Latest writing

20 of 25 posts

How I use Jujutsu (opens on the source site)

About three months ago I started using Jujutsu (JJ), a new Version Control System, for my personal projects. It took me a while to get used to it after more than a decade of using Git, but now I’m quite comfortable with it. Working with Jujutsu requires a shift from the mental model of Git. However, it is not as daunting as it may seem on the first day.

Read at the source

A Fast Bytecode VM for Arithmetic: The Virtual Machine (opens on the source site)

In this series of posts, we write a fast bytecode compiler and a virtual machine for arithmetic in Haskell. We explore the following topics: Parsing arithmetic expressions to Abstract Syntax Trees (ASTs). Unit testing for our parser. Interpreting ASTs. Compiling ASTs to bytecode. Disassembling and decompiling bytecode. Unit testing for our compiler. Property-based testing for our compiler. Efficiently executing bytecode in a virtual machine (VM). Unit testing and property-based testing for our VM. Benchmarking our code to see how the different passes perform. All the while keeping an eye on…

Read at the source

A Fast Bytecode VM for Arithmetic: The Compiler (opens on the source site)

In this series of posts, we write a fast bytecode compiler and a virtual machine for arithmetic in Haskell. We explore the following topics: Parsing arithmetic expressions to Abstract Syntax Trees (ASTs). Unit testing for our parser. Interpreting ASTs. Compiling ASTs to bytecode. Disassembling and decompiling bytecode. Unit testing for our compiler. Property-based testing for our compiler. Efficiently executing bytecode in a virtual machine (VM). Unit testing and property-based testing for our VM. Benchmarking our code to see how the different passes perform. All the while keeping an eye on…

Read at the source

A Fast Bytecode VM for Arithmetic: The Parser (opens on the source site)

In this series of posts, we write a fast bytecode compiler and a virtual machine for arithmetic in Haskell. We explore the following topics: Parsing arithmetic expressions to Abstract Syntax Trees (ASTs). Unit testing for our parser. Interpreting ASTs. Compiling ASTs to bytecode. Disassembling and decompiling bytecode. Unit testing for our compiler. Property-based testing for our compiler. Efficiently executing bytecode in a virtual machine (VM). Unit testing and property-based testing for our VM. Benchmarking our code to see how the different passes perform. All the while keeping an eye on…

Read at the source

Solving Advent of Code “Seating System” with Comonads and Stencils (opens on the source site)

In this post, we solve the Advent of Code 2020 “Seating System” challenge in Haskell using comonads and stencils. This post was originally published on abhinavsarkar.net. This post is a part of the series: Solving Advent of Code. “Handy Haversacks” in Type-level Haskell “No Space Left On Device” with Parsers, Zippers and Interpreters “Rock-Paper-Scissors” in Type-level Haskell “Aplenty” by Compiling “Seating System” with Comonads and Stencils 👈 Contents The Challenge The Cellular Automaton The Solution The Zipper The Comonad The Array The Stencil The Challenge# Here’s a quick summary of the…

Read at the source

Going REPLing with Haskeline (opens on the source site)

So you went ahead and created a new programming language, with an AST, a parser, and an interpreter. And now you hate how you have to write the programs in your new language in files to run them? You need a REPL! In this post, we’ll create a shiny REPL with lots of nice features using the Haskeline library to go along with your new PL that you implemented in Haskell.

Read at the source

Nix for Haskell: Getting Started (opens on the source site)

So, you’ve heard of the new hotness that is Nix, for creating reproducible and isolated development environments, and want to use it for your new Haskell project? But you are unclear about how to get started? Then this is the guide you are looking for.

Read at the source

Writing a Static Site Generator Using Shake (opens on the source site)

Static site generators (SSGs) are all rage these days as people realize that plain HTML websites are good enough for most cases. SSGs take raw data in various formats—often Markdown, JSON, and YAML—and process them to produce the static websites, which can then be hosted easily on any hosting provider, or on personal VPSes. In this post, we write a bespoke SSG using the Shake build system.

Read at the source

Just, Nix Shell and Podman are a Killer Combo (opens on the source site)

Let’s say, for some unclear reasons, you need to compile the “Hello World” C program using a variety of C compilers. #include int main() { printf("Hello World"); return 0; } hello.c Let’s also say that your dev machine is a MacBook, and some of these C compilers run only on Linux. Thanks to the advancements made in Nix, everything in this post is completely unnecessary now. Just setup a Linux builder on Macos by following this tutorial, and mark the Linux-only packages so in their Nix config using the system parameter for the nixpkgs config. Rest is taken care by Nix automatically. Let’s…

Read at the source

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.