[plt-scheme] Re: plt-scheme type of language

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Fri Dec 11 20:50:16 EST 2009

On Dec 11, 2009, at 8:37 PM, Filipe Cabecinhas wrote:

>> 
>> PHP/Perl are prefect examples of safe languages without a type system.
>> Safety depends on two things:
>> -- the input domains of computational primitives (function or method
>> application, the addition function) are well-defined sets
>> -- the memory is managed in a way that doesn't allow arbitrary bit
>> pattern to be interpreted in conflict with the well-defined sets
>> In their case, + is defined as
>> 
>> case->
>> Number x Number -> Number
>> Number x String -> String (I vaguely recall from my Ruby effort)
>> 
>> and that's a fine domain restriction. Presumably true + 'c' fails.
>> 
> 
> But... If you have a language "without a type system", where do you get those "Number" and "String" types?


That's trivial. These type correspond to the built-in predicates of Scheme: 

 number? <---> Number 
 string? <---> String 
 ... 

See vast literature. Dana Scott started working out just this idea in 1968 and published it a seminal paper. The idea is dubbed universal domain. Once people started understanding the idea of a type as a syntactic barrier of abstraction (Reynolds, mid 70s), they turned the idea of a universal domain into the idea of a universal type for languages such as Scheme (1980s), and in the 1990s, this was dubbed "uni-typed" because it also reflects the idea that such languages have a single type. The pieces of the type are dubbed "variants" and are NOT considered types. Again, this is an idea that dates back to the design of algebraic data types in the earl 1970s. -- A separate idea of uni-typing is the question whether dynamically you need injections from Number into TST or whether there really is some proper subset relation. That's separate from unitype but has also been exploited for so-called "soft typing" efforts for Scheme-like languages (Henglein, mid 1990s). 

You see, very little o basic type knowledge is from the 00s or even the 90s. Sadly, when 'we' talk to people who don't know the area but pretend to know, we need to start from way back then. 

-- Matthias



Posted on the users mailing list.