Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | <!DOCTYPE html>\r |
2 | <html lang="en">\r | |
3 | <head>\r | |
4 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\r | |
5 | <meta name="generator" content="AsciiDoc 8.6.9">\r | |
6 | <title>StandardMLPortability</title>\r | |
7 | <link rel="stylesheet" href="./asciidoc.css" type="text/css">\r | |
8 | <link rel="stylesheet" href="./pygments.css" type="text/css">\r | |
9 | \r | |
10 | \r | |
11 | <script type="text/javascript" src="./asciidoc.js"></script>\r | |
12 | <script type="text/javascript">\r | |
13 | /*<![CDATA[*/\r | |
14 | asciidoc.install();\r | |
15 | /*]]>*/\r | |
16 | </script>\r | |
17 | <link rel="stylesheet" href="./mlton.css" type="text/css">\r | |
18 | </head>\r | |
19 | <body class="article">\r | |
20 | <div id="banner">\r | |
21 | <div id="banner-home">\r | |
22 | <a href="./Home">MLton 20180207</a>\r | |
23 | </div>\r | |
24 | </div>\r | |
25 | <div id="header">\r | |
26 | <h1>StandardMLPortability</h1>\r | |
27 | </div>\r | |
28 | <div id="content">\r | |
29 | <div id="preamble">\r | |
30 | <div class="sectionbody">\r | |
31 | <div class="paragraph"><p>Technically, SML’97 as defined in the\r | |
32 | <a href="DefinitionOfStandardML">Definition</a>\r | |
33 | requires only a minimal initial basis, which, while including the\r | |
34 | types <span class="monospaced">int</span>, <span class="monospaced">real</span>, <span class="monospaced">char</span>, and <span class="monospaced">string</span>, need have\r | |
35 | no operations on those base types. Hence, the only observable output\r | |
36 | of an SML’97 program is termination or raising an exception. Most SML\r | |
37 | compilers should agree there, to the degree each agrees with the\r | |
38 | Definition. See <a href="UnresolvedBugs">UnresolvedBugs</a> for MLton’s very few corner cases.</p></div>\r | |
39 | <div class="paragraph"><p>Realistically, a program needs to make use of the\r | |
40 | <a href="BasisLibrary">Basis Library</a>.\r | |
41 | Within the Basis Library, there are numerous places where the behavior\r | |
42 | is implementation dependent. For a trivial example:</p></div>\r | |
43 | <div class="listingblock">\r | |
44 | <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>\r | |
45 | </pre></div></div></div>\r | |
46 | <div class="paragraph"><p>may either raise the <span class="monospaced">Option</span> exception (if\r | |
47 | <span class="monospaced">Int.maxInt == NONE</span>) or may terminate normally. The default\r | |
48 | Int/Real/Word sizes are the biggest implementation dependent aspect;\r | |
49 | so, one implementation may raise <span class="monospaced">Overflow</span> while another can\r | |
50 | accommodate the result. Also, maximum array and vector lengths are\r | |
51 | implementation dependent. Interfacing with the operating system is a\r | |
52 | bit murky, and implementations surely differ in handling of errors\r | |
53 | there.</p></div>\r | |
54 | </div>\r | |
55 | </div>\r | |
56 | </div>\r | |
57 | <div id="footnotes"><hr></div>\r | |
58 | <div id="footer">\r | |
59 | <div id="footer-text">\r | |
60 | </div>\r | |
61 | <div id="footer-badges">\r | |
62 | </div>\r | |
63 | </div>\r | |
64 | </body>\r | |
65 | </html>\r |