Archives
All the articles I've archived.
Compilers are hard
Writing (something like) a compiler is hard. Here I explore what some of the difficulties are, and provide some strategies to ensure you still maintain quality.
Scala, React, and SSR (part 2)
GraalVM lets us perform SSR but it's unfortunately still not fast enough yet. Luckily there's a way to have our cake and eat it too.
Scala, React, and SSR (part 1)
In the JS world, React devs can render their pages on the server side for a better user experience. Here's how to do in the Scala world.
Enforcing rules at compile-time: an example
Using a type-level Option encoding and @implicitNotFound in Scala to enforce React lifecycle method ordering rules at compile time in scalajs-react.
Practical Awesome Recursion - Ch 02: Catamorphisms
Chapter 2 of the Practical Awesome Recursion series in Scala: catamorphisms, F-algebras, performance optimization, and composable file system queries.
Practical Awesome Recursion - Ch 01: Fixpoints
Chapter 1 of the Practical Awesome Recursion series in Scala: preparing recursive data types with type parameters, Functor instances, and Fix.
Dependently-Typed Functions
How to implement exhaustive dependently-typed methods and first-class dependently-typed function values in Scala using path-dependent types and higher-kinded folds.
Testing Scala.JS on Firefox & Chrome from SBT
How to integrate scala-js-env-selenium into an SBT project to run Scala.JS unit tests headlessly on real Firefox and Chrome browsers without recompiling.
Zero-overhead Recursive ADT Coproducts
Modeling zero-overhead, sealed, recursive ADT coproducts in Scala using path-dependent types and trait composition, compared against inheritance hacks and Shapeless.
An Example of Functional Programming
A practical, beginner-friendly walkthrough of functional programming in Scala, incrementally building a composable user-data validation library across five evolving requirements.
A Year of Functional Programming
Reflections after one year of functional programming—from discovering Scala, Haskell, and Scalaz to embracing abstractions, expressive types, property-based testing, and computer science academia.
Scala: Methods vs Functions
Micro-benchmarking Scala methods versus first-class Function instances using ScalaMeter across direct invocation, higher-order passing, and primitive vs object boxing.
Keyed Lenses
Introducing KeyedLens in Scala and Scalaz—a composable lens variant that requires a key to focus into maps or indexed collections, propagating keys cleanly through composition.
Trial: Choosing Lift over Rails
Starting a new webapp with Scala's Lift framework instead of Ruby on Rails — weighing security, speed, snippets, and Ajax against a smaller ecosystem.
Lessons Learnt on My Second Android App - Pt.1
Bitmap scaling, manual bitmap memory cleanup, PNGOUT compression, and screen width lessons learned while building my second Android app, Time Us!.
Android Project Templates
Three Maven and Eclipse compatible Android project templates for Java, single-app Scala, and dual free/paid Scala editions.
Releasing an App for Android - Part 2
Part 2 of lessons from releasing my first Android app: free and paid editions, AdMob advertising, localisation, Proguard, signing, and Maven vs SBT.
Releasing an App for Android - Part 1
Part 1 of lessons from releasing my first Android app (BPM Tapper): Android completeness, multi-density layouts, using Scala on Android, and vector artwork.
Maven: Now with Colour™ !
A bash and Perl wrapper script that adds ANSI colour highlighting to Maven CLI output and strips noisy failure boilerplate.
Rant: Stupid Maven
Venting frustrations with Maven around distributionManagement in POMs, single-inheritance parent POMs, uninherited plugin versions, and verbose XML.
Problems with at_exit{}, exit(), and RSpec
Why Ruby at_exit cleanup hooks can clobber $! and cause RSpec to return exit code 0 on test failures, and a helper method to preserve the exit status.
I Have Returned
Back home after four months of overseas travel across Asia and India, ready to focus on work and blogging again.
Ruby Mutex Reentrancy
Discovering that Ruby's Mutex is not reentrant, using Monitor instead, and benchmarking the performance trade-off across MRI and JRuby.
Ruby JSON Libraries
Benchmarking Ruby and JRuby JSON libraries (Oj, YAJL, json-jruby, json_pure, json, OkJson, and jrjackson) across MRI, OpenJDK, and Oracle Java.
I Have Blog
Starting a new blog for the first time in nearly six years, christened with a favourite excerpt from Steven Erikson's Malazan Book of the Fallen.