From: Mauricio Fernandez Date: 2007-12-20T08:42:37+09:00 Subject: Re: Best compiled language for extending Ruby On Wed, Dec 19, 2007 at 08:45:04PM +0900, tho_mica_l wrote: > > AFAIK, rocaml could in principle[1] work on > > Win32, at least with the MinGW and cygwin builds of Ruby and OCaml > > May I ask if somebody has succeeded in building rocaml on cygwin? Well, you don't actually build rocaml itself, but rather use it to build Ruby extensions written in OCaml. rocaml does essentially two things: generate the C wrappers and create a Makefile. The logic behind the latter is what needs to be adapted to the platform. I'm not aware of anybody having used rocaml on cygwin. Some changes to rocaml_extconf.rb (think of it as an extension to the common extconf.rb and mkmf.rb) would be required in things like: ocaml_native_lib_path = %w[ /usr/lib/ocaml/**/libasmrun.a /usr/local/lib/ocaml/**/libasmrun.a ].map{|glob| Dir[glob]}.flatten.sort.map{|x| File.dirname(x)}.last As you see, it's just a matter of adjusting paths, compiler flags and so on: fairly easy work that requires access to the platform, however. > > What do you miss when you're doing OCaml instead of Haskell > > Eager vs lazy evaluation makes some difference, I'd suppose. Yes; what I wanted to know is in which direction :). I understand that lazy evaluation is not something you necessarily miss, as it's got some associated costs (as MonkeeSage said, if Haskell has strictness annotations, OCaml has got lazy expressions, so we're concerned with the default evaluation strategy). I've found contradicting opinions about the difficulty of analyzing the behavior of programs under lazy evaluation: some people say only newbies are bitten by that, others reply that even Haskell experts bump into puzzling cases where seemingly minor changes can affect performance greatly, in both directions. Likewise, I was wondering if somebody versed in Haskell will find impure languages painful, or if some side effects here and there will be considered acceptable. -- Mauricio Fernandez - http://eigenclass.org