Next: , Up: overview   [Contents][Index]


1.1 Typed language philosophy

In this document we refer to the standard Scheme language defined by the R6RS specifications as the standard language; we refer to the typed Scheme language defined by Vicare as the typed language.

To understand how Vicare represents the types of values, we must remember that every Scheme expression might return multiple values; so we can think of an expression evaluation as follows:

(call-with-values
     (lambda () ?epxr)
  (lambda ?formals ?body))

the return values of ?expr are bound to the ?formals and used in the ?body. For example, in the code:

(call-with-values
     (lambda () (values 1 2 3))
  (lambda (a b c) ?body))

while the expansion of ?body takes place: a typed language would annotate the syntactic bindings a, b and c with the information that the values are fixnums.

The tuple of type annotations associated to the ?formals is called type signature; a type signature represents informations about both the number of values and their type. We need a type signature to represent the types of values returned by an expression. We need a type signature to represent the types of the arguments accepted in a function application.

Given the call-with-values model of thinking to expressions evaluations: the whole purpose of a typed language is to verify, at expand–time, that the type signature of an expression matches the type signature of the arguments of a function.

The standard language already mandates that the operands in a function application must be validated at run–time; this means the type signature of the operands is matched, at run–time, with the type signature of the arguments. The typed language extends this feature to make it possible at expand–time.

Type annotations are not mandatory in the typed language, so some operands are validated and others are not.

To understand the role of Vicare’s typed language extensions, we have to consider that:

Since there is no type inference: the code writer is invited to explicitly add type annotations to the syntaxes that establish syntactic bindings.


Next: , Up: overview   [Contents][Index]