caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Thomas Fischbacher <Thomas.Fischbacher@Physik.Uni-Muenchen.DE>
To: Tato Thetza <thetza@sent.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] OCaml efficiency/optimization?
Date: Fri, 28 Oct 2005 15:03:50 +0200 (CEST)	[thread overview]
Message-ID: <Pine.LNX.4.61.0510281455110.1381@eiger.cip.physik.uni-muenchen.de> (raw)
In-Reply-To: <1130494903.8339.246224558@webmail.messagingengine.com>


On Fri, 28 Oct 2005, Tato Thetza wrote:

> I've been reading over
> http://caml.inria.fr/pub/docs/manual-ocaml/index.html and have learned
> two things:
> -lists are immutable and singly linked, which explains why 1::[2;3] is
> valid while [2,3]::1 is not, and why its efficient.
> -the proper way to ensure tail-recursive optimization
> 
> question: are these and other optimizations documented somewhere
> officially? I find it a little uncomfortable I've been learning OCaml
> without knowning such internal details. Any secrets I should definitely
> know if I were to use this language in production?

These are not really "OCaml internal details or optimizations", but rather 
ideas and techniques which have been around very long, and are relevant 
in virtually any (non-lazy) functional language.

I think you might benefit from reading the one book most often used in 
courses on the subject: Abelson & Sussman's "Structure and Interpretation 
of Computer Programs". The complete text is available online at

http://mitpress.mit.edu/sicp/

-- 
regards,               tf@cip.physik.uni-muenchen.de              (o_
 Thomas Fischbacher -  http://www.cip.physik.uni-muenchen.de/~tf  //\
(lambda (n) ((lambda (p q r) (p p q r)) (lambda (g x y)           V_/_
(if (= x 0) y (g g (- x 1) (* x y)))) n 1))                  (Debian GNU)


      parent reply	other threads:[~2005-10-28 13:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-28 10:21 Tato Thetza
2005-10-28 10:23 ` Tato Thetza
2005-10-28 23:07   ` Ant: [Caml-list] " Martin Chabr
2005-10-31 23:50   ` Ocaml for Experienced Programmers Brian Hurt
2005-11-01  1:32     ` [Caml-list] " Yaron Minsky
2005-11-01  0:29   ` [Caml-list] Re: OCaml efficiency/optimization? Brian Hurt
2005-11-01 23:08     ` Matt Gushee
2005-10-28 12:15 ` [Caml-list] " Jon Harrop
2005-10-28 20:00   ` Jon Harrop
2005-10-28 13:03 ` Thomas Fischbacher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.61.0510281455110.1381@eiger.cip.physik.uni-muenchen.de \
    --to=thomas.fischbacher@physik.uni-muenchen.de \
    --cc=caml-list@yquem.inria.fr \
    --cc=thetza@sent.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).