Not logged in
Log in now
Create an account
Subscribe to LWN
LWN.net Weekly Edition for May 23, 2013
An "enum" for Python 3
An unexpected perf feature
LWN.net Weekly Edition for May 16, 2013
A look at the PyPy 2.0 release
C++ has them beat: it's type system is not just trigger halting problem, it's turing-complete!
Halting problem ? Ha!
Posted Feb 12, 2008 21:00 UTC (Tue) by nix (subscriber, #2304)
C++'s template expander is modelled on ML's pattern matching. Cayenne and
Qi are both perhaps two generations beyond that (both type systems being
more powerful than Haskell's) in different directions: personally I prefer
Qi's, but part of that is probably because it's possible to bootstrap the
Qi implementation without being an ultra-guru).
Of course, C++ compilers often *appear* to not halt when compiling
Posted Feb 14, 2008 22:01 UTC (Thu) by lysse (guest, #3190)
I don't know if you're joking about C++, but one of the notable things about Qi is that its
type system *is* Turing-complete, by intent and proof (someone implemented SK combinators in
Posted Feb 15, 2008 0:06 UTC (Fri) by ms (subscriber, #41272)
No, nix wasn't joking. If you use C++ templates and limit yourself to numbers then it really
is turing complete. Haskell, with the right flags (undecidable instances and overlapping
instances) is also Turing complete. Cayenne is deliberately so and many people are now really
thinking that it's just better to permit Turing completeness and let the programmer take
The alternative is more like what Epigram is looking at (amongst others) where you limit
recursion to on the structure of terms and prevent infinite structures. That way, you can
still guarantee termination. I fear we may now be some way from the original issue though ;)
Posted Feb 15, 2008 21:48 UTC (Fri) by nix (subscriber, #2304)
I used the wrong terms, really. What Haskell, Cayenne and Qi provide over
C++ is (radically) greater *expressiveness*. The syntax of Qi type
definitions is especially strange, but it's a hell of a lot saner than
trying to define anything complicated using C++ templates.
Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds