Graydon and Patrick recently brought up our disjoint-union types which were
originally structural, and Graydon has recently redone them to be nominal. I
wanted to understand the ramifications better, so I spent a little time last
week digging into the design space of nominal and structural types, and also
had a great conversation with Andreas Rossberg, principal designer of Alice ML
and generally an expert in this area.
I wrote up some sketchy notes on the wiki describing what I learned. Most of it
reassures me that we've made pretty good decisions for Rust, but it did raise a
few questions.
Here are the links:
http://wiki.github.com/graydon/rust/disjoint-union-types
http://wiki.github.com/graydon/rust/object-types
Here's an executive summary:
- nominal disjoint union types was probably a good choice
- if we allow local type declarations, it might be wise to restrict them not to
escape (i.e., not to allow values of the local type to escape)
- structural object types was probably a good choice
- but we're currently missing recursive object types
- we may want to look into self-types as a conservative middle-ground towards
the expressiveness of recursive types without hopefully a bit less complexity
than full-blown equirecursive types
I don't mean these as absolutes, just my current thinking based on my
understanding so far.
Dave
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev