Julia has a very rich representation and inference system where types are denoted as descriptions of value sets. Values in Julia are always typed but may be dynamic and associated with a type tag or may be static where the type is known and possibly inferred without explicit declaration. Types of objects are available for introspection.
Julia has five kinds of types:
- Abstracts - hierarchically organized types;
- Composites - similar to C structs;
- Bits strings - representing integers, floats, strings, etc.;
- Tuples - immutable ordered values; and
- Unions - a form of abstract types constructed from other types.
Type construction and inference in Julia is extremely powerful because it is combined with the association of multiple methods with functions. However, some of the power of the Julia type system seems to be lost on many programmers new to these ideas.
A very interesting paper addresses some of the seeming mysteries of Julia by describing an alternative implementation of the Julia type system:
Julia Subtyping: A Rational Reconstruction
The Julia type system is a kind of description logic. As such, I have undertaken an attempt to implement it using DL techniques in Prolog. My hope is to learn something along the way and to perhaps create a non-trivial example of the effectiveness of Prolog.
This blog article will be updated as the implementation progresses.