LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 06-19-2013, 12:02 PM   #1
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166
Blog Entries: 1

Rep: Reputation: 4
Functional Programming and HPC


Hi. I'm pretty-much sold on the whole "functional programming" paradigm, although I still have a lot to learn. Haskell was my first FP language, but recently I've been getting into Scheme as well (after not being quite satisfied with Common Lisp).

Anyway, I also happen to have access to several supercomputers. Unfortunately (and suprisingly) no FP languages are installed on these systems, but I thought perhaps I could pioneer something. But I need to pick an FP languages that is fairly simple, easy to get installed, and makes it fairly easy to work with existing OpenMP and MPI infrastructures. Scheme is fairly simple, stable, easy to install, but I'm not sure about OpenMP/MPI support. Haskell is not particularly simple, stable, or easy to install. Could Scheme work for this? Or should I be looking at another language? (Erlang...?)
 
Old 06-19-2013, 06:58 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I've been meaning to get around to learning OCaml, which was my choice of functional languages to learn back when I was researching which one to learn. As far as I know, there are MPI bindings for it.

A while back I actually started using functional programming in R and with C++ partial specialization without even knowing it, so I decided it was time to get into a functional programming language. Your thread reminded me of that goal, so now I need to actually do it before I forget again!

Kevin Barry
 
Old 06-21-2013, 06:37 PM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I actually changed my mind about OCaml, possibly for a silly reason. The source of this reason is that it includes hyperbolic trig functions (e.g. cosh,) but not their inverses (e.g. acosh.) When trying to figure out why that is, I found that not only does a search of the OCaml mailing list archive fail (to function properly); there is also no "search" feature for the OCaml bug tracker and feature-request system, so I have no idea if I'm the only one who's noticed the omission. The absence of those functions isn't itself a big deal (easy enough to define with logarithms.) It's a strange thing to have forgotten, and I hit nothing but dead ends when trying to figure it out. It's also seemingly impossible to join the beginners' Yahoo group to ask the question. If it's so much work to find an answer to this simple question, I can't imagine trying to get any real work done with the language.

Kevin Barry
 
Old 06-21-2013, 08:09 PM   #4
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166

Original Poster
Blog Entries: 1

Rep: Reputation: 4
Lately I've been wondering how hard it would be to make MPI bindings for scheme - I thought I might give it a try during my personal time. I see that the newer (non-legacy) version of Guile has dynamic FFI. It seems to work fine with simple functions from libm, though I'm not sure how tossing MPI multithreading into the mix will affect things.
 
Old 06-22-2013, 05:39 AM   #5
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
I'm pretty hesitant about using any FFI. I think I'd rather write native bindings and get it right from the beginning, unless I'm absolutely certain I'll never need to use data structures with the API.

Right now I'm reading up on Haskell, and I think I'll go with that. Why do you say it isn't stable? What OS runs your cluster?

Kevin Barry
 
Old 06-22-2013, 12:59 PM   #6
stateless
Member
 
Registered: Jan 2013
Distribution: Debian
Posts: 166

Original Poster
Blog Entries: 1

Rep: Reputation: 4
Quote:
Originally Posted by ta0kira View Post
I'm pretty hesitant about using any FFI. I think I'd rather write native bindings and get it right from the beginning, unless I'm absolutely certain I'll never need to use data structures with the API.
At the moment, I don't have the slightest idea how I would go about that. Could you point me to the right documentation?

Quote:
Right now I'm reading up on Haskell, and I think I'll go with that. Why do you say it isn't stable? What OS runs your cluster?
Thinking in terms of the GHC compiler, there tends be a lot of differences involved between various versions of the compiler, such as base module structure changes and lots of extensions getting added. This is not so much an issue if you write your own code, and you write it intelligently. But if your code depends on other peoples' modules you are going to run into issues. For example, I once wrote a video game in Haskell that compiles fine in 7.4 or 7.6. However, half the modules I was depending on for important functionality would not build correctly under 7.6.

On the other question: I should probably emphasize that it properly cannot be called my cluster, as I have no administrative control over it. However, it is running CLE4.
 
Old 06-22-2013, 08:08 PM   #7
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
Quote:
Originally Posted by stateless View Post
At the moment, I don't have the slightest idea how I would go about that. Could you point me to the right documentation?
It all depends on the language, but the means of writing bindings says a lot about the language. For one, it really helps you understand what the language is actually made of. Usually it's helpful if you can write bindings in C because that means a vast number of libraries are or can be supported in that language. I've really only written bindings/extensions for R and Python, but I usually look into if/how C libraries can be supported in a language I'm thinking about learning.

Kevin Barry
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Redhat HPC - Java extension to communicate with the HPC ktamilvanan Linux - Enterprise 0 03-14-2011 07:51 PM
Functional Programming? MTK358 Programming 22 07-12-2010 02:06 PM
Learning functional programming Robhogg Programming 17 03-27-2009 08:58 AM
functional programming in C++ synss Programming 2 08-03-2007 01:33 AM
Functional Programming - Discussion taylor_venable Programming 6 07-30-2006 10:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration