SML on Mac OSX (incl. TextMate Bundle)
von Manuel Graf am 14.Jul 2011, in der Kategorie Mac Apps

At University, people sometimes do use strange programming languages, most evelopers never even heard about. One of these is SML (Standard Markup Language). A functional proramming language, designed to torture students all over the world. Due to missing Sources it can be somewhat annoying to install it. Thats why I wrote this Step-by-Step Instruction on how to Install SML on your Mac – even with a neat TextMate Bundle:
1. install this package:
SML for MAC OSX (Intel)…
2. set a symlink , so that our shell knows where the installed package dropped its binaries:
Applications > Terminal:
sudo ln -sf /usr/local/smlnj-110.72/bin/sml /usr/bin/sml
Now you can call the sml-command in Terminal:
>> sml
Standard ML of New Jersey v110.72 [built: Wed Feb 3 11:03:59 2010]
-
or just open a file with sml syntax in it via sml
>> sml test.sml
Standard ML of New Jersey v110.72 [built: Wed Feb 3 11:03:59 2010]
[opening test.sml]
hello worldval it = () : unit
val add = fn : int -> int -> int
val it = 7 : int
-
And now to the fun part: the TextMate Bundle that makes SML bearable. It offers syntax highlighting and neat things like a run-command. To install the bundle open a blank text document in Textmate (Cmd+N), change the document type to “Shell-script (bash)” at the section below the textfield and paste the following shell-code:
#!/bin/sh
LC_CTYPE=en_US.UTF-8
SVN=`which svn`
echo Changing to Bundles directory...
mkdir -p "/Library/Application Support/TextMate/Bundles"
cd "/Library/Application Support/TextMate/Bundles"
if [ -d "/Library/Application Support/TextMate/Bundles/Standard ML.tmbundle" ]; then
echo Standard ML bundle already exists - updating...
$SVN up "Standard ML.tmbundle"
else
echo Checking out Standard ML bundle...
$SVN --username anon --password anon co "http://svn.textmate.org/trunk/Bundles/Standard ML.tmbundle/"
fi
echo Reloading bundles in TextMate...
osascript -e 'tell app "TextMate" to reload bundles'
Nowhit CMD+R and TextMate should install the bundle all by itself.
This Bundle now offers you the “Standard ML” document type. After writing some lines in SML you can Run your SML-program by pressing CMD+R. Now it should look like this:

Ähnliche Artikel:
Über Manuel Graf
Manuel Graf ist Mediengestalter für Digital- und Printmedien bei iBusiness.de. Er arbeitet seit 6 Jahren mit Photoshop, HTML und CSS und hat sich seit 2 Jahren Kentnisse in Sprachen wie Javascript, Actionscript 3.0, BOIL, PHP, Ruby oder Python angeeignet.








