caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Compiler Intrinsics question
@ 2015-03-18  3:16 Kenneth Adam Miller
  2015-03-18  6:10 ` Gabriel Scherer
  0 siblings, 1 reply; 3+ messages in thread
From: Kenneth Adam Miller @ 2015-03-18  3:16 UTC (permalink / raw)
  To: caml users

[-- Attachment #1: Type: text/plain, Size: 790 bytes --]

So, OCaml uses a lot of immutable data structures by default, and there's a
way in OCaml to express how to replace everything else in a type with the
same edition, with the exception of a single variable being updated.


But does that mean that the compiler is sufficiently capable to conclude
side effects that are more efficient rather than just the nieve
explanation, which is a *copy* of the entire data structure with only the
specified changed variable updated? Can OCaml conclude that it can update
only one variable for efficiency, and know that the rest of the data
structure is safe?

For example, in tail recursion, it's provably equivalent to produce code
that doesn't blow the stack and is faster, and that's exactly what the
compiler does. So are side effects a "conclusion"?

[-- Attachment #2: Type: text/html, Size: 900 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-03-20  8:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-18  3:16 [Caml-list] Compiler Intrinsics question Kenneth Adam Miller
2015-03-18  6:10 ` Gabriel Scherer
2015-03-20  8:38   ` Ben Millwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).