On Memory Management and Rust
Rust is definitely one of the more interesting new programming language I’ve come across recently. Memory management is definitely Rust’s “thing”, and the language wants to have its cake and eat it (so...
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 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 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 ArticleGroovy 2.0 uses Flow Typing!
Groovy 2.0 has just been released, and it contains something rather interesting … optional flow typing! For those who don’t know much about the language, Groovy is a JVM-based dynamically typed...
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 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 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 ArticleA Subtyping Gotcha
An interesting issue with the following piece of code has recently come to my attention: define Queue as process { [int] items } int Queue::get(): item = this.items[0] this.items = this.items[1..]...
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 ArticleThe State of Whiley
The aim of this post is simply to list the main outstanding issues with the design and implementation of Whiley. This is primarily for my own purposes, in order to help me focus my efforts and to...
View ArticleImplicit Coercions in Whiley
The issue of [[Type conversion|implicit coercions]] in Whiley is proving to be a particularly thorny issue. The following motivates why (I think) coercions make sense: real f(int x, real y): return x...
View ArticleRegular Tree Automata
In my quest to understand the theory of recursive types in more detail, the notion of regular tree languages and [[Tree automaton|Tree Automata]] has cropped up. These have been used, amongst other...
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 ArticleDesign by Contract is Most Requested Feature?
Thanks to Alex Potanin for pointing this out to me … it seems that [[Design by Contract]] is the most requested enhancement to the Java language. You can find the list of the top 25 RFEs here. A nice...
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 type system|structural typing]], rather than [[nominal...
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 ArticleA Problem with Structural Subtyping and Recusive Types
One problem causing me a headache is how to implement [[Structural type system|structural subtyping]] for [[recursive data type|recursive types]] (which I first blogged about here). The following...
View ArticleThe Case Against Structural Subtyping … ?
My previous post on structural subtyping generated quite a few comments over on reddit. There were a lot of mixed opinions as to the pros and cons of having a [[structural type system]] instead of a...
View ArticleOne Approach to Efficient Structural Subtyping
An interesting challenge with [[Structural type system|structural subtyping]] is that of efficient implementation. In particular, without care, it may be impossible to determine a static offset for...
View Article