[plt-scheme] The perfect teaching language--Is this too much to ask for?

From: Shriram Krishnamurthi (sk at cs.brown.edu)
Date: Sat Jun 13 18:00:47 EDT 2009

> 2. Types in the Language

These are not types.  These are simply inspectors on the run-time
tags.  Your own example illustrates the point:

>>>> type(isinstance)
> <type 'builtin_function_or_method'>

The *type* of isinstance would be something like

  isinstance :: value x type -> boolean

[Never mind that type should not be a type.]  In contrast, the
run-time tag is "some kind of applicable object", and that's what
Python gives you.

> OK, the last line is not particularly useful, but every Python value
> knows what it is, these types are real objects in the language, and
> programs can manipulate and ask questions about them.

1. I see no pedagogic value in this.

2. Scheme doesn't like to build in a bunch of crud.  You can choose
whatever representation you want for run-time tags and construct
essentially the same in Scheme using the built-in predicates.  If you
think this is so useful for teaching, write a Teachpack that exports
and standard interface for this.  I leave it as an exercise because
it's not a very hard one.

> I want types to impact students' programming,
> because a huge proportion of the mistakes my students make have to do
> with muddy thinking about types, and I think the programming
> environment should make them be explicit about what they think is
> going on and help them when they're wrong.

If you want this, and you want dynamic enforcement (which you seem
to), use the PLT contract system (not to be confused with "contracts
as comments" a la HtDP), which is about as sophisticated as you will
find in any language.

> 3. Static Typing
> Yea for Python--I can play with types in the language.

No you can't.  You can play with run-time tags, as you can in lots of
other languages.


Posted on the users mailing list.