Vacant-Address-Space.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
  2. <html>
  3. <!-- Created on December 10, 2012 by texi2html 1.82
  4. texi2html was written by:
  5. Lionel Cons <[email protected]> (original author)
  6. Karl Berry <[email protected]>
  7. Olaf Bachmann <[email protected]>
  8. and many others.
  9. Maintained by: Many creative people.
  10. Send bugs and suggestions to <[email protected]>
  11. -->
  12. <head>
  13. <title>avram - a virtual machine code interpreter: 2.7.17 Vacant Address Space</title>
  14. <meta name="description" content="avram - a virtual machine code interpreter: 2.7.17 Vacant Address Space">
  15. <meta name="keywords" content="avram - a virtual machine code interpreter: 2.7.17 Vacant Address Space">
  16. <meta name="resource-type" content="document">
  17. <meta name="distribution" content="global">
  18. <meta name="Generator" content="texi2html 1.82">
  19. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  20. <style type="text/css">
  21. <!--
  22. a.summary-letter {text-decoration: none}
  23. blockquote.smallquotation {font-size: smaller}
  24. pre.display {font-family: serif}
  25. pre.format {font-family: serif}
  26. pre.menu-comment {font-family: serif}
  27. pre.menu-preformatted {font-family: serif}
  28. pre.smalldisplay {font-family: serif; font-size: smaller}
  29. pre.smallexample {font-size: smaller}
  30. pre.smallformat {font-family: serif; font-size: smaller}
  31. pre.smalllisp {font-size: smaller}
  32. span.roman {font-family:serif; font-weight:normal;}
  33. span.sansserif {font-family:sans-serif; font-weight:normal;}
  34. ul.toc {list-style: none}
  35. -->
  36. </style>
  37. </head>
  38. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  39. <a name="Vacant-Address-Space"></a>
  40. <table cellpadding="1" cellspacing="1" border="0">
  41. <tr><td valign="middle" align="left">[<a href="Interaction-combinator.html#Interaction-combinator" title="Previous section in reading order"> &lt; </a>]</td>
  42. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next section in reading order"> &gt; </a>]</td>
  43. <td valign="middle" align="left"> &nbsp; </td>
  44. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  45. <td valign="middle" align="left">[<a href="Virtual-Code-Semantics.html#Virtual-Code-Semantics" title="Up section"> Up </a>]</td>
  46. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  47. <td valign="middle" align="left"> &nbsp; </td>
  48. <td valign="middle" align="left"> &nbsp; </td>
  49. <td valign="middle" align="left"> &nbsp; </td>
  50. <td valign="middle" align="left"> &nbsp; </td>
  51. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  52. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  53. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  54. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  55. </tr></table>
  56. <hr size="1">
  57. <a name="Vacant-Address-Space-1"></a>
  58. <h3 class="subsection">2.7.17 Vacant Address Space</h3>
  59. <p>Not every possible pattern has been used by the virtual machine as a way
  60. of encoding a function. The following patterns, where <code><var>a</var></code>,
  61. <code><var>b</var></code>, and <code><var>c</var></code> are non-<code>nil</code> trees, do not
  62. represent anything useful.
  63. </p>
  64. <dl compact="compact">
  65. <dt> unary forms</dt>
  66. <dd><p><code>((nil,nil),((nil,nil),(nil,((nil,<var>a</var>),nil))))</code><br>
  67. <code>((nil,nil),((nil,nil),(nil,(nil,(nil,<var>a</var>)))))</code>
  68. </p></dd>
  69. <dt> binary forms</dt>
  70. <dd><p><code>((nil,nil),((nil,nil),(<var>a</var>,<var>b</var>)))</code><br>
  71. <code>((nil,nil),((<var>a</var>,nil),(<var>b</var>,nil)))</code><br>
  72. <code>((nil,nil),((<var>a</var>,nil),(nil,<var>b</var>)))</code>
  73. </p></dd>
  74. <dt> ternary forms</dt>
  75. <dd><p><code>((nil,nil),((<var>a</var>,<var>b</var>),(<var>c</var>,nil)))</code><br>
  76. <code>((nil,nil),((<var>a</var>,<var>b</var>),(nil,<var>c</var>)))</code><br>
  77. <code>((nil,nil),((<var>a</var>,nil),(<var>b</var>,<var>c</var>)))</code><br>
  78. <code>((nil,nil),((nil,<var>a</var>),(<var>b</var>,<var>c</var>)))</code>
  79. </p></dd>
  80. </dl>
  81. <p>These patterns are detected by the virtual machine simply to avoid blowing
  82. it up, but they always cause an error message to be reported.
  83. <a name="index-unsupported-hook-2"></a>
  84. <a name="index-unrecognized-combinator-1"></a>
  85. </p>
  86. <dl compact="compact">
  87. <dt> <em>P55</em></dt>
  88. <dd><p>For <code><var>f</var></code> matching any of the first three trees in the above list,<br>
  89. <code><var>f</var>_<var>n</var> <var>x</var>_<var>n</var></code> =
  90. [[<code>('unsupported hook',nil)</code>]]<code>_(<var>n</var>+1)</code>
  91. </p></dd>
  92. <dt> <em>P56</em></dt>
  93. <dd><p>For the remaining trees <code><var>f</var></code> in the above list,<br>
  94. <code><var>f</var>_<var>n</var> <var>x</var>_<var>n</var></code> =
  95. [[<code>('unrecognized combinator (code <var>m</var>)',nil)</code>]]<code>_(<var>n</var>+1)</code>
  96. </p></dd>
  97. </dl>
  98. <p>Here, <code><var>m</var></code> is a numeric constant dependent on which tree
  99. <code><var>f</var></code> was used. The unsupported hook message is meant to be
  100. more informative than the unrecognized combinator message, suggesting
  101. that a feature intended for future use is not yet available.
  102. </p>
  103. <p>This list has been assembled for the benefit of readers considering the
  104. addition of backward compatible extensions to the virtual code
  105. semantics, who are undeterred by the facts that
  106. </p><ul>
  107. <li>
  108. the computational model
  109. <a name="index-universality-1"></a>
  110. is already universal
  111. </li><li>
  112. virtual code applications are already
  113. interoperable with all kinds of high performance software having a text
  114. based or console interface by way of the <code>interact</code> combinator
  115. </li><li>
  116. an unlimited number of built in library functions can be added
  117. by way of the <code>library</code> combinator as described in
  118. <a href="Implementing-new-library-functions.html#Implementing-new-library-functions">Implementing new library functions</a>
  119. </li><li>
  120. the C code in <code>avram</code> makes fairly
  121. <a name="index-pointers-2"></a>
  122. intricate use of pointers with a careful policy of reference counting
  123. and storage reclamation
  124. </li><li>
  125. there is also a performance penalty incurred by
  126. <a name="index-reference-count"></a>
  127. further extensions to the semantics, even for applications that don&rsquo;t
  128. use them, because a pattern recognition algorithm in the interpreter has
  129. more cases to consider.
  130. </li></ul>
  131. <p>Nevertheless, a new functional form combining a pair of functions to be
  132. interpreted in a new way by the virtual machine could be defined using
  133. any of the binary forms above, for example, with <code><var>a</var></code> as the
  134. virtual code for one of the functions and <code><var>b</var></code> as that of the
  135. other. Such a form would not conflict with any existing applications,
  136. provided that both <code><var>a</var></code> and <code><var>b</var></code> are not <code>nil</code>,
  137. which is true of any valid representation for a function.
  138. </p>
  139. <p>Virtual machine architects, take note. There are infinitely many trees
  140. <a name="index-trees-4"></a>
  141. fitting these patterns, but it would be possible to use them up by
  142. assigning them without adequate foresight. For example, if
  143. interpretations were assigned to the four ternary forms, the three binary
  144. forms, and one of the remaining unary forms, then the only
  145. unassigned pattern could be of the form
  146. </p>
  147. <table><tr><td>&nbsp;</td><td><pre class="display"><code>((nil,nil),((nil,nil),(nil,(nil,(nil,<var>a</var>)))))</code>
  148. </pre></td></tr></table>
  149. <p>Assigning an interpretation to it would leave no further room for
  150. backward compatible expansion. On the other hand, any tree of the
  151. following form also fits the above pattern,
  152. </p>
  153. <table><tr><td>&nbsp;</td><td><pre class="display"><code>((nil,nil),((nil,nil),(nil,(nil,(nil,(<var>b</var>,<var>c</var>))))))</code>
  154. </pre></td></tr></table>
  155. <p>with any values for <code><var>b</var></code> and <code><var>c</var></code>. Different
  156. meanings could be chosen for the case where both are <code>nil</code>, both
  157. are non-<code>nil</code>, or one is <code>nil</code> and the other non-<code>nil</code>,
  158. allowing two unary forms, one binary, and one constant. If at least one
  159. of these patterns is reserved for future enhancements, then a
  160. potentially inexhaustible supply of address space remains and there will
  161. be no need for incompatible changes later.
  162. </p>
  163. <hr size="1">
  164. <table cellpadding="1" cellspacing="1" border="0">
  165. <tr><td valign="middle" align="left">[<a href="Interaction-combinator.html#Interaction-combinator" title="Previous section in reading order"> &lt; </a>]</td>
  166. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next section in reading order"> &gt; </a>]</td>
  167. <td valign="middle" align="left"> &nbsp; </td>
  168. <td valign="middle" align="left">[<a href="Virtual-Machine-Specification.html#Virtual-Machine-Specification" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
  169. <td valign="middle" align="left">[<a href="Virtual-Code-Semantics.html#Virtual-Code-Semantics" title="Up section"> Up </a>]</td>
  170. <td valign="middle" align="left">[<a href="Library-Reference.html#Library-Reference" title="Next chapter"> &gt;&gt; </a>]</td>
  171. <td valign="middle" align="left"> &nbsp; </td>
  172. <td valign="middle" align="left"> &nbsp; </td>
  173. <td valign="middle" align="left"> &nbsp; </td>
  174. <td valign="middle" align="left"> &nbsp; </td>
  175. <td valign="middle" align="left">[<a href="avram.html#Top" title="Cover (top) of document">Top</a>]</td>
  176. <td valign="middle" align="left">[<a href="avram_toc.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
  177. <td valign="middle" align="left">[<a href="Function-Index.html#Function-Index" title="Index">Index</a>]</td>
  178. <td valign="middle" align="left">[<a href="avram_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
  179. </tr></table>
  180. <p>
  181. <font size="-1">
  182. This document was generated on <i>December 10, 2012</i> using <a href="http://www.nongnu.org/texi2html/"><i>texi2html 1.82</i></a>.
  183. </font>
  184. <br>
  185. </p>
  186. </body>
  187. </html>