Update changelog and release notes for version 0.5.0; include breaking changes, fixes, and chores
h3rald h3rald@h3rald.com
Tue, 08 Apr 2025 14:36:41 +0200
6 files changed,
50 insertions(+),
12 deletions(-)
M
CHANGELOG.md
→
CHANGELOG.md
@@ -1,11 +1,30 @@
<article> <h2>Changelog</h2> <ul> +<li><a href="#v0.5.0">v0.5.0</a></li> <li><a href="#v0.4.1">v0.4.1</a></li> <li><a href="#v0.4.0">v0.4.0</a></li> <li><a href="#v0.3.0">v0.3.0</a></li> <li><a href="#v0.2.0">v0.2.0</a></li> <li><a href="#v0.1.0">v0.1.0</a></li> +</ul> +<h3 id="v0.5.0">v0.5.0 — 2025-04-08</h3> + +<h4>Breaking Changes</h4> +<ul> + <li>Renamed %:pop%% to <a href="https://hex.2c.fyi/spec#drop-symbol">drop</a>.</li> + <li>Renamed %:replace%% to <a href="https://hex.2c.fyi/spec#sub-symbol">sub</a>.</li> +</ul> + +<h4>Fixes</h4> +<ul> + <li>Fixed some documentation typos and inaccuracies.</li> + <li>Fixed incorrect bytecode processing for quotations with more than 127 items</li> +</ul> + +<h4>Chores</h4> +<ul> + <li>Added more tests.</li> </ul> <h3 id="v0.4.1">v0.4.1 — 2025-01-07</h3>
A
releases/0.5.0.html
@@ -0,0 +1,18 @@
+<h3 id="v0.5.0">v0.5.0 — 2025-04-08</h3> + +<h4>Breaking Changes</h4> +<ul> + <li>Renamed %:pop%% to {{sym-drop}}.</li> + <li>Renamed %:replace%% to {{sym-sub}}.</li> +</ul> + +<h4>Fixes</h4> +<ul> + <li>Fixed some documentation typos and inaccuracies.</li> + <li>Fixed incorrect bytecode processing for quotations with more than 127 items</li> +</ul> + +<h4>Chores</h4> +<ul> + <li>Added more tests.</li> +</ul>
M
scripts/test.hex
→
scripts/test.hex
@@ -14,10 +14,10 @@
; --- Utilities ( - "current-test" : + "_test_current" : TEST-COUNT 0x1 + "TEST-COUNT" : ( - (current-test .) + (_test_current .) ( "." print SUCCESSES 0x1 + "SUCCESSES" :@@ -37,6 +37,7 @@ FAILURES 0x1 + "FAILURES" :
FAILS TEST-COUNT dec ' cat "FAILS" : ) try + "_test_current" # ) "test" :: ; --- Test Definitions
M
scripts/web.hex
→
scripts/web.hex
@@ -3,7 +3,7 @@
"./lib/utils.hbx" read "utils.hbx" ! "2025" "meta-year" : -"0.4.1" "meta-release" : +"0.5.0" "meta-release" : "web/assets" "d-assets" : "web/templates" "d-templates" : "web/contents" "d-contents" :@@ -21,7 +21,7 @@ d-templates "/page.html" cat "t-page" :
; Symbols to substitute with the corresponding links ("map" "debug" "split" "run" "get" "puts" ":" "::" "." "#" "==" "'" -"swap" "dup" "while" "+" "*" "-" "each" "cat" "throw" +"swap" "dup" "while" "+" "*" "-" "each" "cat" "throw" "drop" "sub" "symbols" "print" "read" "dec" "write" "append" "!" "<=" "if") "symbol-links" :
M
web/contents/spec.html
→
web/contents/spec.html
@@ -251,12 +251,11 @@ symbols</a> provided natively. However, native symbols <em>cannot</em> be freed.</p>
<h3 id="stack">Stack<a href="#top"></a></h3> <p>The stack is a fundamental data structure in hex that holds values and controls the flow of execution. hex is a stack-based language, meaning that all operations are performed on a stack of values. The order according to - which items are added (pushed) to or removed (popped) from the stack is <abbr - title="Last In, First Out">LIFO</abbr>.</p> + which items are added to or removed from the stack is <abbr title="Last In, First Out">LIFO</abbr>.</p> <p>In the canonical implementation, the hex stack can contain up to 256 items. If you try to push more items on the stack, a stack overflow error will be raised and the program will terminate. While this may seem a relatively low number, it is important to note that typically there will not be more than 5-10 items on the stack at any - time, because typically symbols are used to frequently pop them out of the stack.</p> + time, because typically symbols are used to frequently drop them from the stack.</p> <h4 id="pushing-literals">Pushing Literals<a href="#top"></a></h4> <p>Literals are values that are directly pushed onto the stack. In hex, literals can be integers, strings, or quotations. When a literal is encountered in a hex program, it is pushed onto the stack for further processing.@@ -273,7 +272,7 @@ <h4 id="pushing-symbols">Pushing Symbols<a href="#top"></a></h4>
<p>Symbols in hex are used to represent native or user-defined functions and values. When a symbol is encountered in a hex program, it is looked up in the registry, and its associated value or function is pushed onto the stack. </p> - <p>Native symbols can perform manipulations on the stack; they can pop values from the stack and push values back + <p>Native symbols can perform manipulations on the stack; they can drop values from the stack and add values back in.</p> <p>In the canonical implementation, native symbols are implemented as native C functions that are executed whenever the corresponding native symbol is pushed on the stack.</p>@@ -298,7 +297,8 @@ <p>You can achieve this using the {{sym-::}} symbol, and the previous example can be rewritten as follows:</p>
<pre><code> ($:dup$$ $:*$$ $:*$$) $"square"$$ $:::$$ $0x3$$ $:square$$ $:puts$$ $; prints 9$$</code></pre> <p>In this case, you no longer need to explicitly dequote $:square$$ using $:.$$, because it has been stored as an - <em>operator</em> and hex knows it has to be immediately dequoted when pushed on the stack.</p> + <em>operator</em> and hex knows it has to be immediately dequoted when pushed on the stack. + </p> <h3 id="registry">Registry<a href="#top"></a></h3> <p>The registry in hex is a simple dictionary that stores symbols and their associated values or functions. The registry is used to look up symbols when they are encountered in a hex program and to store user-defined symbols@@ -531,7 +531,7 @@ </ul>
<p>Additionally, <code>*</code> is used to represent zero or more literals of any type.</p> <p>Consider, for example, the following signature for the {{sym-swap}} symbol:</p> <p><mark> a1 a2 → a2 a1</mark></p> - <p>This signature indicates that the symbol {{sym-swap}} pops two items from the stack (<code>a1</code> and + <p>This signature indicates that the symbol {{sym-swap}} drops two items from the stack (<code>a1</code> and <code>a2</code>), and then pushes them back onto the stack in reverse order (<code>a2</code> and <code>a1</code>). </p>@@ -806,7 +806,7 @@ <aside>OPCODE: <code>42</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> + <h5 id="sub-symbol"><code>$:sub$$</code> Symbol<a href="#top"></a></h5> <p><mark> s1 s2 s3 → s4</mark></p> <aside>OPCODE: <code>43</code></aside> <p>Pushes the string <code>s4</code> obtained by replacing the first occurrence of <code>s2</code> in