I'm Emil, a developer based in Stockholm, and currently working as an engineer at AWS. As of writing, I've been programming for 25 years, and professionally for the past 20. Since 2018, I've been working mostly in rust, which remains my favorite language.
I'm currently not looking to change jobs. If you are a recruiter thinking of sending me a message anyway, be aware that I'm unlikely to consider any position which isn't about rust.
Based on my Hermes project, I wrote a guide which explains in some detail how to implement a simple DNS Server.
» Read
A discussion about some of the influences of functional programming that has made it into mainstream languages, expressed as a parody of A christmas carol.
» Video
A talk I gave at the Func Prog Sweden meetup on the functional influences in rust.
» Video » Source code
An overview of how we used an early version of warp to build a control plane at Imperva.
» Video
This is an incomplete list of things I've done throughout the years. It's not representative of my professional work, but does convey a good picture of my interests. The major themes are graphics programming, network programming and programming languages.
A display for showing the subway times in Stockholm, built using a raspberry pi and a custom designed 3d printed case. This project includes the rust source code of the display and the STL files for the case.
The objective is to hit bubbles of the same color. If you hit a group of two or more with a bubble of the same color, they'll fall off. Once you've cleared them all, you move to the next level.
The original version of this game has been a pastime of mine for many years, and I've been looking to write my own implementation for a long time. There's a bit of physics-simulation going on here (notably the conservation of angular momentum to calculate rotation speed), which made it a bit extra fun to work on. I've put some extra effort into making the source code readable.
» Play Now » Source code
I've built many different image galleries throughout the years, and most of them has generated thumbnails on demand, which causes a lousy user experience when the gallery is first loaded. A better solution, I believe, is to detect new images and do the work in the background immediately. HostIMG is such a server written in Rust. Given a directory, it'll use inotify to watch for changes, and automatically generate thumbnails. A built-in web server serves up the images in the directory.
A pacman clone in javascript. Originally conceived as a way to explore the utility of immutable state representation in a stateful application like a game.
» Play Now » Source code
Version control of database schemas has always been a pain, and the existing solutions aren't very satisfactory. Furthermore, they don't usually work well with multi-branch workflows in git/hg.
Cesium was an attempt at a solution. It uses a git-inspired patch-based structure, where small sql patch files are chained together. The key idea of Cesium is the built-in sql parser: it can understand the patches without talking to a server. This enables comparison of different branches without talking to a server, comparison of on-disk patches to a running server, and so on.
It was a successful experiment, which demonstrated the power of the concept. I eventually lost interest as I migrated away from using MySQL as a database.
A DNS server written in Rust, with a built-in web server for managing zones. Written as an exploration of the language as well as the details of the protocol. Quite an extensive project, which supports most of the features expected in a DNS server except for spoofing mitigation. Neither heurestic mitigation nor DNSSEC is currently supported, although I'll likely resume development at some point.
This is an experiment with generating java bytecode. After playing around with the asm library for a bit and gaining a better understanding of java bytecode, I decided to implement a simple program which parses mathematical expressions and converts them into executable java classes.
A simple experiment and learning project, written in C++. Uses the phong reflection model to shade objects, with full support for reflections. The source code only depends on libgd2. I used this project to render the picture of earth at the top of this page.
This is to some extent just a C++ port of the Amiga Juggler reimplementation, which kinda shows from the structure of the code, but there's a few enhancements of my own. For instance, support for multiple lights. Further work on this project will probably attempt to introduce an acceleration data structure, and some way of loading scenes from disk.
Toy programming language. It's currently implemented in Java, but I dream of bootstrapping it eventually. Current all execution is interpreted. The language as such is characterized by its static type system, which guarantees type safety. It's a cross between the functional and imperative paradigms. The current lack of support for generic programming combined with the strict type safety limits its usability, although I'm hoping to resolve that eventually.
Plugin for the bukkit minecraft server, that provides most of the features needed to run an economy/survival server. It's a collaboration with a number of other developers, for the Tregmine minecraft server.
Experiment with software rasterization. Written mostly as a learning project, and horrendously unoptimized. When I started out with this, I had no experience whatsoever in 3d programming, and thus I spent some time documenting my research as a diary, which is available in the repository. (I did have a solid understanding of basic linear algebra, though.)
The major feature I never got around to would be texture mapping, which will probably be added at some point. Still, it'd be hard to argue that this project is suited for any real life applications, even after that's done.
» Source code » Download
A java implementation of the SASS language, which is a superset of CSS. Based on a JavaCC grammar. See link for a more complete description.
» Source code » Download
A java implementation of an irc server. It was designed in a way that would make it easy to add other protocols, with a core that simply manages the server state. The only other protocol that I ever tried adding was minecraft support, by embedding it in bukkit, and wrapping the mc-related state in a protocol handler. It worked pretty well, and turned out really cool.
fatcat has a completely asynchronous network thread using java.nio. There's currently no support for linking other servers, and also no services. I have some wild ideas about expanding fatcat with distributed linking support, and using something like vector clocks to synchronize state, but I'm not sure when I'll get around to that.
» Source code » Download
A visualizer framework for spotify, using the official libspotify. Includes some simple FFT-based visualizers, that doesn't work nearly as well as I'd hoped. This is entirely due to my severely lacking understanding of signal processing. The addition of some type of online filter would probably result in a lot more recognizable beats. It does look pretty nice, though. Uses the windows DirectDraw API.
» Source code » Download
Horrendously ugly tetris clone. WinApi and DirectDraw. My first and final attempt at doing game graphics.
» Source code » Download
Simple program to crop images quickly. Written using WinApi and GDI+. I wrote this to optimize my photo editing workflow, since it felt a bit too painful to launch a full image editor every time I simply wanted to crop an image. This is my attempt to solve that specific problem in a really lightweight way.
» Source code » Download
A small unix program that constructs an image mosaic from a source image and a collection of smaller images (mosaic bricks). There's a few major issues with this program:
An implementation of the seam carving algorithm I did back when it was first released. I was absolutely fascinated by the paper, and implemented it in both PHP and Java. This repository contains only the java-version, which has some interesting quirks. For instance, I'm calculating the energy of the image using a literal interpretation of the method in the paper rather than using a simple sobel transform. This involves interpolating the pixels as a cubic equation and calculating the partial derivatives. As far as I can tell, this has no real advantages over the sobel approach, but it's a rather beuatiful over-complication.
Smaller projects and experiments I've done, of somewhat varying quality.
You can get in contact with me using my gmail. My username is emil.hernvall.