From: MikkelFJ Date: 2002-12-18T06:47:07+09:00 Subject: Re: Functional Language Recommendation "Wai-Sun Chia" wrote in message news:3DFF3E53.1030305@hp.com... > Sorry for the OT post, but I need some advise from some like-minded > folks who appreciate the finer gems in life ;-) > > I'm planning to study a functional language in the comming year (new > year's resolution, as I have zero experience/knowledge on functional > languages) and have narrowed it down to either Ocaml and Haskell. It'd > be great if any of you could share your experiences with either one or > both of them. If you are interested in the language as such, there are many choices. If you are interested in practical applications with multiple OS support, it narrows down a bit. LISP and variants are dynamically typed eagerly evaluated languages - not very portably between Windows / Unix, at least not without paying big bucks. Clean, Haskell are lazily evaluated statically typed functional languages. Clean works very well on Windows. Haskell works well on several platforms and has shown good ability to interoperate, for instance with COM on windows. However, if for no other reason, I can't live with a slow huge Perl startup script as in the GHC compiler - it is officially tagged as research project. The ML family are eagerly evaluated statically typed functional languages. They deduce type info so they are easy to type like LISP and Ruby even with the type information. Personally I have chosen OCaml because I need a language that is cross platform and useful in real life. Few languages come close to this language in implementation quality. Clean is also interesting, but is effectively Windows only. I also considered eager versus lazy evaluation. I found the in real life you mostly don't need that pretty fancy things you can do with lazy evaluation - and when you do need it, it is available in OCaml via lazy streams. Lazy evaluation makes it difficult to predict runtime efficiency and often especially newcomers have difficulties figuring out why a two-line program takes 15 minutes to execute and consume all memory. One of the most useful features of lazy evalutions are combinator parsers - but they are very difficult to get to perform efficiently, although the can work magic. Lisp and variants (such as Dylan) are interesting, but you don't get any cheap compiler (or, I guess, expensive for that matter) with same qualities as the OCaml compiler. I would give Dylan a second look though - it may be the definitive Ruby / Functional bridging language, dynamic and static language as you desire. In conclusion, there are really many good choices with good implementations around - but if you seek a power language to replace C++, I'd say the choice would be OCaml. With OCaml you can build a 200K standalone executable or a much smaller cross platform bytecode program that requires a reasonably sized runtime dll. You can link with .lib, .c and .obj files as you like. Mikkel