Re: A question on Newton's Method




I can't believe you'd advise a noob to use a compiler which is still getting
5 bug reports per day. How can you sleep at night?

beliavsky@xxxxxxx wrote:
> What "computer-specific problems" do you avoid by using OCaml instead
> of Fortran? Do you mean "platform-specific"?

No, I mean problems with your numerical code which have nothing to do with
maths. My main concern here is non-determinism from:

1. Out of bounds
2. Uninitialised variables
3. Aliasing
....

As this is one students seem to have the most problems with. Most compiler
bugs probably also fall into this category. Memory leaks are obviously
another important class of hassle which most numerical programmers
shouldn't have to deal with.

Another concern is the intractability of most problems in Fortran which, in
this case, means the lack of availability of the basic data structures and
algorithms. If he doesn't want to have to deal with modulo arithmetic then
there are arbitrary-precision integers and rationals (Num in OCaml, the
native format in Mathematica, and a major hassle in Fortran). If he wants
to perform set operations on a "set of numbers" then there should be
library functions (Set module in OCaml, Union etc. in Mathematica, and a
major hassle in Fortran).

An interactive programming environment is also particularly important when
starting out. Mathematica has an awesome graphical environment (the
"notebook" front end) and OCaml has it's top-level.

Finally, the ability to visualise your results is hugely beneficial. This is
obviously easiest with Mathematica, followed by OCaml (the built-in
Graphics module, or the lablGL OpenGL bindings) and then Fortran.

--
Dr Jon D Harrop, Flying Frog Consultancy
http://www.ffconsultancy.com
.



Relevant Pages

  • Re: Verbose functional languages?
    ... Sometimes it is unavoidable to use Fortran. ... I used Mathematica a lot, ... We recently bought a Mac Mini and a SlideArch keyboard. ...
    (comp.lang.functional)
  • Re: Set union
    ... I suspect this is coming from some of your attempts to compare your OCaml code to Fortran equivalents; ... OCaml but also asymptotically slower). ... In F77 that meant subscripts instead of machine pointers (not F90 style pointers) inside fixed arrays. ... There is no reason why any explicitly stated algorithm can not be ...
    (comp.lang.fortran)
  • Re: Very poor Lisp performance / about Mathematica
    ... >> You cannot predict what such an OCaml program will do. ... Not using them is considered an abuse of the language. ... I wouldn't apply any of that theory to Mathematica directly. ...
    (comp.lang.lisp)
  • Re: dgemm subroutine in BLAS - I think Ive cracked the difference, please confirm
    ... but not a single I/O operation on them. ... appear simpler for that rare I/O statement, but the fortran ... convention is simpler for those dozens or hundreds of lines of code ... years and Mathematica for about 15 years, ...
    (comp.lang.fortran)
  • Re: K interpreter
    ... Comparing the fastest k implementation to the slowest OCaml implementation, ... I don't believe it is possible to design a set of adverbs that allow all ... in k style (or Mathematica). ... it would take me a lot longer to optimise the Mathematica than it ...
    (comp.lang.functional)