Re: A question on Newton's Method



beliavsky@xxxxxxx wrote:
> Jon Harrop wrote:
>> Even the compiler is written in an inappropriate language. <sigh>
>
> G95 is written in C, as are most operating systems, compilers, and
> interpreters I know of. What is OCaml written in, and why does it make
> a difference?

The OCaml compilers are written mostly in OCaml. ML compilers and
interpreters are typically written in themselves as much as possible, as
compiler and interpreter writing is a strong point of the ML family of
languages. If g95 had been written in ML it would have taken far less time
to develop, it would be far smaller and more robust and it would be far
faster.

> One of the features Fortran 95 added to F90 was "automatic deallocation
> of allocatable arrays at exit of scoping unit", as mentioned at
> http://www.nsc.liu.se/~boein/f77to90/f95.html . Maybe the book was
> being careful to present code that works with both F90 and F95
> compilers.

What happens if you allocate an array and then return it as the result of a
function?

> I see Fortran mentioned much more than OCaml on this newsgroup.

Absolutely, but that doesn't make it suitable for a new programmer wanting
to study numerical analysis.

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



Relevant Pages

  • Re: who uses algorithms learned in cs studies?
    ... most algorithms have implementations already ... I frequently use the pattern behind language compilers and interpreters ... An example of writing an interpreter was taking documents written about ...
    (comp.lang.java.programmer)
  • Re: who uses algorithms learned in cs studies?
    ... most algorithms have implementations already ... I frequently use the pattern behind language compilers and interpreters ... An example of writing an interpreter was taking documents written about ...
    (comp.lang.java.programmer)
  • Re: who uses algorithms learned in cs studies?
    ... most algorithms have implementations already ... I frequently use the pattern behind language compilers and interpreters ... An example of writing an interpreter was taking documents written about ...
    (comp.lang.java.programmer)
  • Re: parser
    ... Then why were you talking about interpreters interpreting interpreters? ... The native compilers for the languages ... compilers no longer include VMs. ...
    (comp.programming)
  • Re: [OT] header file question
    ... >>Many old BASIC interpreters were quite pure (you made a typo on ... >>And so are most C compilers, ... >>in hardware (or microcode), should the compiler generate tons of inline ... I agree that the floating point case is questionable, ...
    (comp.lang.c)