Normalising Recursive Data Types
Recently, I came across an interesting problem with the type system I’m using in Whiley. Specifically, the problem relates to recursive types which are equivalent but not identical. Consider, for...
View ArticleOn Flow-Sensitive Types in Whiley
In the ensuing months since the previous release of Whiley, I have been working away on a major rewrite of the compiler. This is now almost ready, at last! One of the “executive decisions” I made...
View ArticleMore on Flow-Sensitive Typing
The idea behind flow-sensitive typing in Whiley is to give a statically typed language the look-and-feel of a dynamically typed language (as much as possible). The following illustrates: int...
View ArticleA Problem with Structural Subtyping and Recusive Types
One problem causing me a headache is how to implement structural subtyping for recursive types (which I first blogged about here). The following example illustrates the basic idea: define Link as { int...
View ArticleMinimising Recursive Data Types
Following on from my previous post about structural subtyping with recursive types, a related problem is that of minimising recursive types. Consider this (somewhat artificial) example: define...
View ArticleImplementing Structural Types
Introduction Over the last few months, I’ve been working on the type system underpinning Whiley. A key feature is the use of structural typing, rather than nominal typing, and I’ve blogged about this...
View ArticleOn the Duality of Types: the Ideals versus the Reals
I’ve been working hard over the last few weeks on the next release of Whiley, which should be out soon. However, I’ve got myself into a little bit of a pickle over the type system (again). I want the...
View ArticleBits, Bytes and More Ambiguous Syntax
Recently, I added a first-class byte type to Whiley. Unlike Java, this is not interpreted as some kind of signed or unsigned int. That’s because I find that very confusing since a byte is really just...
View ArticleA Semantic Interpretation of Types in Whiley
An interesting and intuitive way of thinking about a type system is using a semantic interpretation. Typically, a set-theoretic model is used where a type T is a subtype of S iff every element in the...
View ArticleSimplification vs Minimisation of Types in Whiley
Recently, I’ve been trying to harden up the implementation of Whiley’s type system. The reason for this is fairly straightforward: bugs in the code often prevent me from compiling correct programs! In...
View ArticleThe Whiley Automata Library (WYAUTL)
As part of the upcoming v0.3.10 release of Whiley, I’ve invested considerable effort reimplementing the type system. This was necessary because, whilst my old implementation generally worked, writing...
View ArticleTermination of Flow Typing in Whiley
Whiley uses flow typing to give it the look-and-feel of a dynamically typed language (see this page for more on flow typing). In short, flow typing means that variables can have different types at...
View ArticleFlow Typing for References in Whiley
The Whiley language splits into a fully functional “core” and an imperative “outer layer”. References and objects do not exist within the functional core. However, they can exist within the...
View ArticleFormalising Flow Typing with Union, Intersection and Negation Types
The Whiley language takes an unusual approaching to static typing called flow typing. This helps to give Whiley the look-and-feel of a dynamically typed language. The key idea behind flow typing is...
View ArticleIso-Recursive versus Equi-Recursive Types
An important component of the Whiley language is the use of recursive data types. Whilst these are similar to the algebraic data types found in languages like Haskell, they are also more powerful...
View ArticleUnderstanding why Union Types are useful
The Whiley programming language uses union types as a way of combining types together. Here’s a simple example to illustrate: null|int indexOf(string str, char c): for i in 0..|str|: if str[i] == c:...
View ArticleFlow Typing with Constrained Types
Flow-sensitive typing (a.k.a. “Flow Typing”) is definitely getting more popular these days. Ceylon, Kotlin, TypeScript, Racket, Whiley all support flow typing in some form. Then, of course, there’s...
View ArticleUnderstanding Effective Unions in Whiley
The concept of effective union types in Whiley exposes some interesting features worth considering. In particular, they result in a separation between the readable and writeable view of a type. But,...
View Article