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

From: Filipe Cabecinhas (filcab at gmail.com)
Date: Fri Dec 11 20:37:48 EST 2009

Hi.

On 12/11/09 15:45, Matthias Felleisen wrote:
>
> On Dec 11, 2009, at 6:08 AM, keydana at gmx.de wrote:
>
>> Instead, I'm tempted to equate it with the notion of "type safety",
>> but I'm not sure if it will work: I understand the problem of C being
>> the independence of the static and runtime type systems, but then how
>> about the PHP/Perl example of 1 + "1"...?
>
> 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?

Or is having a type system different from having types? That is... is a 
"type system", as is usually refered to, a well-defined "thing"? If it 
is, how can one tell the difference between a language "with a type 
system" and a language "without a type system, but with types" (normally 
these would be dynamically typed languages, I suppose...)

Or maybe it's even easier... Is the "typed" in "typed language" only 
refering to the static properties of its programs? That is: Any 
dynamically-typed language is not a... "typed language" (in that sense)? 
(And, therefore, it doesn't have a type system but may have types)

Regards,

   Filipe


Posted on the users mailing list.