C
Chris Barts
snip
I think the final word is that it's impossible in C because of things like
polymorphism and probably ill-advised in C++. The following link seemed to
has it out pretty well.
http://www.osnews.com/comment.php?news_id=8067&offset=15&rows=30
Oh well. MPJ
It is /not/ impossible in C, and anyone who thinks so has a very limited
worldview. As a trivial argument, I would say that most Scheme
interpreters are written in C, and that the lambda calculus is trivially
implementable in Scheme.
A better argument would get into notions of effective computability and
the ability of a languages to express primitive recursion. Suffice it to
say, C can express primitive recursion just fine, and therefore any
algorithm expressable in the lambda calculus can be written in C. That,
and not piddling issues of syntax, is what matters.
As for run-time polymorphism, it is merely somewhat difficult, and is a
problem often solved. A struct containing a union and a pointer to void
would suffice to create a fully dynamic type, albeit by giving up a bit of
type hygiene in the process. In any case, the ability to define
arbitrarily complex compound types (structs and unions) gives a subtle
power to C's type system that can usually be used to get around the
limitations in the base language.