4

I have been looking for some good documentation on how to get Standard ML running on windows. Does anyone have a good guide on this?

I have tried compiling sml/nj in cygwin, using this guide: http://www.smlnj.org/install/index.html

$ config/install.sh
config/install.sh: Using shell /bin/sh.
config/install.sh: SML root is /usr/local/sml.
config/install.sh: Installation directory is /usr/local/sml.
config/install.sh: Installing version 110.74.
config/install.sh: URL of source archive is http://smlnj.cs.uchicago.edu/dist/working/110.74/.
config/install.sh: Script /usr/local/sml/bin/.arch-n-opsys reports ARCH=x86; OPSYS=win32; HEAP_SUFFIX=x86-win32.
/usr/local/sml/config/unpack: The run-time tree already exists.
config/install.sh: Compiling the run-time system.
(nmake /Fmakefile.win32 MAKE="nmake /Fmakefile.win32" RUNTIME="run.x86-win32.exe" VERSION="v-x86-win32" CC="cl" CFLAGS="/Zi" CPP="cl /E /EP" TARGET=X86 DEFS="  /DHOST_X86 /DTARGET_X86 /DOPSYS_WIN32 /DVREGS /DINDIRECT_CFUNC /DDLOPEN" XOBJS="" XLIBS="" LD_LIBS="" XCLIBS="" run.x86-win32.exe)
make: -c: Command not found
mk.x86-win32:26: recipe for target `all' failed
make: *** [all] Error 127
config/install.sh: !!! Run-time system build failed for some reason.

Any suggestions would be appreciated.

Makarius
  • 2,165
  • 18
  • 20
user833970
  • 2,729
  • 3
  • 26
  • 41
  • I ran into the same problem (and ultimately ended up using a the Windows msi). I dug into the code, and it seems that the install script doesn't recognize the information Cygwin provides about the OS; even after adding in information, it still didn't work for me because some of the code is written in 32-bit assembly, while the compiler uses 64-bit C libraries. – Nathaniel Verhaaren Jul 06 '17 at 17:25

3 Answers3

4

Moscow ML (MosML) works out of the box on Windows (No need for cygwin). You can either download a zip-file or a self-extracting installer.

The website also contains a fairly good documentation (good for some of the MosML specific parts) and links to other good references.

Regarding your issue, the guide you refer to doesn't mention compiling sml/nj on windows. Just by using cygwin doesn't make it "linux" (cygwin has quite some quirks). The source contains some notes on how to install (and compile) on cygwin. Note if you are using an older version of sml/nj, then it is not necessarily compatible with cygwin.

On a side note. There exists a msi installer for windows, why not use that?

Jesper.Reenberg
  • 5,944
  • 23
  • 31
2

It has become a running gag in the long history of Standard ML that its best implementation is hardly known: Poly/ML.

The releases at Github also include MSIs for Windows.

Makarius
  • 2,165
  • 18
  • 20
  • When I use that (5.7 x64) .msi all I get is a shabby PolyML.exe which appears to be a windows repl application or something. Where is the compiler and all the rest? – BitTickler Sep 21 '17 at 14:42
  • FYI out of the box Poly/ML doesn't seem to support `use` statements (i.e. module imports) for source files in a different directory than the current one (eg `use "../util.sml;"`), whereas SML/NJ does. Poly doesn't perform the `chdir` under the hood required for the paths to make sense. Huge barrier to entry if you're just using SML for educational/exploratory purposes. – iono Feb 27 '21 at 09:20
1

If you are looking for a quick and dirty implementation you might want to try Cambridge ML. We use it for teaching undergraduates ML here in Cambridge. Not the best option for large scale development but adequate for teaching the basics of the language.

William Denman
  • 3,046
  • 32
  • 34