Should string be a distinct type or merely an alias for an array of characters? I’m considering the options for Leaf and can’t convince myself that a specialized type is needed. Looking […]
Why a ‘constexpr’ is just a return statement

A question recently asked why a ‘constexpr’ function in C++ may comprise only a return statement. It’s a good question. On quick glance the restriction seems somewhat arbitrary, and indeed quite limiting. […]
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 type? In Leaf I’m about to refactor […]
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 doing it too many times. I need […]
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 on additional conversions. The problem with all […]
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 flow is defined by its conditions and […]
Can the Ideal language allow custom operators?
![[+[a][*[b][c]]]](https://mortoray.files.wordpress.com/2012/07/syntax_tree_a.png?w=72&h=80&crop=1)
While working on Cloverleaf I came upon a problem of parsing custom operators. I would like to say that a language would allow custom infix operators, to be perfectly flexible and adaptable. […]
Cloverleaf: Start with an expression parser
I thought a good way to start Cloverleaf would be to write a simple expression parser. In a language expressions are those collection of symbols which result in a particular value. This […]
Preprocessor Case Study: Message Dispatching
Dispatching is one of those areas where I almost always rely on the preprocessor. I have done this in a variety of languages using a variety of techniques and have found nothing […]
Abstract Machines, Interpreters and Compilers

Abstract machines are the core of what defines a programming language. A wide variety of operating systems and plethora of hardware ensures a bewildering number of things we call computers. When […]
What’s to love about C?
Antiquated, clunky, and unsafe. Though beloved to some, C is a language that many choose to hate. The mass opinion is indeed so negative it’s hard to believe that anybody would program […]
How to choose a programming language?
Each new project, whether a standalone program, or a component for an existing program, faces a choice of programming language. Just using what is most popular, or what has been done before, […]
The Necessity of Exceptions
Exceptions often get a bad rap. They are called ineffective, inefficient, and hard to work with. In a way such accusations aren’t unfair, as most languages have totally screwed up their implementation. […]
Never use the “continue” keyword!
I was looking through some questions on StackOverflow last week when I came across a curious answer. In it there was a link to a coding standard that forbade the use of […]