LWN.net Logo

Learning to program

Learning to program

Posted Apr 23, 2012 16:39 UTC (Mon) by dps (subscriber, #5725)
In reply to: Learning to program by tialaramex
Parent article: GCC and static analysis

When I did my 1st degree in (Mathematics and) CS we used a functional programming language before an imperative one. One of the exercises was to write an interactive program which appeared to have state. Obviously actually having state was impossible because that would violate fundamental principles of functional programming.

I think that functional programming languages are mathematically beautiful inferior to imperative languages for most tasks. Attempting to use an imperative programming language as functional one, or vica-vesra, is both stupid and painful.

Serious numerical analysis is *never* done using functional programming languages: any language without BLAS and linpack can be ruled out immediately. The popular choices include high performance fortran, which does not support recursion.


(Log in to post comments)

Learning to program

Posted Apr 23, 2012 18:08 UTC (Mon) by Cyberax (✭ supporter ✭, #52523) [Link]

>Obviously actually having state was impossible because that would violate fundamental principles of functional programming.

It's certainly possible. You just pass the state of the 'world' as a parameter to functions that can affect it.

>Serious numerical analysis is *never* done using functional programming languages: any language without BLAS and linpack can be ruled out immediately. The popular choices include high performance fortran, which does not support recursion.

Wow! So much bogosity in two statements.
1) Functional programs certainly can be fast. And serious numeric analysis is now often done with NumPy which is _interpreted_.
2) Fortran supports recursion since 1990 (actually since much earlier mostly in form of vendor-specific extensions).

Learning to program

Posted Apr 26, 2012 3:16 UTC (Thu) by samlh (subscriber, #56788) [Link]

> And serious numeric analysis is now often done with NumPy which is _interpreted_.

Much of NumPy is a thin wrapper around BLAS, linpack, etc. What makes it popular is that it provides an intuitive interface, but the number-crunching is rarely written in Python.

Learning to program

Posted Apr 26, 2012 12:58 UTC (Thu) by nix (subscriber, #2304) [Link]

Serious numerical analysis is *never* done using functional programming languages: any language without BLAS and linpack can be ruled out immediately. The popular choices include high performance fortran, which does not support recursion.
I don't do numerical analysis, nor do I know anyone who does, so I cannot argue regarding the truth of your assertion. But as a simple Google search will show, Haskell has bindings to BLAS.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds