On 12/08/2009, at 10:26 AM, Andrew Grimm wrote:

> Would talking about in what aspects ruby is or isn't a functional  
> language be a good idea?
>
> I'm currently thinking "I ought to learn about functional  
> programming. Can I do this without learning yet another language?"

I'll probably sneak in a bit of advocacy, but not too much. Ruby's  
already taken some of the techniques: blocks are just a bit of  
syntactic sugar for closures that came originally from Lisp and  
Smalltalk, and Lisp is definitely in the DNA of modern functional  
languages. The more advanced techniques like monads and functors could  
also work in Ruby, but without the support of the Hindley-Milner type  
system (which is _not_ like Java, C, C++ etc, and well worth checking  
out), that sort of highly abstracted code is very hard to write. Also,  
in a sense, functional languages are defined by things that they lack:  
you can make certain guarantees about what a piece of code will do  
just from the type system and the fact that it compiles successfully.  
It's very hard to sandbox that in a looser language without writing a  
full-on interpreter for it.

Anyway, as I see it, the main reason to start learning about  
functional languages is the encroachment of multicores: writing  
correct parallel code is _hard_, and the discipline that comes for  
free from a language like Haskell is very useful in automatically  
parallelising programs. My old supervisor, Manuel Chakravarty, is  
currently working on a way to run idiomatic Haskell code on NVIDIA's  
GPUs, for instance.

mark

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
or Rails Oceania" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rails-oceania?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to