LWN.net Logo

LLVM 3.0 released

LLVM 3.0 released

Posted Dec 13, 2011 21:27 UTC (Tue) by mathstuf (subscriber, #69389)
In reply to: LLVM 3.0 released by nybble41
Parent article: LLVM 3.0 released

> only C++ has a built-in Turing-complete metaprogramming interface at compile time in the form of templates

Haskell has Template Haskell[1][2] (it's an extension, but since GHC is pretty much the only compiler for Haskell, that's pretty much moot).

[1]https://en.wikipedia.org/wiki/Template_Haskell
[2]http://www.haskell.org/haskellwiki/Template_Haskell


(Log in to post comments)

LLVM 3.0 released

Posted Dec 13, 2011 21:49 UTC (Tue) by nybble41 (subscriber, #55106) [Link]

Sorry, I didn't mean "only C++" in that sense. I was only considering C and C++. Other languages do have decent metaprogramming facilities as well, some (IMHO) much better than C++ templates. Lisp macros, for example, or Scheme's syntax expanders. D's more flexible template system ranks highly as well, though the syntax isn't quite as consistent and it relies on parsing generated strings, rather than constructing syntax objects directly.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds