Summary of recent reading(October-December 2019)
Issola by Steven Brust:
[spoiler]The Jenoine, the alien species that created Dragaerans and who once ruled the earth, kidnap Morrolan and Aliera in order to try to get Vlad to kill Verra. This turns out to be part of a bigger plan to use the earth’s Lesser Sea of Chaos to create their own Orb. Lady Teldra gets killed in a battle between gods and Jenoine, and Spellbreaker turns into a Great Weapon where Lady Teldra lives on.…
Read more ⟶
On porting code
Of late, my main side project has been rug, a stripped-down Git implementation which I’m building in Rust. I’m following along James Coglan’s excellent book [Building Git][building-git] where he lays out how he went about building the same project, in Ruby.
In essence, my project boils down to porting [James’s code][jit]1 into Rust. But why bother with this at all? After all, porting code from one language to another is probably not on your top ten list of cool project ideas.…
Read more ⟶
Piping output to a pager
When you run git diff on a project where you’ve made more than a screenful of changes, the output is automatically redirected to a pager and you can browse through your changes using the familiar less interface. This post shows a minimal example piping output to less.
To achieve this, git creates a pipe and spawns a new process, whose purpose is to exec the pager.
int fds[2]; if (pipe(fds) == -1) { perror_die("pipe"); } int child_pid = fork(); Let’s start by looking at the parent process, even though in the code this case is handled last.…
Read more ⟶
Myers' diff algorithm in Clojure
If you’re a programmer, you’re probably fairly comfortable with understanding and interpreting diff patches of the kind that git and other version control systems use. In this post we’ll walk through a Clojure implementation of the Myers' diff algorithm, which is the algorithm used by Git.
I have been implementing Git following along James Coglan’s book “Building Git”– you can check out the project here. The project itself is in Rust but I thought it might be an interesting exercise to implement the algorithm in Clojure.…
Read more ⟶
Summary of recent reading(July-September 2019)
The Little Elixir & OTP Guidebook by Benjamin Tan Wei Hao: an introduction to the Elixir programming language and the OTP framework that comes with it. It focusses on Elixir’s concurrency features and shows you what OTP can do(the book mostly focusses on GenServers and Supervisors) without spending too much time on the language itself– the idea being to get someone already familiar with functional programming excited about the features that set Elixir apart.…
Read more ⟶