|newbie question: type checking firstname.lastname@example.org (2001-11-08)|
|Re: newbie question: type checking email@example.com (Matthias Blume) (2001-11-08)|
|Re: newbie question: type checking firstname.lastname@example.org (Christian Bau) (2001-11-08)|
|From:||Matthias Blume <email@example.com>|
|Date:||8 Nov 2001 23:19:38 -0500|
|Organization:||Lucent Technologies, Bell Labs|
|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
> 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.
Return to the
Search the comp.compilers archives again.