Julia Datatypes

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:

  1. Abstracts - hierarchically organized types;
  2. Composites - similar to C structs;
  3. Bits strings - representing integers, floats, strings, etc.;
  4. Tuples - immutable ordered values; and
  5. 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:

Nardelli, et.al.
Julia Subtyping: A Rational Reconstruction
http://janvitek.org/pubs/oopsla18a.pdf

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.