views:

87

answers:

4

Could someone give me a clear distinction between latent and manifest type system?

+3  A: 

See Anton van Straaten's post on Lambda the Ultimate. It describes latent typing in the context of Scheme.

Manifest typing would be used in a statically typed language where the type of a term is declared syntactically or can be inferred at compile time from other such terms.

Doug Currie
+1  A: 

Latent typing: A style of typing that does not require explicit type declarations. It is associated with duck typing, dynamic typing and type inference. You can see these in languages like Python, Lisp, Haskell etc.

Manifest typing: The type of all variables declared are explicitly identified. Languages like C, C++ and Java follow this.

Vijay Mathew
+4  A: 

Sometimes, the same concept gets invented independently in different areas of computer science. This is one of those occasions. What the Scheme community calls latent and manifest typing, the rest of the world calls implicit and explicit typing. The meaning is exactly the same:

In explicit / manifest typing, the programmer has to explicitly write down the types, thus the types become manifest in the source code.

In implicit / latent typing, the programmer does not write down the types. The types are thus implicit or latent.

Please note that the question of implicit vs. explicit typing is completely orthogonal to e.g. dynamic vs. static typing, strong vs. weak typing, sound vs. unsound typing, safe vs. unsafe typing and nominal vs. structural vs. duck typing.

Haskell for example is implicitly, strongly, statically, sound, safe, structurally typed.

Jörg W Mittag
I dont know haskell, could you please illustrate each of those type characteristic in haskell?
kunjaan
A: 

Part of the reason it's hard to answer your question is that this is an active area of research. In particular, there are a whole bunch of people that would like to make it possible to mix typed and untyped languages, and to allow programs where certain parts are typed and certain parts are not.

I claim that there's not yet widespread agreement on what meaning will finally be attached to the term "latent type."

However, the issue of latent and manifest types is not the same issue as that of type inference.

Type inference, in a statically typed language, refers to a system that can deduce types for program terms without programmer assistance, typically using a hindley-milner-style type system and unification. Haskell and OCaml both have type inference.

John Clements