Type checking questions

Thorkil Naur naur at post11.tele.dk
Thu Nov 3 18:07:39 GMT 2011

Hi Aaron,

On Wed, Nov 02, 2011 at 02:21:51PM -0700, Aaron Tomb wrote:
> ...
> The key thing to know is that I wrote the checker primarily to inspect
> the types of various expressions in order to do program analysis,
> rather than as a complete checker. You can think of it as calculating
> the answer to "assuming this expression is type correct, what is its
> type?".
> It would definitely be nice for it to be a complete type checker, and
> perhaps to include various types of checking beyond what's mandated by
> the standard. But that's not implemented yet.

Precisely the sort of answer, I was hoping for.

> ...
> As to the question of how to implement checkCompatibleTypes, ...

Suppose I implemented a very rough checkCompatibleTypes t1 t2, one that
said, essentially, t1 == t2. That would then, most likely, cause many,
valid, C programs to fail, if I understand correctly. On the other hand,
my agenda here is more towards using language-c to write a compiler for
a language that looks like C, but could be restricted C, rather than
being able to process all the C programs in the world. If you have any
comments to that idea, I would be most grateful.

> Does that help?

Yes, excellently. I am very grateful that you took the time to answer.

> ...

Finally, a bit of curiosity: I know that language-c is used by c2hs. Are
you aware of other things that language-c is being used for presently?

Many thanks again and best regards

More information about the Language-c mailing list