From: hanzspam@... (=?ISO-8859-1?Q?Hannu_Kankaanp=E4=E4?=) Date: 2003-08-23T01:58:11+09:00 Subject: Re: Rite/Ruby2.0 & Ruby vs OCaml mgarriss wrote in message news:<3F3F1FE5.1030600@earthlink.net>... > I love Ruby, but in defence of C++ I have to say the there is nothing > quite like the C++ template feature. Metaprogramming is really > interesting. Doing factorial at no run-time cost (all at compile time), > compile time parser generators, and such. But metaprogramming in C++ is a side-effect of the template system that was originally designed for something else. That's why metaprogramming in C++ is awkward, hard and damn slow for the compiler. So I wonder why you're so attracted to it. You should see Lisp's macro system -- Metaprogramming done correctly. If you're interested, download Paul Graham's On Lisp for free: http://www.paulgraham.com/onlisp.html In Lisp metaprogramming, everything that is available at run-time is also available at compile-time. So you could do a macro that reads some file, generates code from it and does some optimizations with parameters known at compile-time. Meanwhile the C++ template lovers praise snippets that can calculate something trivial like factorials or logarithms in base 2 ;).