Fwd: [Haskell-cafe] Haskell for Physicists

I´m a physicist, so I think they would be attracted by something like
Haskell: high level physics modelling at Fortran speeds
Haskell: mathematics beyond numerical calculus
2009/9/30
I will give a seminar to physicists at USP (Universidade de São Paulo, Brazil) university and they asked me for a good title, something that can attract physicists. Anyone has some suggestions? (Will be a seminar about the use of Haskell to substitute C or Fortran in a lot of tasks, and how it can be used in some problems instead of Matlab, Mathematica, etc.)
Thanks, Edgar _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona
Haskell: mathematics beyond numerical calculus
I'd imagine most physicists know a fair bit of mathematics beyond numerical calculus; what they might not know much about is *computation* beyond numerical calculus. --Max

В сообщении от Среда 30 сентября 2009 23:29:32 Max Rabkin написал:
On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona
wrote: Haskell: mathematics beyond numerical calculus
I'd imagine most physicists know a fair bit of mathematics beyond numerical calculus; what they might not know much about is *computation* beyond numerical calculus.
Could you elaborate this. As physicist I don't quite get it.

I am *not* a physicist, but I imagine many physicists know at least
something of functional analysis, algebra, Lie algebras, etc.
However, when physicists write programs (this is my inference from the
widespread use of Fortran and the computational assignments given to
undergraduate students) they are almost exclusively numerical: very
often evaluating some integrals or integrating a system of
differential equations. Although Haskell can do these things, it's not
a place where Haskell really shines (compared to symbolic
computation).
Since I'm not a physicist, I can't give a good example, but think more
of the things Mathematica is good for, rather than Fortran or Matlab.
My impression is that Haskell's advantage over Mathematica is in its
generality: Mathematica is great if it has a builtin function to do
what you want, but it's not a very pleasant programming language.
HTH,
Max
On Wed, Sep 30, 2009 at 9:39 PM, Khudyakov Alexey
В сообщении от Среда 30 сентября 2009 23:29:32 Max Rabkin написал:
On Wed, Sep 30, 2009 at 9:24 PM, Alberto G. Corona
wrote: Haskell: mathematics beyond numerical calculus
I'd imagine most physicists know a fair bit of mathematics beyond numerical calculus; what they might not know much about is *computation* beyond numerical calculus.
Could you elaborate this. As physicist I don't quite get it.

On Wed, 30 Sep 2009 21:24:11 +0200, you wrote:
I?m a physicist, so I think they would be attracted by something like
Haskell: high level physics modelling at Fortran speeds
Haskell: mathematics beyond numerical calculus
And, easier to make use of multi-core machines than threaded Fortran. I suppose one could have a Haskell parser convert Fortran to monadal code. Then, a parser to convert, hopefully, most of the resulting code to pure code. -- Regards, Casey

В сообщении от 30 сентября 2009 23:42:57 Casey Hawthorne написал:
On Wed, 30 Sep 2009 21:24:11 +0200, you wrote:
I?m a physicist, so I think they would be attracted by something like
Haskell: high level physics modelling at Fortran speeds
Haskell: mathematics beyond numerical calculus
And, easier to make use of multi-core machines than threaded Fortran.
Yes this is good selling point. Fortran (and C++ too) programs heavily rely on global state. And thus are very difficult to parallelize. Frequently only possibility is process-level parallelism. This however has problems too.
I suppose one could have a Haskell parser convert Fortran to monadal code.
Then, a parser to convert, hopefully, most of the resulting code to pure code.
This is interesting but very challenging task. Conversion fortran-> monadic code is trade of one mess for another. Since local state and global state are ubiquitous it's difficult to factor out pure functions. Another problem is that fortran functions are usually BIG. Most likely this will require manual intervention.

Yesterday I was at a talk by Pat Hanrahan on embedded DSLs and GPUs at
the nvidia GPU conference:
http://www.nvidia.com/object/gpu_technology_conference.html
Pat argued that the only way forward to achieve usable computing power
for physics on heterogeneous computers (eg. multicore+GPU) is through
the use of embedded DSLs to allow physicists to express algorithms
without reference to underlying architecture, or even details like
data structures. His main example involved using Scala to generate C
code for scramjet simulation (ie. we're not talking toy simulations
here). He actually mentioned Haskell at one point. I strongly agree
with Pat. Unfortunately I can't find slides, or many details of the
project, online.
It seems to me that Haskell is both an excellent host language for
embedding small languages and is also a particularly good language for
expressing algorithms for code generation. I think this should be the
#1 selling point for Haskell for physicists.
The only point I vaguely disagreed with was that Pat seemed to think
that dynamic types were essential. For the types of problems he was
describing it seemed to me that static types were precisely what you
needed.
--
Dan
On Sat, Oct 3, 2009 at 4:23 AM, Khudyakov Alexey
В сообщении от 30 сентября 2009 23:42:57 Casey Hawthorne написал:
On Wed, 30 Sep 2009 21:24:11 +0200, you wrote:
I?m a physicist, so I think they would be attracted by something like
Haskell: high level physics modelling at Fortran speeds
Haskell: mathematics beyond numerical calculus
And, easier to make use of multi-core machines than threaded Fortran.
Yes this is good selling point. Fortran (and C++ too) programs heavily rely on global state. And thus are very difficult to parallelize. Frequently only possibility is process-level parallelism. This however has problems too.
I suppose one could have a Haskell parser convert Fortran to monadal code.
Then, a parser to convert, hopefully, most of the resulting code to pure code.
This is interesting but very challenging task. Conversion fortran-> monadic code is trade of one mess for another. Since local state and global state are ubiquitous it's difficult to factor out pure functions. Another problem is that fortran functions are usually BIG.
Most likely this will require manual intervention. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

And note we are pushing precisely on the use of DSLs in or on Haskell for *portability* of the domain-scientists code in a number of areas right now: * data parallel algorithms (targetting cpu , gpu) Accelerate: http://hackage.haskell.org/package/accelerate-0.6.0.0 Obsidian http://www.cse.chalmers.se/~joels/writing/dccpaper_obsidian.pdf * control systems code: Atom: http://hackage.haskell.org/package/atom * cryptography Cryptol: http://www.galois.com/technology/communications_security/cryptol * avionics verification: http://www.galois.com/blog/2009/05/15/edsls-for-unmanned-autonomous-verifica... * financial modelling Paradise: http://www.londonhug.net/2008/08/11/video-paradise-a-dsel-for-derivatives-pr... FPF: http://lambda-the-ultimate.org/node/3331 * operating systems: http://www.barrelfish.org/fof_plos09.pdf In all cases we're looking at high level code, the possibility of multiple backends, and constrained semantics enabling extensive optimization and analysis. And -- we're generating code, so there's no benefit to having the language hosted on the JVM or .NET -- Haskell should *own* this space. This may be Haskell's killer app now that DSLs are going mainstream. We have mature technology for good DSLs. Far more resources than Scala. Why isn't Haskell completely dominating this space? I believe it is lack of training and outreach. We need a "Write you a DSL for great good!" -- Don dpiponi:
Yesterday I was at a talk by Pat Hanrahan on embedded DSLs and GPUs at the nvidia GPU conference: http://www.nvidia.com/object/gpu_technology_conference.html
Pat argued that the only way forward to achieve usable computing power for physics on heterogeneous computers (eg. multicore+GPU) is through the use of embedded DSLs to allow physicists to express algorithms without reference to underlying architecture, or even details like data structures.

dons:
And note we are pushing precisely on the use of DSLs in or on Haskell for *portability* of the domain-scientists code in a number of areas right now:
* data parallel algorithms (targetting cpu , gpu) Accelerate: http://hackage.haskell.org/package/accelerate-0.6.0.0 Obsidian http://www.cse.chalmers.se/~joels/writing/dccpaper_obsidian.pdf
Another good example: Cell DSL, for Maple users: A Domain-Specific Language for the Generation of Optimized SIMD-Parallel Assembly Code http://www.cas.mcmaster.ca/~kahl/Publications/TR/Anand-Kahl-2007a_DSL/ "a domain-specific language embedded into Haskell that allows mathematicians to formulate novel high-performance SIMD-parallel algorithms for the evaluation of special functions. " -- Don
participants (6)
-
Alberto G. Corona
-
Casey Hawthorne
-
Dan Piponi
-
Don Stewart
-
Khudyakov Alexey
-
Max Rabkin