Browse thread
A dynamic types simulator for teaching OCaml ?
- David Teller
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | David Teller <David.Teller@e...> |
| Subject: | A dynamic types simulator for teaching OCaml ? |
As I've mentioned a few times, this term, I find myself teaching OCaml to second year students. One of the things they have trouble understanding is the role of the type system: in their mind, type errors tend to be "something that OCaml won't let them do" rather than "a likely error detected by OCaml in their design". In turn, I extrapolate that this this is one of the reasons for the success of dynamically-typed (if not fully untyped) languages: programmers don't feel constrained by an error checker they don't understand. After some thought, I believe that one good way of getting students to understand why the type system is good for them would be to let themselves get burnt by type errors a few time. In turn, if this is to be part of teaching OCaml, this would require a dynamically typed "simulator" for the language: an interpreter accepting any syntactically correct expression and executing it until a manifest type error, then displaying a nice, detailed explanation of what that error is all about. In other words, something like a Scheme interpreter with a nice pre-processor/pretty-printer. Does anyone know if such a tool already exists ? Thanks, David