Re: "ocaml_beginners":: big data as argumnts -> is this a performance lack?
- On Wednesday 01 June 2005 01:04, Oliver Bandel wrote:
> So even if it looks "slow", when "thinking in C", because there are noExactly. This confused me when I first came to OCaml from C++ because I was
> pointers... ...that does not mean that it is slow...
used to having to work out which structs to pass by value and which to pass
The key concept here is called "referential transparency". Essentially,
immutable data doesn't need to be copied - it can just be referred back to.
So OCaml takes the approach of doing everything by referencing (pointers)
data rather than copying it. This allows ocamlopt to compile functional
programs into efficient machine code.
So this is just one less thing to worry about when converting from C/C++ to
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
Objective CAML for Scientists