Re: [stack] Cat Type Inference

"Christopher Diggins" <[email protected]>
Newsgroups gmane.comp.lang.concatenative
Message-ID <[email protected]>
On 4/16/07, William Tanksley, Jr <[email protected]> wrote:
>
> Christopher Diggins <[email protected]> wrote:
> > The question that remains then is "why allow the compiler (or better yet,
> > the editor) infer the types instead of insisting the programmer write them
> > out?".
>
> Your answer was better than mine, but I did have one little tidbit I
> think it worthy: a program that must be type-inferenced must be
> written in a predictable manner: the compiler has to be able to figure
> it out easily. This makes it generally easier to analyze even for
> humans.

When you say "predictable" I am assuming you are referring programs
with straightforward or simple types, and not to the set of well-typed
programs in general.

Well I agree it would be ideal for programs to be written in a
predictable manner, I don't believe it to be a theoretical
prerequisite. I know that other type inferring compilers (e.g.
Haskell) are quite limited with regards to what they can infer but it
is mostly a combination of intention (i.e. the designers wanted a
stricter type systems than I see as being practical) and
implementation approach.

It'll remain to be seen how sophisticated the Cat inference engine
turns out to be in practice once the current version is completed. I
am confident however (based on the performance of the earlier
prototype) that Cat will be able to handle inferring the type of
complex edge-case programs with ease. This is due mainly because of
the simplicity of the type system of Cat compared to other languages.

Cheers,
Christopher
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.