From: Jon Harrop <jon@ffconsultancy.com>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Teaching bottomline, part 3: what should improve.
Date: Wed, 23 May 2007 00:39:29 +0100 [thread overview]
Message-ID: <200705230039.29659.jon@ffconsultancy.com> (raw)
In-Reply-To: <1179871823.6966.78.camel@Blefuscu>
Fascinating. Thanks for reporting the information. If I might be so brash as
to comment on the problems you had that have already been fixed by F#:
On Tuesday 22 May 2007 23:10:23 David Teller wrote:
> * OCamlWinPlus...Camelia IDE...LablGtk, LablGl, Camlimage ...
> ... It seems that Graphics doesn't work with Cygwin, hence with Camelia ...
There are two possibilities here:
You want to use Windows => Use F#, Visual Studio and F# for Visualization and
not OCaml.
You want good free software => Use Linux and not Windows.
> == Error messages ==
>
> * Error messages of the type system are somewhat obscure. The reflex of
> many students is "OCaml wants it to be of type XXX", rather than "there
> is a contradiction in what I wrote". It would be nice if there was a way
> to ask OCaml to display additional information on type errors. Say
> something like, whenever typing of an expression fails, restarting the
> type algorithm but printing out the various unifications as they take
> place.
F# currently has better graphical throwback of inferred type information but
slightly worse messages, IMHO.
> * Documentation of LablTk is non-existent. I'm thinking about taking a
> student to write a more OCaml-ish layer on top of LablTk but I don't
> know if/when this will happen.
You get what you pay for as far as documentation is concerned. OCaml is
largely undocumented (the compiler, several code libraries, the top-level,
camlp4). There is some additional documentation (e.g. my book) but you must
pay for it.
> * A nice *beginner-oriented* tutorial is really missing for students who
> failed to pay attention to the beginning of the lecture. Something more
> applied than _Developing applications with OCaml_ and less technical
> than http://ocaml-tutorial.org . Say, leading a beginner to define a
> Connect 4 game. I'm willing to participate into writing this, but not
> alone. I might launch a thread on this subject on the ML.
I'm very interested in writing an introduction to OCaml and publishing it as a
very cheap book, maybe through O'Reilly.
> * That's not OCaml-specific but there must be some construction better
> suited than "for" or "while" to write loops without having to handcode a
> recursive loops. Right now, I can't think of anything better than a
> "hidden" Y combinator, but there must be something.
I often use a nest function:
let rec nest n f x = if n=0 then x else nest (n-1) f (f x)
F# also provides sequences and comprehensions:
let factorial n = Seq.fold ( * ) 1 {2 .. n}
> * Arrays of arrays (of arrays...) are a bit obscure for students,
> although they're getting better at it.
F# provides multidimensional arrays, arbitrary-size arrays, immutable arrays,
resizeable arrays, allows array subscript syntax to be overloaded and is
faster than OCaml on array code. Arrays are a real weak point of OCaml ATM,
along with div and mod, functors, concurrency and some other things.
> * Some students rely too much on references.
F# doesn't help you there.
> * The usual note-taking/attention deficit/motivation deficit problems.
Or there...
> * Anonymous functions are still beyond most of them.
SML can do them with one fewer letters!
If you want your students to be future proof then you would do well to prepare
them for massively parallel computing on CPUs with hundreds or even thousands
of cores. OCaml it completely ill-equipped for this. In contrast, F# provides
native threads/locks/semaphores/threads/threadpools inherited from .NET as
well as async programming via extra syntax. Concurrency is beautiful in F#
and it works today.
--
Dr Jon D Harrop, Flying Frog Consultancy Ltd.
The F#.NET Journal
http://www.ffconsultancy.com/products/fsharp_journal/?e
next prev parent reply other threads:[~2007-05-22 23:45 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-22 22:10 David Teller
2007-05-22 22:22 ` [Caml-list] " William D. Neumann
2007-05-23 13:07 ` David Teller
2007-05-22 22:26 ` Erik de Castro Lopo
2007-05-22 23:16 ` skaller
2007-05-23 2:46 ` David Thomas
2007-05-23 9:19 ` Vincent Hanquez
2007-05-23 12:49 ` Brian Hurt
2007-05-23 13:36 ` Gerd Stolpmann
2007-05-23 14:06 ` skaller
2007-05-23 14:54 ` Florian Hars
2007-05-23 15:11 ` Brian Hurt
2007-05-23 21:48 ` Vincent Hanquez
2007-05-24 8:04 ` Markus E.L.
2007-05-24 8:32 ` Vincent Hanquez
2007-05-24 9:51 ` skaller
2007-05-24 11:22 ` Vincent Hanquez
2007-05-23 13:55 ` David Teller
2007-05-22 23:19 ` skaller
2007-05-23 10:41 ` Richard Jones
2007-05-23 13:04 ` David Teller
2007-05-24 13:51 ` Richard Jones
2007-05-24 14:00 ` Robert Fischer
2007-05-24 14:00 ` Jon Harrop
2007-05-24 14:20 ` Robert Fischer
2007-05-24 14:34 ` David Teller
2007-05-24 14:21 ` skaller
2007-05-22 23:39 ` Jon Harrop [this message]
2007-05-23 18:54 ` Richard Jones
2007-05-23 19:27 ` Robert C Fischer
2007-05-23 19:34 ` Brian Hurt
2007-05-23 19:54 ` Robert Fischer
2007-05-23 21:46 ` Jon Harrop
2007-05-23 22:14 ` Jacques Garrigue
2007-05-24 1:38 ` Revolution Jon Harrop
2007-05-24 2:40 ` [Caml-list] Revolution skaller
2007-05-24 3:21 ` Chris King
2007-05-24 14:24 ` David Teller
2007-05-24 13:40 ` [Caml-list] Teaching bottomline, part 3: what should improve Brian Hurt
2007-05-23 19:29 ` Jon Harrop
2007-05-23 20:20 ` David Teller
2007-05-24 14:18 ` Jon Harrop
2007-05-24 14:23 ` skaller
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=200705230039.29659.jon@ffconsultancy.com \
--to=jon@ffconsultancy.com \
--cc=caml-list@yquem.inria.fr \
/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