all repos — hex @ aa5bc6e116411af6db2cb816bef6759d96011aca

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Added opcodes to spec.
h3rald h3rald@h3rald.com
Fri, 20 Dec 2024 13:45:53 +0100
commit

aa5bc6e116411af6db2cb816bef6759d96011aca

parent

ce0744f885a7d17bbef5ff428e3964be81071917

2 files changed, 71 insertions(+), 7 deletions(-)

jump to
M src/vm.csrc/vm.c

@@ -8,7 +8,7 @@ ////////////////////////////////////////

int hex_bytecode_integer(hex_context_t *ctx, uint8_t **bytecode, size_t *size, size_t *capacity, int32_t value) { - hex_debug(ctx, "PUSHIN[01]: 0x%X", value); + hex_debug(ctx, "PUSHIN[01]: 0x%x", value); // Check if we need to resize the buffer (size + int32_t size + opcode (1) + max encoded length (4)) if (*size + sizeof(int32_t) + 1 + 4 > *capacity) {

@@ -113,7 +113,7 @@ }

*bytecode = new_bytecode; } uint8_t opcode = hex_symbol_to_opcode(value); - hex_debug(ctx, "NATSYM[%02X]: %s", opcode, value); + hex_debug(ctx, "NATSYM[%02x]: %s", opcode, value); (*bytecode)[*size] = opcode; *size += 1; // opcode }

@@ -122,7 +122,7 @@ {

// Add to symbol table hex_symboltable_set(ctx, value); int index = hex_symboltable_get_index(ctx, value); - hex_debug(ctx, "LOOKUP[00]: %02X -> %s", index, value); + hex_debug(ctx, "LOOKUP[00]: %02x -> %s", index, value); // Check if we need to resize the buffer (size + 1 opcode + 2 max index) if (*size + 1 + 2 > *capacity) {

@@ -336,7 +336,7 @@

*bytecode += length; *size -= length; - hex_debug(ctx, ">> PUSHIN[01]: 0x%X", value); + hex_debug(ctx, ">> PUSHIN[01]: 0x%x", value); hex_item_t item = hex_integer_item(ctx, value); *result = item; return 0;

@@ -419,7 +419,7 @@ hex_error(ctx, "(%d,%d) Unable to reference native symbol: %s (bytecode)", token->position.line, token->position.column, token->value);

hex_free_token(token); return 1; } - hex_debug(ctx, ">> NATSYM[%02X]: %s", opcode, symbol); + hex_debug(ctx, ">> NATSYM[X]: %s", opcode, symbol); *result = item; return 0; }

@@ -464,7 +464,7 @@ hex_item_t item;

item.type = HEX_TYPE_USER_SYMBOL; item.token = token; - hex_debug(ctx, ">> LOOKUP[00]: %02X -> %s", index, value); + hex_debug(ctx, ">> LOOKUP[00]: %02x -> %s", index, value); *result = item; return 0; }

@@ -593,7 +593,7 @@ while (size > 0)

{ position = bytecode_size - size; uint8_t opcode = *bytecode; - hex_debug(ctx, "-- [%08d] OPCODE: %02X", position, opcode); + hex_debug(ctx, "-- [%08d] OPCODE: %02x", position, opcode); bytecode++; size--;
M web/contents/spec.htmlweb/contents/spec.html

@@ -336,138 +336,174 @@ </p>

<h4 id="memory-management-symbols">Memory Management Symbols<a href="#top"></a></h4> <h5 id="store-symbol"><code>$::$$</code> Symbol<a href="#top"></a></h5> <p><mark>a s &rarr;</mark></p> + <aside>OPCODE: <code>10</code></aside> <p>Stores the literal <code>a</code> in the registry as the symbol <code>s</code>.</p> <h5 id="free-symbol"><code>$:#$$</code> Symbol<a href="#top"></a></h5> <p><mark>s &rarr;</mark></p> + <aside>OPCODE: <code>11</code></aside> <p>Frees the symbol <code>s</code> from the registry.</p> <h4 id="control-flow-symbols">Control Flow Symbols<a href="#top"></a></h4> <h5 id="if-symbol"><code>$:if$$</code> Symbol<a href="#top"></a></h5> <p><mark>q1 q2 q3 &rarr; *</mark></p> + <aside>OPCODE: <code>12</code></aside> <p>Dequotes quotation <code>q1</code>, if it pushes a positive integer on the stack it dequotes <code>q2</code>, otherwise dequotes <code>q3</code>.</p> <h5 id="when-symbol"><code>$:when$$</code> Symbol<a href="#top"></a></h5> <p><mark>q1 q2 &rarr; *</mark></p> + <aside>OPCODE: <code>13</code></aside> <p>Dequotes quotation <code>q1</code>, if it pushes a positive integer on the stack it dequotes <code>q2</code>. </p> <h5 id="while-symbol"><code>$:while$$</code> Symbol<a href="#top"></a></h5> <p><mark>q1 q2 &rarr; *</mark></p> + <aside>OPCODE: <code>14</code></aside> <p>Dequotes quotation <code>q1</code>, if it pushes a positive integer on the stack it dequotes <code>q2</code> and repeats the process.</p> <h5 id="error-symbol"><code>$:error$$</code> Symbol<a href="#top"></a></h5> <p><mark>&rarr; s</mark></p> + <aside>OPCODE: <code>15</code></aside> <p>Pushes the last error message to the stack.</p> <h5 id="try-symbol"><code>$:try$$</code> Symbol<a href="#top"></a></h5> <p><mark>q1 q2 &rarr; *</mark></p> + <aside>OPCODE: <code>16</code></aside> <p>Dequotes quotation <code>q1</code>, if it throws an error it dequotes <code>q2</code>.</p> <h4 id="stack-management-symbols">Stack Management Symbol<a href="#top"></a></h4> <h5 id="dup-symbol"><code>$:dup$$</code> Symbol<a href="#top"></a></h5> <p><mark> a &rarr; a a</mark></p> + <aside>OPCODE: <code>17</code></aside> <p>Duplicates literal <code>a</code> and pushes it on the stack.</p> <h5 id="stack-symbol"><code>$:stack$$</code> Symbol<a href="#top"></a></h5> <p><mark> &rarr; q</mark></p> + <aside>OPCODE: <code>18</code></aside> <p>Pushes the items currently on the stack as a quotation on the stack.</p> <h5 id="clear-symbol"><code>$:clear$$</code> Symbol<a href="#top"></a></h5> <p><mark> &rarr;</mark></p> + <aside>OPCODE: <code>19</code></aside> <p>Clears the stack.</p> <h5 id="pop-symbol"><code>$:pop$$</code> Symbol<a href="#top"></a></h5> <p><mark> a &rarr;</mark></p> + <aside>OPCODE: <code>1a</code></aside> <p>Removes the top item from the stack.</p> <h5 id="swap-symbol"><code>$:swap$$</code> Symbol<a href="#top"></a></h5> <p><mark> a1 a2 &rarr; a2 a1</mark></p> + <aside>OPCODE: <code>1b</code></aside> <p>Swaps the top two items on the stack.</p> <h4 id="evaluation-symbols">Evaluation Symbols<a href="#top"></a></h4> <h5 id="i-symbol"><code>$:.$$</code> Symbol<a href="#top"></a></h5> <p><mark>q &rarr; *</mark></p> + <aside>OPCODE: <code>1c</code></aside> <p>Dequotes quotation <code>q</code>.</p> <h5 id="eval-symbol"><code>$:!$$</code> Symbol<a href="#top"></a></h5> <p><mark>(s|q) &rarr; *</mark></p> + <aside>OPCODE: <code>1d</code></aside> <p>Evaluates the string <code>s</code> as an hex program, or the array of integers to be interpreted as hex bytecode (HBX format).</p> <h5 id="quote-symbol"><code>$:&#39;$$</code> Symbol<a href="#top"></a></h5> <p><mark>a &rarr; q</mark></p> + <aside>OPCODE: <code>1e</code></aside> <p>Pushes the literal <code>a</code> wrapped in a quotation on the stack.</p> <h4 id="arithmetic-symbols">Arithmetic Symbols<a href="#top"></a></h4> <h5 id="add-symbol"><code>$:+$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 i2 &rarr; i</mark></p> + <aside>OPCODE: <code>1f</code></aside> <p>Pushes the result of the sum of <code>i1</code> and <code>i2</code> on the stack.</p> <h5 id="subtract-symbol"><code>$:-$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>20</code></aside> <p>Pushes the result of the subtraction of <code>12</code> from <code>i1</code> on the stack.</p> <h5 id="multiply-symbol"><code>$:*$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>21</code></aside> <p>Pushes the result of the multiplication of <code>i1</code> and <code>12</code> on the stack.</p> <h5 id="divide-symbol"><code>$:/$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>22</code></aside> <p>Pushes the result of the division of <code>i1</code> by <code>12</code> on the stack.</p> <h5 id="modulo-symbol"><code>$:%$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>23</code></aside> <p>Pushes the result of the modulo of <code>i1</code> by <code>12</code> on the stack.</p> <h4 id="bitwise-operations-symbols">Bitwise Operations Symbols<a href="#top"></a></h4> <h5 id="bitwise-and-symbol"><code>$:&amp;$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>24</code></aside> <p>Pushes the result of a bitwise and of <code>i1</code> and <code>i2</code> on the stack.</p> <h5 id="bitwise-or-symbol"><code>$:|$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>25</code></aside> <p>Pushes the result of a bitwise or of <code>i1</code> and <code>i2</code> on the stack.</p> <h5 id="bitwise-xor-symbol"><code>$:^$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>26</code></aside> <p>Pushes the result of a bitwise xor of <code>i1</code> and <code>i2</code> on the stack.</p> <h5 id="bitwise-not-symbol"><code>$:~$$</code> Symbol<a href="#top"></a></h5> <p><mark> i &rarr; i</mark></p> + <aside>OPCODE: <code>27</code></aside> <p>Pushes the result of a bitwise not of <code>i</code> on the stack.</p> <h5 id="bitwise-leftshift-symbol"><code>$:&lt;&lt;$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>28</code></aside> <p>Pushes the result of shifting <code>i1</code> by <code>i2</code> bits to the left.</p> <h5 id="bitwise-rightshift-symbol"><code>$:&gt;&gt;$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>29</code></aside> <p>Pushes the result of shifting <code>i1</code> by <code>i2</code> bits to the right.</p> <h4 id="comparisons-symbols">Comparisons Symbols<a href="#top"></a></h4> <h5 id="equal-symbol"><code>$:==$$</code> Symbol<a href="#top"></a></h5> <p><mark> a1 a2 &rarr; i</mark></p> + <aside>OPCODE: <code>2a</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>a1</code> and <code>a2</code> are equal, or <code>0x0</code> otherwise.</p> <h5 id="notequal-symbol"><code>$:!=$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>2b</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>a1</code> and <code>a2</code> are not equal, or <code>0x0</code> otherwise. </p> <h5 id="greaterthan-symbol"><code>$:&gt;$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>2c</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i1</code> is greater than <code>i2</code>, or <code>0x0</code> otherwise.</p> <h5 id="lessthan-symbol"><code>$:&lt;$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>2d</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i1</code> is less than <code>i2</code>, or <code>0x0</code> otherwise.</p> <h5 id="greaterthanequal-symbol"><code>$:&gt;=$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 12 &rarr; i</mark></p> + <aside>OPCODE: <code>2e</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i1</code> is greater than or equal to <code>i2</code>, or <code>0x0</code> otherwise. </p> <h5 id="lessthanequal-symbol"><code>$:&lt;=$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 i2 &rarr; i</mark></p> + <aside>OPCODE: <code>2f</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i1</code> is less than or equal to <code>i2</code>, or <code>0x0</code> otherwise. </p> <h4 id="boolean-logic-symbols">Boolean Logic Symbols<a href="#top"></a></h4> <h5 id="and-symbol"><code>$:and$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 i2 &rarr; i</mark></p> + <aside>OPCODE: <code>30</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i1</code> and <code>i2</code> are non-zero integers, or <code>0x0</code> otherwise. </p> <h5 id="or-symbol"><code>$:or$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 i2 &rarr; i</mark></p> + <aside>OPCODE: <code>31</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i1</code> or <code>i2</code> are non-zero integers, or <code>0x0</code> otherwise. </p> <h5 id="not-symbol"><code>$:not$$</code> Symbol<a href="#top"></a></h5> <p><mark> i &rarr; i</mark></p> + <aside>OPCODE: <code>32</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i</code> is zero, or <code>0x0</code> otherwise.</p> <h5 id="xor-symbol"><code>$:xor$$</code> Symbol<a href="#top"></a></h5> <p><mark> i1 i2 &rarr; i</mark></p> + <aside>OPCODE: <code>33</code></aside> <p>Pushes <code>0x1</code> on the stack if <code>i1</code> and <code>i2</code> are different, or <code>0x0</code> otherwise.

@@ -475,35 +511,42 @@ </p>

<h4 id="type-checking-and-conversion-symbols">Type Checking and Conversion Symbols<a href="#top"></a></h4> <h5 id="int-symbol"><code>$:int$$</code> Symbol<a href="#top"></a></h5> <p><mark>s &rarr; i</mark></p> + <aside>OPCODE: <code>34</code></aside> <p>Converts the string <code>s</code> representing a hexadecimal integer to an integer value and pushes it on the stack.</p> <h5 id="str-symbol"><code>$:str$$</code> Symbol<a href="#top"></a></h5> <p><mark> i &rarr; s</mark></p> + <aside>OPCODE: <code>35</code></aside> <p>Converts the integer <code>i</code> to a string representing a hexadecimal integer and pushes it on the stack. </p> <h5 id="dec-symbol"><code>$:dec$$</code> Symbol<a href="#top"></a></h5> <p><mark> i &rarr; s</mark></p> + <aside>OPCODE: <code>36</code></aside> <p>Converts the integer <code>i</code> to a string representing a decimal integer and pushes it on the stack. </p> <h5 id="hex-symbol"><code>$:hex$$</code> Symbol<a href="#top"></a></h5> <p><mark> s &rarr; i</mark></p> + <aside>OPCODE: <code>37</code></aside> <p>Converts the string <code>s</code> representing a decimal integer to an integer value and pushes it on the stack. </p> <h5 id="ord-symbol"><code>$:ord$$</code> Symbol<a href="#top"></a></h5> <p><mark> s &rarr; i</mark></p> + <aside>OPCODE: <code>38</code></aside> <p>Pushes the ASCII value of the string <code>s</code> on the stack.</p> <p>If <code>s</code> is longer than 1 character or if it is not representable using an ASCII code between $0x0$$ and $0x7f$$, <code>$0xffffffff$$</code> is pushed on the stack.</p> <h5 id="chr-symbol"><code>$:chr$$</code> Symbol<a href="#top"></a></h5> <p><mark> i &rarr; s</mark></p> + <aside>OPCODE: <code>39</code></aside> <p>Pushes the ASCII character represented by the integer <code>i</code> on the stack.</p> <p>If <code>i</code> is not between $0x0$$ and $0x7f$$, an empty string is pushed on the stack.</p> <h5 id="type-symbol"><code>$:type$$</code> Symbol<a href="#top"></a></h5> <p><mark> a &rarr; s</mark></p> + <aside>OPCODE: <code>3a</code></aside> <p>Pushes the type of the literal <code>a</code> on the stack (<code>integer</code>, <code>string</code>, <code>quotation</code>, <code>native-symbol</code>, <code>user-symbol</code>, <code>invalid</code>, or <code>unknown</code>).

@@ -511,31 +554,38 @@ </p>

<h4 id="list-symbols">List (Strings and Quotations) Symbols<a href="#top"></a></h4> <h5 id="cat-symbol"><code>$:cat$$</code> Symbol<a href="#top"></a></h5> <p><mark> (s1 s2|q1 q2) &rarr; (s|q)</mark></p> + <aside>OPCODE: <code>3b</code></aside> <p>Pushes the result of the concatenation of two strings or two quotations on the stack.</p> <h5 id="len-symbol"><code>$:len$$</code> Symbol<a href="#top"></a></h5> <p><mark> (s|q) &rarr; i</mark></p> + <aside>OPCODE: <code>3c</code></aside> <p>Pushes the length of a string or a quotation on the stack.</p> <h5 id="get-symbol"><code>$:get$$</code> Symbol<a href="#top"></a></h5> <p><mark> (s|q) i &rarr; a</mark></p> + <aside>OPCODE: <code>3d</code></aside> <p>Pushes the <code>i</code>th item of a string or a quotation on the stack.</p> <h5 id="index-symbol"><code>$:index$$</code> Symbol<a href="#top"></a></h5> <p><mark> (s a|q a) &rarr; i</mark></p> + <aside>OPCODE: <code>3e</code></aside> <p>Pushes the index of the first occurrence of the literal <code>a</code> in a string or a quotation on the stack. If <code>a</code> is not found, <code>$0xffffffff$$</code> is pushed on the stack.</p> <h5 id="join-symbol"><code>$:join$$</code> Symbol<a href="#top"></a></h5> <p><mark> q s1 &rarr; s2</mark></p> + <aside>OPCODE: <code>3f</code></aside> <p>Assuming that <code>q</code> is a quotation containing only strings, pushes the string <code>s2</code> obtained by joining each element of <code>q</code> together using <code>s1</code> as a delimiter. </p> <h4 id="string-symbols">String Symbols<a href="#top"></a></h4> <h5 id="split-symbol"><code>$:split$$</code> Symbol<a href="#top"></a></h5> <p><mark> s1 s2 &rarr; q</mark></p> + <aside>OPCODE: <code>40</code></aside> <p>Pushes a quotation <code>q</code> containing the strings obtained by splitting <code>s1</code> using <code>s2</code> as a delimiter. </p> <h5 id="replace-symbol"><code>$:replace$$</code> Symbol<a href="#top"></a></h5> <p><mark> s1 s2 s3 &rarr; s4</mark></p> + <aside>OPCODE: <code>41</code></aside> <p>Pushes the string <code>s4</code> obtained by replacing the first occurrence of <code>s2</code> in <code>s1</code> by <code>s3</code>.

@@ -543,54 +593,68 @@ </p>

<h4 id="quotation-symbols">Quotation Symbols<a href="#top"></a></h4> <h5 id="each-symbol"><code>$:each$$</code> Symbol<a href="#top"></a></h5> <p><mark> q1 q2 &rarr; *</mark></p> + <aside>OPCODE: <code>42</code></aside> <p>Dequotes quotation <code>q1</code> and applies it to each item of quotation <code>q2</code>.</p> <h5 id="map-symbol"><code>$:map$$</code> Symbol<a href="#top"></a></h5> <p><mark> q1 q2 &rarr; q3</mark></p> + <aside>OPCODE: <code>43</code></aside> <p>Dequotes quotation <code>q1</code> and applies it to each item of quotation <code>q2</code> to obtain a new quotation <code>q3</code>. <h5 id="filter-symbol"><code>$:filter$$</code> Symbol<a href="#top"></a></h5> <p><mark> q1 q2 &rarr; q</mark></p> + <aside>OPCODE: <code>44</code></aside> <p>Dequotes quotation <code>q1</code> and applies it to each item of quotation <code>q2</code> to obtain a new quotation <code>q</code> containing only the items that returned a positive integer.</p> <h4 id="input-output-symbols">Input/Output Symbols<a href="#top"></a></h4> <h5 id="puts-symbol"><code>$:puts$$</code> Symbol<a href="#top"></a></h5> <p><mark> a &rarr;</mark></p> + <aside>OPCODE: <code>45</code></aside> <p>Prints <code>a</code> to standard output, followed by a new line.</p> <h5 id="warn-symbol"><code>$:warn$$</code> Symbol<a href="#top"></a></h5> <p><mark> a &rarr;</mark></p> + <aside>OPCODE: <code>46</code></aside> <p>Prints <code>a</code> to standard error, followed by a new line.</p> <h5 id="print-symbol"><code>$:print$$</code> Symbol<a href="#top"></a></h5> <p><mark> a &rarr;</mark></p> + <aside>OPCODE: <code>47</code></aside> <p>Prints <code>a</code> to standard output.</p> <h5 id="gets-symbol"><code>$:gets$$</code> Symbol<a href="#top"></a></h5> <p><mark> &rarr; s</mark></p> + <aside>OPCODE: <code>48</code></aside> <p>Reads a line from standard input and pushes it on the stack as a string.</p> <h4 id="file-symbols">File Symbols<a href="#top"></a></h4> <h5 id="read-symbol"><code>$:read$$</code> Symbol<a href="#top"></a></h5> <p><mark>s1 &rarr; (s2|q)</mark></p> + <aside>OPCODE: <code>49</code></aside> <p>Reads the content of the file <code>s1</code> and pushes it on the stack as a string, if the file is in textual format, or as a quotation of integers representing bytes, if the file is in binary format.</p> <h5 id="write-symbol"><code>$:write$$</code> Symbol<a href="#top"></a></h5> <p><mark>(s1|q) s2 &rarr;</mark></p> + <aside>OPCODE: <code>4a</code></aside> <p>Writes the string <code>s1</code> or the array of integers representing bytes <code>q</code> to the file <code>s2</code>. <h5 id="append-symbol"><code>$:append$$</code> Symbol<a href="#top"></a></h5> <p><mark>(s1|q) s2 &rarr;</mark></p> + <aside>OPCODE: <code>4b</code></aside> <p>Appends the string <code>s1</code> or the array of integers representing bytes <code>q</code> to the file <code>s2</code>. </p> <h4 id="shell-symbols">Shell Symbols<a href="#top"></a></h4> <h5 id="args-symbol"><code>$:args$$</code> Symbol<a href="#top"></a></h5> <p><mark> &rarr; q</mark></p> + <aside>OPCODE: <code>4c</code></aside> <p>Pushes the command line arguments as a quotation on the stack.</p> <h5 id="exit-symbol"><code>$:exit$$</code> Symbol<a href="#top"></a></h5> <p><mark> i &rarr;</mark></p> + <aside>OPCODE: <code>4d</code></aside> <p>Exits the program with the exit code <code>i</code>.</p> <h5 id="exec-symbol"><code>$:exec$$</code> Symbol<a href="#top"></a></h5> <p><mark> s &rarr; i</mark></p> + <aside>OPCODE: <code>4e</code></aside> <p>Executes the string <code>s</code> as a shell command, and pushes the command return code on the stack.</p> <h5 id="run-symbol"><code>$:run$$</code> Symbol<a href="#top"></a></h5> <p><mark> s &rarr; q</mark></p> + <aside>OPCODE: <code>4f</code></aside> <p>Executes the string <code>s</code> as a shell command, capturing its output and errors. It pushes a quotation on the stack containing the following items: