All of the things labelled as Posts, so that crawlers have a place to find them.
Breaking the type tree with modifiers
A language’s type hierarchy is formed with both linking and attributes. But what if a uniform hierarchy is not the correct way to represent a
Modelling type systems: The basics
I’m in the midst of reworking a significant aspect of the type system in Leaf. It’s a lot of work, and I’d like to avoid
Overloading the broken universal reference ‘T&&’
C++11 introduced a perfect forwarding mechanism for template parameters. The key part is the ability for a template parameter to match any input without any
How to catch a “return” statement
Does ‘return’ always cause a function to return? Surprisingly the answer is “no”. Indeed there are situations in which ‘break’ may not always break from
Building blocks: Compiling if, defer, break, continue, and exceptions
One way to convert source code to machine code is via “basic blocks”. After parsing and semantic processing, and just prior to machine code generation,
1/2 Should Not Equal Zero
There’s something wrong when a language allows 1/2 to equal 0. It’s easy to understand why this happens, and perhaps it’s even easy to forgive
Why do we need pointers/references?
Below I’ve tried to catalog some of the typical uses of references in programming. My aim is to clarify the role references play in a
Parsing an exact decimal value using GMP
For Leaf, I need to parse decimal numbers to retain the exact value of the input without rounding. I assumed such a library would exist
Leaf: Simple type conversions
One of the problems with C++ is the way it handles type conversion. It inherits a lot of implicit conversion from C and then adds
Leaf: Preserving “lvalue” status
I’ve been reworking how I handle basic type conversion in Leaf. This is a mechanism which allows implicit conversion of simple types. As part of
What is a System Language?
Not all languages are made with the same purpose in mind. When it comes to designing a new language like Leaf, it’s important to choose
Immutable Values and Invariant Names
Programmers don’t usually spend a lot of time thinking carefully about names and values. As long as we follow a few basic rules, our code

Divorcing a value from its name
Understanding “values” is perhaps the most critical part of understanding programming. We are inundated with a variety of terms like “by value”, “by reference”, “member
How to handle an error
Error handling should be simple. It can become mired in complexity, but I don’t believe it has to be that way. If we stay focused
Of Faults and Errors: Who’s to blame?
Is there a difference between a “fault” and an “error” within a computer program? A number of people commented on my previous article suggesting this
Antiquated Error Handling: abort/exit
The abort function is a remnant of old programming practices, and it pains me to see it in modern software. While it’s great that a
What is a closure?
Closures have been around a long time yet have experienced a resurgence in the last decade. They were first implemented in the functional language Scheme
A trail through custom languages
How often does one need to write a custom language? Many projects often shun them, but I think domain specific languages are important. They offer
The syntax of a conditional
Conditionals are a key construct in programming: from the simple if statement, to loops and switches, and even to dynamic mapping. The essence of program
Why I have my own Android game framework
All I wanted to do was to make a game for my Android tablet, so how come I ended up writing a new C++ framework?
Android NDK Cross-Compile Setup (libpng and freetype)
Building native libraries for Android can be a bit confusing. My goal, which is likely shared by many, was to get libpng and freetyp2 working
Complexity of simple data types
Sometimes the simplest of things have complex answers. In programming we like to think of simple data types, but in reality there aren’t any. While