caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Brian Hurt <bhurt@spnz.org>
To: Jean-Christophe Filliatre <Jean-Christophe.Filliatre@lri.fr>
Cc: Holger Schulz <schulz@mathematik.uni-siegen.de>, <caml-list@inria.fr>
Subject: Re: [Caml-list] Teaching OCaml
Date: Thu, 3 Jun 2004 09:27:52 -0500 (CDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0406030914210.6865-100000@localhost.localdomain> (raw)
In-Reply-To: <16574.54515.560699.848619@gargle.gargle.HOWL>

On Thu, 3 Jun 2004, Jean-Christophe Filliatre wrote:

> 
> > >> Iif you want practical features of OCaml, you could try the classic
> > >> "QuickSort in n lines" where n depends on how efficient you want to
> > >> make it, but you can still achieve O(n log n) in something like 4
> > >> lines.  It takes 10 or so to be efficient, compared to at least 50 in
> > >> C.  Of course, Haskell has even nicer syntax for this, but it looks
> > >> good in O'Caml too.
> 
> I don't  think sorting is  a good example  of ocaml power  w.r.t other
> languages. If you are sorting arrays, an ocaml code and a C code won't
> differ so much and I don't see why the C code would be 10 times longer
> (the C syntax could even make it smaller). If you are sorting lists, I
> agree that ocaml syntax and  pattern matching would make the code much
> concise than the C equivalent.

I don't think any 10-line program shows off the real power of Ocaml.  
That's because Ocaml doesn't turn 100 line C programs into 10 line Ocaml 
programs, Ocaml turns 100,000 line C++ programs into 10,000 line Ocaml 
programs *that work correctly*.  Large programs are different from small 
programs.

An example of this.  100 line programs- in any language- are generally
simple enough I can hold the entire program in my head.  It's easy to spot
bugs in 100 line programs.  So a feature like immutable data structures
doesn't help you in writting 100 line programs.  In fact, it often hinders
you.  But when the two interacting peices of code are thousands, or tens
of thousands, of lines apart, spotting the interaction is a lot harder.  
Now, all of a sudden, immutability is a major advantage.

-- 
"Usenet is like a herd of performing elephants with diarrhea -- massive,
difficult to redirect, awe-inspiring, entertaining, and a source of
mind-boggling amounts of excrement when you least expect it."
                                - Gene Spafford 
Brian

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


       reply	other threads:[~2004-06-03 14:20 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <16574.54515.560699.848619@gargle.gargle.HOWL>
2004-06-03 14:27 ` Brian Hurt [this message]
2014-11-25 16:43 [Caml-list] teaching OCaml Arthur Charguéraud
2014-11-25 17:27 ` Alain Frisch
2014-11-25 17:33   ` Arthur Charguéraud
  -- strict thread matches above, loose matches on Subject: below --
2014-11-25 16:03 robert.muller2
2014-11-25 16:33 ` John Whitington
     [not found]   ` <CAKmYinnv1arGZGQ2s0O7K2u=hr=oieiDXzR8YU_habM4+bUdJA@mail.gmail.com>
     [not found]     ` <5474C87D.4030307@coherentgraphics.co.uk>
2014-11-25 18:21       ` John Whitington
2014-11-26 14:26         ` Drup
2014-11-26 16:34         ` Xavier Leroy
2014-11-25 19:40 ` Daniel Bünzli
2014-11-26 11:37 ` Kenichi Asai
2014-11-26 18:12   ` Yaron Minsky
2014-11-26 22:09   ` Marek Kubica
2014-11-26 12:16 ` Jonathan Kimmitt
2014-12-16 19:17   ` Jon Harrop
2004-05-17 11:28 [Caml-list] Teaching OCaml Simão Melo de Sousa
2004-05-17 17:27 ` Michael Hamburg
2004-05-17 17:40   ` David Brown
2004-05-18  8:52   ` Richard Jones
2004-06-02 17:41     ` Holger Schulz
2004-05-17 21:12 ` Evan Martin
2004-06-02 12:43 ` Holger Schulz
2004-06-02 13:06   ` Nicolas Cannasse

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.44.0406030914210.6865-100000@localhost.localdomain \
    --to=bhurt@spnz.org \
    --cc=Jean-Christophe.Filliatre@lri.fr \
    --cc=caml-list@inria.fr \
    --cc=schulz@mathematik.uni-siegen.de \
    /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).