From: Andrej Bauer <Andrej.Bauer@fmf.uni-lj.si>
To: David Teller <David.Teller@univ-orleans.fr>
Cc: OCaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Before teaching OCaml
Date: Mon, 08 Jan 2007 10:33:20 +0100 [thread overview]
Message-ID: <45A20FE0.6070005@fmf.uni-lj.si> (raw)
In-Reply-To: <1168193722.6133.38.camel@Blefuscu>
I teach theory of programming languages with ocaml on Windows. The path
of least resistance seems to be ocaml + XEmacs + tuareg + premade make
files (although omake sounds like a good option). It takes one lecture
(45 minutes) to explain the setup, and the first homework is "install
everything and compile helloWorld.ml".
If you're teaching math students who think that "java is not
mathematical" enough, then you could offer mathematical projects,
possibly involving graphics, such as:
1) A program that plots the graph of a function. This would involve
parsing the function, so you'd have to teach basic lexing and parsing
techniques. Or you can provide the lexer and parser and have them extend
it with more functions.
For extra credit: a program that plots surfaces in 3D.
2) A program for drawing graphs in the plane. The layout of a graph is
computed with one of many algorithms, e.g. a spring embedder. You can
reuse the graph data structure to develop other things (shortest path
etc.) You can have a graph drawing competition. You can have them draw
graphs with 10000 vertices.
I once "won over" several math students from the Dark Side++ by showing
them how to define the datatype of finite graphs and implement basic
constructions, including computing Cayley's graph and finding the
chromatic numbers (by a brute force method). They were convinced because
the source code was "mathematically clean" and something like 5 times
shorter than corresponding C++ would be.
3) This is shameless self-propaganda, but several people used random art
as a fun project, see e.g. Assignment 2 at
http://www.cs.hmc.edu/courses/2005/fall/cs131/homework/index.html
(and compare with the "real thing" at http://www.random-art.org). In
this project you can avoid writing parsers, while still having abstract
syntax and an interpreter, or even a compiler/optimizer.
4) If your students are very mathematical, something like the tiling
examples from "Developing applications in Ocaml" might interest them.
Best regards,
Andrej
prev parent reply other threads:[~2007-01-08 9:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-07 18:15 David Teller
2007-01-07 20:25 ` [Caml-list] " Dan Hipschman
2007-01-07 21:07 ` Sylvain Le Gall
2007-01-07 21:13 ` [Caml-list] " Aleksey Nogin
2007-01-07 21:20 ` Richard Jones
2007-01-07 22:37 ` skaller
2007-01-08 18:26 ` robert
2007-01-08 18:49 ` Jacques Carette
2007-01-08 19:31 ` robert
2007-01-07 23:17 ` Jacques GARRIGUE
2007-01-08 6:56 ` Oliver Bandel
2007-01-08 2:47 ` Jon Harrop
2007-01-08 6:45 ` Oliver Bandel
2007-01-08 9:33 ` Andrej Bauer [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=45A20FE0.6070005@fmf.uni-lj.si \
--to=andrej.bauer@fmf.uni-lj.si \
--cc=Andrej.Bauer@andrej.com \
--cc=David.Teller@univ-orleans.fr \
--cc=caml-list@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