* [Caml-list] Teaching OCaml
@ 2004-05-17 11:28 Simão Melo de Sousa
2004-05-17 17:27 ` Michael Hamburg
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Simão Melo de Sousa @ 2004-05-17 11:28 UTC (permalink / raw)
To: caml-list, Simão Melo de Sousa
It looks like my previous post never reached the caml-list.
So, accept my apologies if you receive my post twice.
------
Hi!
There is, in the Computer Science department of my university, a
interesting discussion about the programming languages that we should
teach. Because I defend that functional programming (Haskell,
etc... but Ocaml in particular) has to be teach among other
"classical" paradigms, I have to prepare a talk about the relevance of
the functional programming paradigm in general and OCaml in
particular.
I know that this kind of topic have been already discussed and that
there is a lot of available "material". Nevertheless, I'm interested in
any suggestions, links to papers, slides, sites...
I'm particularly interested in two kind of informations:
1) material (list of facts, etc..) that describes the good features of
OCaml (in conceptual terms but also in pratical terms) from the point of
view of both the Academy and the Industry.
2) url of Caml based functional programming courses sites
Thanks a lot!
Simao Melo de Sousa
ps: Use my email for answers, I will reply to the list with a digest of
them.
--
------------------------------------------------------------------------
Simão Melo de Sousa | Professor Auxiliar
* -> ., # -> @ => email Simão -> desousa#di*ubi*pt
Departamento de Informática | http://www.di.ubi.pt/~desousa
Universidade da Beira Interior | Tel: +351 275 319 891
Rua Marquês d'Ávila e Bolama | Fax: +351 275 319 732
6200-001 Covilhã, PORTUGAL.
------------------------------------------------------------------------
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] Teaching OCaml
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-05-17 21:12 ` Evan Martin
2004-06-02 12:43 ` Holger Schulz
2 siblings, 2 replies; 9+ messages in thread
From: Michael Hamburg @ 2004-05-17 17:27 UTC (permalink / raw)
To: caml-list
Hi.
A few thoughts on the subject.
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.
As for conceptual features, O'Caml is, as far as I know, the only
functional language with OO, even if it is somewhat limited OO (due to
type-system constraints). For industrial projects, this enables
programmers to work together more easily (or is intended to, anyway),
while writing much less code than for most imperative languages. For
academics, it has been said that programmers, especially
mathematicians, find functional programming very intuitive.
Just some suggestions,
Mike Hamburg
On May 17, 2004, at 7:28 AM, Simão Melo de Sousa wrote:
>
> It looks like my previous post never reached the caml-list.
> So, accept my apologies if you receive my post twice.
>
> ------
>
> Hi!
>
> There is, in the Computer Science department of my university, a
> interesting discussion about the programming languages that we should
> teach. Because I defend that functional programming (Haskell,
> etc... but Ocaml in particular) has to be teach among other
> "classical" paradigms, I have to prepare a talk about the relevance of
> the functional programming paradigm in general and OCaml in
> particular.
>
> I know that this kind of topic have been already discussed and that
> there is a lot of available "material". Nevertheless, I'm interested in
> any suggestions, links to papers, slides, sites...
>
> I'm particularly interested in two kind of informations:
>
> 1) material (list of facts, etc..) that describes the good features of
> OCaml (in conceptual terms but also in pratical terms) from the point
> of view of both the Academy and the Industry.
> 2) url of Caml based functional programming courses sites
>
> Thanks a lot!
> Simao Melo de Sousa
> ps: Use my email for answers, I will reply to the list with a digest
> of them.
>
>
> --
> -----------------------------------------------------------------------
> -
> Simão Melo de Sousa | Professor Auxiliar
> * -> ., # -> @ => email Simão -> desousa#di*ubi*pt
> Departamento de Informática | http://www.di.ubi.pt/~desousa
> Universidade da Beira Interior | Tel: +351 275 319 891
> Rua Marquês d'Ávila e Bolama | Fax: +351 275 319 732
> 6200-001 Covilhã, PORTUGAL.
> -----------------------------------------------------------------------
> -
>
> -------------------
> 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
>
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] Teaching OCaml
2004-05-17 17:27 ` Michael Hamburg
@ 2004-05-17 17:40 ` David Brown
2004-05-18 8:52 ` Richard Jones
1 sibling, 0 replies; 9+ messages in thread
From: David Brown @ 2004-05-17 17:40 UTC (permalink / raw)
To: Michael Hamburg; +Cc: caml-list
On Mon, May 17, 2004 at 01:27:02PM -0400, Michael Hamburg wrote:
> As for conceptual features, O'Caml is, as far as I know, the only
> functional language with OO, even if it is somewhat limited OO (due to
> type-system constraints).
There is O'Haskell <http://www.cs.chalmers.se/~nordland/ohaskell/>. It
has some restriction on dynamic binding and inheritance, and I'm not
sure how widely it is used. It seems to integrate well with Haskell's
existing class system, which already handles some of the OO aspects
(such as dynamic binding).
Dave Brown
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] Teaching OCaml
2004-05-17 11:28 [Caml-list] Teaching OCaml Simão Melo de Sousa
2004-05-17 17:27 ` Michael Hamburg
@ 2004-05-17 21:12 ` Evan Martin
2004-06-02 12:43 ` Holger Schulz
2 siblings, 0 replies; 9+ messages in thread
From: Evan Martin @ 2004-05-17 21:12 UTC (permalink / raw)
To: Simão Melo de Sousa; +Cc: caml-list
On Mon, May 17, 2004 at 12:28:54PM +0100, Simão Melo de Sousa wrote:
> There is, in the Computer Science department of my university, a
> interesting discussion about the programming languages that we should
> teach. Because I defend that functional programming (Haskell,
> etc... but Ocaml in particular) has to be teach among other
> "classical" paradigms, I have to prepare a talk about the relevance of
> the functional programming paradigm in general and OCaml in
> particular.
By "OCaml in particular", do you mean the ML family of languages?
I'm currently a teacher's assistant in an introductory programming
languages class at the University of Washington (USA, in Seattle), in
which we've spent about half of the class using New Jersey SML:
Visit http://www.cs.washington.edu/341 for the course webpage, though it
doesn't discuss the motivations for choosing SML. (The current
professor has indicated he wants to switch to OCaml but we're sticking
with SML for this quarter because that's what's been used in the past
and he's new here.)
(You weren't especially clear about the level of your class, so the rest
of this mail discusses teaching at the introductory level.)
Which programming language to teach as a "first Computer Science course"
is always under debate at this school; there's always tension between
teaching a language that is useful in the industry and teaching a
language that provides a good foundation for the concepts.
As for a class dedidicated to programming languages, I would say that
functional programming is of course important (there's a whole side of
history that includes LISP that feels like it's been more or less
forgotten by both the industry and the curriculum of school). On top of
that, a language that forces you to be both careful and (sometimes)
explicit about types is a very valuable teaching tool.
Of course, Haskell fits that description as well as ML does.
To respond to some other threads: it seems doubtful to me that OCaml's
object oriented support would be useful for an introductory class. I
think students who've only seen languages like Java have enough trouble
grasping currying. :)
--
Evan Martin
martine@danga.com
http://neugierig.org
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] Teaching OCaml
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
1 sibling, 1 reply; 9+ messages in thread
From: Richard Jones @ 2004-05-18 8:52 UTC (permalink / raw)
Cc: caml-list
On Mon, May 17, 2004 at 01:27:02PM -0400, Michael Hamburg wrote:
> Hi.
>
> A few thoughts on the subject.
>
> 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.
Sorry, but why is this a "practical" feature of OCaml?
Anyone who uses OCaml to sort things will use List.sort, unless they
have incredibly specialist sorting requirements, in which they
certainly won't be using a 4-line implementation of quicksort.
Frankly I don't care how List.sort is implemented, as long as it's (a)
reasonably fast, and (b) bug free. It may be implemented in C for all
I know/care.
OCaml is a practical language for many good reasons:
(a) Garbage collection, type safety and other features which mean that
many bugs appear at compile time, not when your program has been deployed
at a customer site.
(b) Ability to construct and pattern-match against data structures
almost effortlessly. Data-driven analysis programs like the sort of
stuff I write for work are a joy to code with these features.
(c) Speed - it's fast enough, and can be very fast when you need it to
be. I can chew through datasets of hundreds of thousands of rows from
an Apache logfile in much less than a second.
Rich.
--
Richard Jones. http://www.annexia.org/ http://www.j-london.com/
Merjis Ltd. http://www.merjis.com/ - improving website return on investment
MONOLITH is an advanced framework for writing web applications in C, easier
than using Perl & Java, much faster and smaller, reusable widget-based arch,
database-backed, discussion, chat, calendaring:
http://www.annexia.org/freeware/monolith/
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] Teaching OCaml
2004-05-17 11:28 [Caml-list] Teaching OCaml Simão Melo de Sousa
2004-05-17 17:27 ` Michael Hamburg
2004-05-17 21:12 ` Evan Martin
@ 2004-06-02 12:43 ` Holger Schulz
2004-06-02 13:06 ` Nicolas Cannasse
2 siblings, 1 reply; 9+ messages in thread
From: Holger Schulz @ 2004-06-02 12:43 UTC (permalink / raw)
To: caml-list, Simão Melo de Sousa
Am 17.05.2004 um 13:28 schrieb Simão Melo de Sousa:
> Because I defend that functional programming (Haskell,
> etc... but Ocaml in particular) has to be teach among other
> "classical" paradigms, I have to prepare a talk about the relevance of
> the functional programming paradigm in general and OCaml in
> particular.
Well perhaps some of the following are useful for you.
1. Functional languages usually come with an interpreter running a
read-evaluate-print loop. That makes it easy to try examples very
directly, i.e. without compiling, linking and stuff. The interpreter
can easily be used for live presentations of examples.
2. In OCaml you have a (strong) type system. That makes the student
think about the types of the objects they deal with. The type checkers
gives an immediate response, wether they are right or not.
3. In OCaml you have functional, imperative and object orientated
elements. Thus you can learn three paradigms within a unified syntax.
4. The imperative elements of OCaml fit into the type system, i.e. you
have a type for references. That makes you learn the difference between
a name (or identifier) and a reference (or allocated memory). That's
better than talking of "variables" without knowing what could be ment.
Moreover with ":=" or rather "<-" you have a meaningful denotation for
the assignment, you can learn the difference between assigment and
declaration.
4.' The intergration of objects and functional elements show that the
implementation of methods in object orientation need not to be done
(totally) functionally.
5. The behavior of functional languages can easily be described by
semantic models using enviromnents only.
6. Usually students have varying levels of programming experience. Most
experience comes from imperative and object orientated programming
languages. The levels are equalizied a bit when using a programmnig
language, which is not known by almost all students. And you have a
chance to bring them away from corrupted programmnig styles, they
learned elsewhere, on using a new language.
7. Functional programming makes it easy to implement mathematical
definition. That can help unterstanding theoretical aspects.
Some argument are not on teaching OCaml but on teaching OCaml as the
first language. Our students learn Java as their first languages, I
don't think they learn to much on programming principles. And I think
object orientation is hard to understand in the first year.
hs
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] Teaching OCaml
2004-06-02 12:43 ` Holger Schulz
@ 2004-06-02 13:06 ` Nicolas Cannasse
2004-06-02 14:09 ` [Caml-list] Making plugins with ocaml Magnus Jonsson
0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Cannasse @ 2004-06-02 13:06 UTC (permalink / raw)
To: Holger Schulz, caml-list, Simão Melo de Sousa
[...]
> Some argument are not on teaching OCaml but on teaching OCaml as the
> first language. Our students learn Java as their first languages, I
> don't think they learn to much on programming principles. And I think
> object orientation is hard to understand in the first year.
I personally think that OCaml should not be teached as first language. Just
let the students "enjoy" Java and Perl for few years, and when they'll later
eventually discover OCaml, after all that pain, they'll really be able to
enjoy it. That's a kind of programmer's Graal : the quest for it is a
teaching :)
Best Regards,
Nicolas Cannasse
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* [Caml-list] Making plugins with ocaml
2004-06-02 13:06 ` Nicolas Cannasse
@ 2004-06-02 14:09 ` Magnus Jonsson
0 siblings, 0 replies; 9+ messages in thread
From: Magnus Jonsson @ 2004-06-02 14:09 UTC (permalink / raw)
To: caml-list
Hello,
I would like to program a plugin in ocaml. A plugin to already existing
programs that are written in C. The plugin is in form of a DLL, and the
plugin's interface is described by a set of C structures and exported
functions in the DLL.
There's also one more constraint: the plugin must be self-contained; it
must not require any other DLL (except for system DLLs) to function. It
must be deliverable as -one- .DLL file.
Is this possible?
Thanks,
Magnus Jonsson
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [Caml-list] Teaching OCaml
2004-05-18 8:52 ` Richard Jones
@ 2004-06-02 17:41 ` Holger Schulz
0 siblings, 0 replies; 9+ messages in thread
From: Holger Schulz @ 2004-06-02 17:41 UTC (permalink / raw)
To: caml-list
Am 18.05.2004 um 10:52 schrieb Richard Jones:
>> 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.
>
> Sorry, but why is this a "practical" feature of OCaml?
I'm not quite sure if it is a practical feature but it is an important
aspect on teaching programming to have code which is easy to survey.
> Anyone who uses OCaml to sort things will use List.sort, unless they
> have incredibly specialist sorting requirements, in which they
> certainly won't be using a 4-line implementation of quicksort.
Hm, learning algorithms includes implementimg them, even if that has
been done before.
By the way: are the 4 or 10 line source available online anywhere? I'd
like to take a look at.
-------------------
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
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2004-06-02 17:41 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2004-06-02 14:09 ` [Caml-list] Making plugins with ocaml Magnus Jonsson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox