From: Jon Harrop Date: 2007-05-27T10:15:06+09:00 Subject: Re: Developing cross-platform web/GUI applications M. Edward (Ed) Borasky wrote: > Well, I wouldn't call Ruby a "functional" programming language in the > same sense as Lisp/Scheme, Haskell and Erlang define themselves as > functional programming languages. Ok. I'm from an OCaml/F# background. May I just ask if anyone can translate the following OCaml one-liner into Ruby: let rec nest ?(n=2) f x = if n=0 then x else nest ~n:(n-1) f (f x) it nests "n" applications of "f" to "x" with "n" defaulting to 2 if it isn't specified, e.g. "nest ~n:3 f x" gives f(f(f(x))). This trivial example encapsulates much of what I love about OCaml and it doesn't translate well into any other language that I know. > Ruby is more an "object-oriented > programming language" in the same sense as Smalltalk and Java define > themselves as object-oriented programming languages. Hmm. I'm not an OO fan but I was under the impression that Ruby has much better support for functions than Python. >> 1. How widely is Ruby used on Linux, Mac OS X and Windows? >> > It depends on what you mean by "widely used." It's installed by default > on Macs, Really? It is bundled by Apple? That's incredible! =8-) >> 2. Are there compilers/interpreters targetting the JVM/.NET that make it >> easy to develop GUI applications? >> > Yes indeed! The JVM is supported by Sun's jRuby, Microsoft just > announced a "Dynamic Language Run-time" that supports Ruby on .NET, and > there are miscellaneous other implementations. I don't have any > experience with the .NET versions, but I highly recommend jRuby. Awesome!!! This is exactly the kind of thing I'm looking for. >> 3. Has anyone done any significant work in this area using Ruby? >> > If by "this area" you mean web applications, you pretty much have to > have been living under a rock if you haven't heard about Ruby on Rails. > ;). Oh yeah, I forgot. :-) I had a look at Ruby on Rails a while ago and, although I can do scientific computing with my eyes closed, web programming is like double Dutch to me. Couldn't make head nor tail of it. I think I'm improving now though. :-) > But general GUI applications are a bit more obscure in Ruby. Most of > the major GUI toolkits have Ruby bindings, but there's no clear "first > choice" among them. Ok, thanks. >> 4. Are scientists and engineers using Ruby? >> > Yes, but it isn't as popular among them as Python is. I'm a > scientist/engineer, and I use Ruby, along with Perl and R. But I've > never taken the time to learn Python. Are there many tools for scientists and engineers written in Ruby? What sort of stuff do you write in Ruby? Thanks very much! -- Dr Jon D Harrop, Flying Frog Consultancy The F#.NET Journal http://www.ffconsultancy.com/products/fsharp_journal/?usenet