English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Wishes for an easy install of Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-24 (08:58)
From: Philippe_Lelédy <phl@l...>
Subject: Wishes for an easy install of Ocaml
I introduce me a little:

I am a French teacher who give to my students their first  course in 
Computer Science, which include learning Caml (as the first language).

I give them strong advice to install an  Unix-like OS on their own 
computer, with some success (Linux, MacOS X).
But because they have absolutly no Unix experience,  I'd like to say 
them  that  installing  Ocaml is  as  simple as

apt-get install ocaml (for instance)

but it is not. Another step is mandatory

apt-get install tuareg

but it is not enough, adding some obscure lines to .emacs is necessary 
b/c the old Caml mode is effective by default but Tuareg is not. Time 
spent to explain that is very counter-productive to Unix new-bies. 
Debian tuareg-mode does half the job by adding tuareg-mode directory to 
emacs load-path, but manual addition of (load "append-tuareg") is still 

I've discovered another issue: if your emacs defaults to utf-8 encoding 
you need some extra lines in your .emacs, that I had to struggle a long 
time to find out:

(modify-coding-system-alist 'file "\\.ml\\'" 'iso-latin-9)
(modify-coding-system-alist 'file "\\.mli\\'" 'iso-latin-9)

(modify-coding-system-alist 'process "ocaml" 'iso-latin-9)

That's a bare minimum to have Ocaml working on a student own computer.

Other steps are usefull for a more comfortable  experience, for instance 
(on Debian):

 ;; custom-set-variables was added by Custom -- don't edit or cut/paste it!
 ;; Your init file should contain only one such instance.
 '(tuareg-library-path "/usr/lib/ocaml/3.08")

That last line is not release independant.

And here is what I add to .emacs for an easy access to  Ocaml  manual:
  (setq tuareg-manual-url 
  (setq tuareg-browser 'phl-browser-new-tab)
  (setq tuareg-library-path "/usr/lib/ocaml/3.08/")

Here is my browser function:

(defun phl-browser-new-tab (url)
     "firefox" nil
      (concat "firefox -remote 'openURL (" url  ", new-tab)' || firefox 
" url)
it opens a new tab if firefox has yet been started, and starts a new 
firefox if not.

Also more lines in .emacs are necessary to make Emacs behave more like a 
non Unix geek would expect.

And mozcaml Sidebar for Firefox can be said a must have.

You can't expect a new bie to do all that.

My  provisionnal answer is  making a Linux live CD for my students with 
all that; much work, only x86 and not a way to  really install the OS.

Better ideas ? Making a ocaml-goodies-for-newbies package which  would 
include all this customizations ?

Ph. L.