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 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id A9C81BC0A for ; Sun, 7 Jan 2007 21:25:44 +0100 (CET) Received: from linux.ucla.edu (fire2.LINUX.UCLA.EDU [131.179.104.17]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l07KPhS7024315 for ; Sun, 7 Jan 2007 21:25:44 +0100 Received: from dsh by linux.ucla.edu with local (Exim 3.36 #1 (Debian)) id 1H3eaH-0004Kw-00; Sun, 07 Jan 2007 12:25:37 -0800 Date: Sun, 7 Jan 2007 12:25:37 -0800 From: Dan Hipschman To: David Teller Cc: OCaml Subject: Re: [Caml-list] Before teaching OCaml Message-ID: <20070107202537.GA11975@linux.ucla.edu> Reply-To: dsh@linux.ucla.edu References: <1168193722.6133.38.camel@Blefuscu> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <1168193722.6133.38.camel@Blefuscu> User-Agent: Mutt/1.5.9i X-Miltered: at discorde with ID 45A15747.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 0100,:01 emacs:01 ocaml:01 emacs:01 toplevel:01 ledit:01 makefile:01 ocamllex:01 ocamlyacc:01 syntax:01 inference:01 inference:01 alpha-beta:01 no-brainer:98 On Sun, Jan 07, 2007 at 07:15:22PM +0100, David Teller wrote: > * the environment -- under Windows, is there any viable alternative to > Emacs + the MinGW-based port ? OK, I'm pretty much totally new to OCaml, but maybe that's good considering you're going to be teaching to people that are new to it, too. I've never used any of them, but Googling "OCaml IDE" without the quotes brings up something called Camelia, Eclipse (they might be used to that if they used if for Java), and Camelion. Personally, I use Emacs, but if you do that make sure they have Tuareg-mode installed. I've noticed that a lot of people who haven't used Emacs before find using the toplevel from Emacs confusing, and usually just run ocaml as a separate process and copy / paste code into it. If this is the case, ledit is a must. > * the Makefile -- I've found OCamlMakefile [1] but I haven't tried it > yet, hopefully it's simple enough for my students to use without too > many arcane manipulations Using OCamlMakefile is a no-brainer, at least for the smaller projects I've done. > * the task -- for the moment, I have no interesting idea of OCaml-based > projects. Perhaps something like finding the shortest path along > subway/train lines ? I've only done a few projects in OCaml so far. It's very good for writing compilers / interpreters. I find ocamllex and ocamlyacc much friendlier than lex and yacc, and the type system makes building abstract syntax trees a breeze. I've been working on a mini-Prolog interpreter for the past few weeks, and something like that might make a good project (although, my code is on my website, so I wouldn't do that exactly as they could easily copy it). Before that, I implemented a type inference system as a class project. The professor gave us a mini OCaml interpreter that he wrote, but removed the type inference part of it. It took a few weeks to do. Since you mentioned graphics, and OCaml is so good at writing interpreters, a thought that occurred to me was that you could have them develop a small GUI description language and write an interpreter for it that creates the user interface from it. For example, something like the .rc resource files on Windows, or .glade files (but XML is kind of boring, IMO). The next project I am planning to do is to write a chess playing engine, although I haven't even decided if I'm going to use OCaml for that. Still, alpha-beta pruning and stuff like that should be fun to do in OCaml, although chess is a bit complicated. If you came up with something simpler (like checkers), they could have their programs compete with each other (extra credit for the winner?). Anyway, these are just some ideas (which you asked for), that I know can be done since I'm rather new to OCaml myself and have done or thought about them already. If you decide to go with one of them, you can, of course, simplify or complicate to suit what your students can handle. HTH :-)