Version française
Home     About     Download     Resources     Contact us    
Browse thread
Teaching ocaml programming
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Kuba Ober <kuba@m...>
Subject: Re: [Caml-list] Teaching ocaml programming
On Friday 10 October 2008, Andrej Bauer wrote:
> Kuba Ober wrote:
> >> The requirements are very simple: 1. easy access to toplevel (with
> >> line-editing) 2. editor which can send stuff to toplevel, points to
> >> errors in source code, and is not Emacs.
> >
> > I've been reading through this thread and it all seems like a
> > 300-liner in Qt/C++ (yes, it's that powerful) (excluding syntax
> > definition for Qt's editor widget, if one doesn't exist somewhere for
> > grabs).
>
> I should have added a 0-th requirement:
>
> 0. easy to install on Windows.
>
> This means that anything which requires more than clicking on setup.exe
> and following some instructions is out of the question (which is why,
> for example, drocaml is out of question).

I don't think I want to get involved in wrapping Ocaml's installation, but
all you'd need is to run two installers: Ocaml's, followed by the IDE's.
Due to the way Ocaml works under Windows, it seems that the only option
you have is to use the bytecode, as compiled code requires either an
implementation of MASM and a linker, or Cygwin (or rather, fixes to mingw
so that it can do what Cygwin does for Ocaml).

> >> > Python has IDLE. Scheme has drscheme. Java has drjava. What does
> >> > Haskell have?
> >
> > If IDLE is an IDE, then I'm Santa Claus ;)
>
> So where exactly did I claim it was an IDE? I just said "easy to use
> interface". Yup, definitely Santa Claus.

;)

OK, I'm off to work on tonight and tomorrow. My minimal goals are:
1. Editor with at least skeleton syntax highligting
2. Output window so that you can see results of your program running
3. Toplevel window so that you can run interactive sessions.

The toplevel initially won't have "readline" support, as I have to
code it from scratch, but since it's all clickable and selectable, it
should be a good first approximation to readline.

I'm still thinking how to organize the windows: should there be tabs and
an SDI-like interface? Here's how I'll do it initially:
1. One window, with a menu and a tabbed area.
2. On startup, there's a tab for toplevel.
3. If you edit a file and choose to run it, the output tab will appear,
showing the output. If there are errors, they will be highlighted
in the source. I have to check how easy it is to capture errors from
Windows version of Ocaml, and whether there should be a separate
Error sub-window under the tabbed area.

I also need to think about how to support the debugger, even though I admit
I have never used Ocaml's debugger. This would be for another weekend, though.
The goal is to have something where you can edit your sources and run them,
with errors being handled "intuitively enough".

The thing will be written in C++, as getting the necessary Ocaml bindings
generated for Qt would take too much time initially. Maybe later I'd port
it to Ocaml, as long as I can get the bindings to work well on Windows.
In the long run I'd need to patch mingw as appropriate so that Ocaml could use
it without subjecting people to Cygwin, and so that the whole thing could
be actually easily built once you install Ocaml, Mingw and Qt's sources.
Mingw toolchain needs relatively few files to run, and is rather trivial to
set up (just copy a bunch of files into a directory, and set up the path).

Cheers, Kuba