Re: newbie question: type checking

Matthias Blume <blume@research.bell-labs.com>
8 Nov 2001 23:19:38 -0500

          From comp.compilers

Related articles
newbie question: type checking gbour@nomade.fr (2001-11-08)
Re: newbie question: type checking blume@research.bell-labs.com (Matthias Blume) (2001-11-08)
Re: newbie question: type checking christian.bau@cbau.freeserve.co.uk (Christian Bau) (2001-11-08)
| List of all articles for this month |
From: Matthias Blume <blume@research.bell-labs.com>
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.


--
-Matthias


Post a followup to this message

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