File: StandardMLPortability

package info (click to toggle)
mlton 20130715-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 60,900 kB
  • ctags: 69,386
  • sloc: xml: 34,418; ansic: 17,399; lisp: 2,879; makefile: 1,605; sh: 1,254; pascal: 256; python: 143; asm: 97
file content (65 lines) | stat: -rw-r--r-- 2,946 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="generator" content="AsciiDoc 8.6.8">
<title>StandardMLPortability</title>
<link rel="stylesheet" href="./asciidoc.css" type="text/css">
<link rel="stylesheet" href="./pygments.css" type="text/css">


<script type="text/javascript" src="./asciidoc.js"></script>
<script type="text/javascript">
/*<![CDATA[*/
asciidoc.install();
/*]]>*/
</script>
<link rel="stylesheet" href="./mlton.css" type="text/css"/>
</head>
<body class="article">
<div id="banner">
<div id="banner-home">
<a href="./Home">MLton 20130715</a>
</div>
</div>
<div id="header">
<h1>StandardMLPortability</h1>
</div>
<div id="content">
<div id="preamble">
<div class="sectionbody">
<div class="paragraph"><p>Technically, SML&#8217;97 as defined in the
<a href="DefinitionOfStandardML">Definition</a>
requires only a minimal initial basis, which, while including the
types <span class="monospaced">int</span>, <span class="monospaced">real</span>, <span class="monospaced">char</span>, and <span class="monospaced">string</span>, need have
no operations on those base types.  Hence, the only observable output
of an SML&#8217;97 program is termination or raising an exception.  Most SML
compilers should agree there, to the degree each agrees with the
Definition.  See <a href="UnresolvedBugs">UnresolvedBugs</a> for MLton&#8217;s very few corner cases.</p></div>
<div class="paragraph"><p>Realistically, a program needs to make use of the
<a href="BasisLibrary">Basis Library</a>.
Within the Basis Library, there are numerous places where the behavior
is implementation dependent.  For a trivial example:</p></div>
<div class="listingblock">
<div class="content"><div class="highlight"><pre><span class="k">val</span><span class="w"> </span><span class="p">_</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="n">valOf</span><span class="w"> </span><span class="p">(</span><span class="n">Int</span><span class="p">.</span><span class="n">maxInt</span><span class="p">)</span><span class="w"></span>
</pre></div></div></div>
<div class="paragraph"><p>may either raise the <span class="monospaced">Option</span> exception (if
<span class="monospaced">Int.maxInt == NONE</span>) or may terminate normally.  The default
Int/Real/Word sizes are the biggest implementation dependent aspect;
so, one implementation may raise <span class="monospaced">Overflow</span> while another can
accommodate the result.  Also, maximum array and vector lengths are
implementation dependent.  Interfacing with the operating system is a
bit murky, and implementations surely differ in handling of errors
there.</p></div>
</div>
</div>
</div>
<div id="footnotes"><hr></div>
<div id="footer">
<div id="footer-text">
</div>
<div id="footer-badges">
</div>
</div>
</body>
</html>