From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 6C8D4BC0A for ; Mon, 8 Jan 2007 10:33:00 +0100 (CET) Received: from postar.fmf.uni-lj.si (vega.fmf.uni-lj.si [193.2.67.45]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l089WxWV009859 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 8 Jan 2007 10:33:00 +0100 Received: from localhost (unknown [192.168.5.1]) by postar.fmf.uni-lj.si (Postfix) with ESMTP id CF938DBADE; Mon, 8 Jan 2007 10:32:58 +0100 (CET) X-Virus-Scanned: amavisd-new at spam.fmf.uni-lj.si Received: from postar.fmf.uni-lj.si ([192.168.5.5]) by localhost (spam.fmf.uni-lj.si [192.168.5.1]) (amavisd-new, port 10024) with ESMTP id VQ4zDbj0UFvW; Mon, 8 Jan 2007 10:43:05 +0100 (CET) Received: from [193.2.67.88] (unknown [193.2.67.88]) by postar.fmf.uni-lj.si (Postfix) with ESMTP id 6DAC9D98AC; Mon, 8 Jan 2007 10:32:56 +0100 (CET) Message-ID: <45A20FE0.6070005@fmf.uni-lj.si> Date: Mon, 08 Jan 2007 10:33:20 +0100 From: Andrej Bauer Reply-To: Andrej.Bauer@andrej.com User-Agent: Icedove 1.5.0.9 (X11/20061220) MIME-Version: 1.0 To: David Teller Cc: OCaml Subject: Re: [Caml-list] Before teaching OCaml References: <1168193722.6133.38.camel@Blefuscu> In-Reply-To: <1168193722.6133.38.camel@Blefuscu> Content-Type: text/plain; charset=ISO-8859-2; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 45A20FCB.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; andrej:01 andrej:01 ocaml:01 ocaml:01 tuareg:01 parsing:01 lexing:01 parsing:01 lexer:01 parser:01 computed:01 reuse:01 datatype:01 parsers:01 syntax:01 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