One Emacs SML Workflow

Being partial to the full-REPL-reboot style of development (ala DrRacket) for most situations I wanted the same thing in Emacs with sml-mode. The value add is that you know all of your files are saved and that your environment is in a fresh and known state. I came up with this:

(defun gcr/sml-eval-buffer ()
  "Intelligently evaluate a SML buffer."
  (interactive)
  (gcr/save-all-file-buffers)
  (let ((sml-process (get-process "sml")))
    (when sml-process
      (quit-process sml-process)))
  (sleep-for 0.25)
  (let ((sml-buffer (get-buffer "*sml*")))
    (when sml-buffer
      (kill-buffer sml-buffer)))
  (sml-prog-proc-load-file buffer-file-name t))

Only to be delighted (though not surprised) to find yet another nearly identical approach here by wenjun.yan:

(defun isml ()
  "If sml repl exists, then restart it else create a new repl"
  (interactive)
  (when (get-buffer "*sml*")
    (with-current-buffer "*sml*"
      (when (process-live-p "sml")
        (comint-send-eof)))
    (sleep-for 0.2))
  (sml-run "sml" ""))

My urge to attain Emacs Comint mastery only grows.

GODI – The source code Objective Caml distribution

Via its homepage:

GODI provides an advanced programming environment for the Objective Caml (O’Caml) language.
From INRIA (who created O’Caml) you can get the O’Caml compiler and runtime system, but this is usually not enough to develop applications. You also need libraries, and there are many developers all over the world providing them; you can go and pick them up. But it is a lot of work to build and install them.
GODI is a system that simplifies this task: It is a framework that automatically builds the O’Caml core system, and additionally installs a growing number of pre-packaged libraries. For a number of reasons GODI is a source-code based system, and there are no precompiled libraries, but it makes it very simple for everybody to compile them.
GODI is available for O’Caml-3.10 and 3.11. It runs on Linux, Solaris, FreeBSD, NetBSD, Windows (Cygwin and MinGW), HP-UX, MacOS X.

One Path to SML

Never knowing what is the right time for a path to present itself, I think I am back on the path to SML again. This time I got some more feedback and wanted to capture it here.
Various feedback:

We’ll see what is my cup of tea.

A Slow Study Group for ML

Hi,
I’m going to work through
http://www.ccs.neu.edu/home/matthias/BTML/
and
http://www.cl.cam.ac.uk/~lp15/MLbook/
using
http://www.smlnj.org/
SLOWLY over MANY MONTHS.
The reason is that I’ve never learned a statically typed functional programming language, I feel weak on recursive data type definitions, and I am curious about compiler and interpreter construction. So, I’m looking for a way to learn about all 3 at once.
Why ML?

  1. Proven, excellent pedagogical language with great resources.
  2. Smaller than OCaml, F#, and Haskell; so I won’t get distracted with tons of “stuff”
  3. Puts me in a good position if I wanted to use it “for real” that OCaml, F#, Haskell, or even Scala and some other ML in Java languages would be a good follow up path in terms of leveraging the investment.

Basically when I sit down to learn the basics of anything from #2 I feel like they assume you know the basics of ML, and well, I don’t!
Let me know if you want to review problems together.

Enhanced Ocaml Documentation Version 3.12

The Enhanced Ocaml Documentation is provided by Hendrik Tews; basically it visually highlights any difference between the previous and current version of the documentation. Here is how he does it:

I diff the txt versions of the reference manual and change the html version by hand. For the grammar rule index I use a tool and manual editing.

–Hendrik Tews
Wow. What a labor of love. Be sure to give him a hand!
(via Caml-list)