Re: newbie question: type checking

Matthias Blume <>
8 Nov 2001 23:19:38 -0500

          From comp.compilers

Related articles
newbie question: type checking (2001-11-08)
Re: newbie question: type checking (Matthias Blume) (2001-11-08)
Re: newbie question: type checking (Christian Bau) (2001-11-08)
| List of all articles for this month |

From: Matthias Blume <>
Newsgroups: comp.compilers
Date: 8 Nov 2001 23:19:38 -0500
Organization: Lucent Technologies, Bell Labs
References: 01-11-046
Keywords: types
Posted-Date: 08 Nov 2001 23:19:38 EST

guilaume bour wrote:

[ ... greetings snipped ... ]

  > My idea is to made a language with no type declaration, and where a
  > variable
  > could take different types during its "life".
  > But I want also to make a compiler with strong type checking
  > (the type of all variables must be known after compilation).
  > here is an exemple:
  > a := 5
  > b := a + 3
  > b := "hello"

[ ... rest snipped to satisfy picky moderator :-) ... ]

You definitely want to look into Hindley-Milner type checking and
languages (and, in particular, their type systems) such as those of
the ML family (i.e., Standard ML, OCaml) or Haskell.

What you are trying to do is superficially different because you want
to "assign" to variables, but if you interpret your "assignments" as
"bindings", then a HM-style type reconstruction algorithm would
probably do the trick.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.