I recently wanted to get the Haskell SDK bindings running on windows. It was a bit trickier than I thought it would be — mostly due to a terrible macro SDL used to redefine the main() function. I used the SDL 1.2 bindings as they’re a little more mature than the SDL 2 bindings, which […]
Haskell is my language of choice, and one of the features that I miss the most when working in a different language is algebraic data types. I get particularly frustrated about the lack of algebraic data types (and the associated destructuring) because they are so simple. You don’t need any fancy runtime features to make […]
In one of my previous posts, I described an implementation of miniKanren in Haskell. I have since been improving the implementation. I am currently working on the third iteration of my logic library. The first one was described by my previous post. The second is in a GitHub repository. I have yet to settle on […]
When I recommend learning Haskell to the uninitiated, I often get asked: “Why Haskell?” “Is it a practical language?” and “Is it something I can actually use?” My answer is definitely yes. Haskell isn’t my primary language at work (I mostly write C code for embedded systems), I’ve still found it incredibly useful. And even if […]
I like to use Haskell to make little utilities for work. This can range from tools to analyze C code to code generation. When creating these utilities, the most tedious part for me is almost always the creation of some sort of command line interface to my code. Argument parsing is a pain in almost […]
This year at Strange Loop I was totally blown away by the miniKanren talk by Daniel Friedman and William Byrd. I highly recommend watching the presentation. It is simultaneously entertaining and mind blowing. Friedman and Byrd used an extended version of miniKanren, a logic programming language (a la prolog) embedded in scheme, to do several remarkable things: Generate programs that […]
A simple example of using the 'indents' library to implement indentation parsing with Haskell's Parsec library.
The tools for compiler construction have gotten so good that building a JIT or native code compiler for a custom language can be written in just a few hours. I’ve implemented an example compiler in about 220 lines of Haskell. It has a fair amount of commentary so it shouldn’t be too hard to follow. The toy […]