Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / doc / guide / localhost / SXML
1 <!DOCTYPE html>
2 <html lang="en">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta name="generator" content="AsciiDoc 8.6.9">
6 <title>SXML</title>
7 <link rel="stylesheet" href="./asciidoc.css" type="text/css">
8 <link rel="stylesheet" href="./pygments.css" type="text/css">
9
10
11 <script type="text/javascript" src="./asciidoc.js"></script>
12 <script type="text/javascript">
13 /*<![CDATA[*/
14 asciidoc.install();
15 /*]]>*/
16 </script>
17 <link rel="stylesheet" href="./mlton.css" type="text/css">
18 </head>
19 <body class="article">
20 <div id="banner">
21 <div id="banner-home">
22 <a href="./Home">MLton 20180207</a>
23 </div>
24 </div>
25 <div id="header">
26 <h1>SXML</h1>
27 </div>
28 <div id="content">
29 <div id="preamble">
30 <div class="sectionbody">
31 <div class="paragraph"><p><a href="SXML">SXML</a> is an <a href="IntermediateLanguage">IntermediateLanguage</a>, translated from <a href="XML">XML</a> by
32 <a href="Monomorphise">Monomorphise</a>, optimized by <a href="SXMLSimplify">SXMLSimplify</a>, and translated by
33 <a href="ClosureConvert">ClosureConvert</a> to <a href="SSA">SSA</a>.</p></div>
34 </div>
35 </div>
36 <div class="sect1">
37 <h2 id="_description">Description</h2>
38 <div class="sectionbody">
39 <div class="paragraph"><p>SXML is a simply-typed version of <a href="XML">XML</a>.</p></div>
40 </div>
41 </div>
42 <div class="sect1">
43 <h2 id="_implementation">Implementation</h2>
44 <div class="sectionbody">
45 <div class="ulist"><ul>
46 <li>
47 <p>
48 <a href="https://github.com/MLton/mlton/blob/master/mlton/xml/sxml.sig"><span class="monospaced">sxml.sig</span></a>
49 </p>
50 </li>
51 <li>
52 <p>
53 <a href="https://github.com/MLton/mlton/blob/master/mlton/xml/sxml.fun"><span class="monospaced">sxml.fun</span></a>
54 </p>
55 </li>
56 <li>
57 <p>
58 <a href="https://github.com/MLton/mlton/blob/master/mlton/xml/sxml-tree.sig"><span class="monospaced">sxml-tree.sig</span></a>
59 </p>
60 </li>
61 </ul></div>
62 </div>
63 </div>
64 <div class="sect1">
65 <h2 id="_type_checking">Type Checking</h2>
66 <div class="sectionbody">
67 <div class="paragraph"><p><a href="SXML">SXML</a> shares the type checker for <a href="XML">XML</a>.</p></div>
68 </div>
69 </div>
70 <div class="sect1">
71 <h2 id="_details_and_notes">Details and Notes</h2>
72 <div class="sectionbody">
73 <div class="paragraph"><p>There are only two differences between <a href="XML">XML</a> and <a href="SXML">SXML</a>. First,
74 <a href="SXML">SXML</a> <span class="monospaced">val</span>, <span class="monospaced">fun</span>, and <span class="monospaced">datatype</span> declarations always have an
75 empty list of type variables. Second, <a href="SXML">SXML</a> variable references
76 always have an empty list of type arguments. Constructors uses can
77 only have a nonempty list of type arguments if the constructor is a
78 primitive.</p></div>
79 <div class="paragraph"><p>Although we could rely on the type system to enforce these constraints
80 by parameterizing the <a href="XML">XML</a> signature, <a href="StephenWeeks">StephenWeeks</a> did so in a
81 previous version of the compiler, and the software engineering gains
82 were not worth the effort.</p></div>
83 </div>
84 </div>
85 </div>
86 <div id="footnotes"><hr></div>
87 <div id="footer">
88 <div id="footer-text">
89 </div>
90 <div id="footer-badges">
91 </div>
92 </div>
93 </body>
94 </html>