We need structural subtyping NOW!

I’m a developer working in industry. From many years in the business I can tell you that perhaps 30% of application code is devoted to interpreting, validating input data and outputting it to the next program. Especially now we have middleware messaging and a proliferation of layering.

The average programming language (e.g. Java) has zero ability to automatically classify input data so we are left to churn out code which looks at data and figures out what class it belongs to. Add to this is the long list of programming languages used per system (JavaScript, HTML, XML, XSLT, Java, JSF, SQL) and the large number of class libraries which require interfacing glue code to hand data between them. In a typical J2EE application information passes through tens if not hundreds of forms as it traverses the system from user to database. At each hop it must pass from one encapsulated form to another.

Nominal typing systems are holding us back.

If programming languages could allow us to simply declare the data structures and associate classifications we could eliminate billions of lines of code. Preferrably the same declarations would work in all the different languages. Nirvana would be a VM which has a (read) method which automatically classifies the data input.

Structural Subtyping can help because it allows programs to operate on unfamiliar data without adapters. There are a handful of languages past and present which attempt to use it. Xen/Cowmega, Mozzie, MotionTypes. Apparently LOOM, Modular-3, OCaml, Brew and others can do it also but I have yet to explore these languages. And I am not the only one looking for this.
The challenge is to build this into languages we use every day.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: