Matt's Blog: while { coding }
    Back to Matt's Homepage   |   Hire Matt

Introduction To Wheeler, Part 2: Values & Types

(Note: It may be helpful to read the posts I did on types several months ago.)

Someone recently asked me if Wheeler had types. My answer was “No. Uhhh… and yes.” What a terrible answer! I’ll try to do better in this post.

Wheeler has no explicit type system. You will never declare a value to be of a certain type. You might, however, associate a value with a particular category through an interaction. In that way you’re establishing a relationship that will allow typing *behavior*.

What is a value?

Values are the imaginary, interstitial things floating between categories. When you establish a relationship between categories in Wheeler, you’re creating values.

What is a type?

I won’t attempt to answer this in general. I am not a type theorist. From the perspective of Wheeler we might say that a type is determined by a graph’s “shape” and “flavor”. Shape is the actual form of the graph we create in memory (tree, ring, object, etc.). Flavor is what specific categories are being connected by that graph.

What the hell is the difference?

Context. It’s all context. A value will trigger typing behavior when something matching that shape and flavor is being watched for. At that point it could be considered a type. The rest of the time, a value.

Layering values into types

Have you ever seen an artist paint a landscape? First they’ll paint the background… the sky, the horizon, the land. Then they start to layer on more and more detail. At what point does their work become a painting? Existential arguments aside, you might say that the work is a painting when it meets the criteria of the artist. Criteria will vary from artist to artist. Everyone has their own objectives, aesthetics, etc. In other words, everyone brings their own point of view or context to a situation. This idea is so fundamental in Wheeler that it is a core value of the language:

Context Drives Behavior

To help understand this, let’s look at a Venn diagram. (Venn diagrams are quite handy for discussing concepts in Wheeler.)

Here you see we’ve got just a category, Cars. You could think of that as a type. Let’s pile on some more specifics:

Now we’ve got all cars that are Honda Elements. That’s more specific, but it’s still more like a type than anything.

Ah, but now that we have a VIN, the unique Vehicle Identification Number. That’s so unique as to specify a particular vehicle. That seems more like a concrete value now. Yay.

Next time we’ll look at Transitions which allow computation in Wheeler. Then we’ll exercise our type and value scheme.