all repos — hex @ d935c6f42269dc93ad10ef0b2a907161845ddd4b

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

Rewrote links to point to sourcehut; minor fixes.
h3rald h3rald@h3rald.com
Wed, 24 Jun 2026 22:33:00 +0200
commit

d935c6f42269dc93ad10ef0b2a907161845ddd4b

parent

035530aa1f4cc01f82d4264644828b61fb308fd0

M CHANGELOG.mdCHANGELOG.md

@@ -167,7 +167,7 @@

<h4>Chores</h4> <ul> <li>Split the source code to different files, and now relying on an <a - href="https://github.com/h3rald/hex/blob/master/scripts/amalgamate.sh">amalgamate.sh</a> script to + href="https://git.sr.ht/~h3rald/hex/tree/master/item/scripts/amalgamate.sh">amalgamate.sh</a> script to concatenate them together before compiling</li> </ul> <h3 id="v0.1.0">v0.1.0 &mdash; 2024-12-14</h3>
M releases/0.2.0.htmlreleases/0.2.0.html

@@ -13,12 +13,12 @@ <h4>Fixes</h4>

<ul> <li>Ensured that {{sym-dec}} is able to print negative integers in decimal format.</li> <li>Ensured that symbol identifiers cannot be longer than 256 characters.</li> - <li>Ensured that all symbols are correctly added to the stack trace.</li> + <li>Ensured that all symbols are correctly added to the stack trace.</li> </ul> <h4>Chores</h4> <ul> <li>Split the source code to different files, and now relying on an <a - href="https://github.com/h3rald/hex/blob/master/scripts/amalgamate.sh">amalgamate.sh</a> script to + href="https://git.sr.ht/~h3rald/hex/tree/master/item/scripts/amalgamate.sh">amalgamate.sh</a> script to concatenate them together before compiling</li> </ul>
M web/contents/about.htmlweb/contents/about.html

@@ -46,7 +46,7 @@ <em>hexadecimal</em> and <em>spell</em>).

</p> <h3>About this web site</h3> <p>This web site aims to be very simple and minimalist, like hex itself. It is written in HTML with minimal CSS, and - it is processed using a minimal <a href="https://github.com/h3rald/hex/blob/master/scripts/web.hex" + it is processed using a minimal <a href="https://git.sr.ht/~h3rald/hex/tree/master/item/scripts/web.hex" target="_blank">static-site generator</a> implemented in hex itself. </p> </article>
M web/contents/get.htmlweb/contents/get.html

@@ -4,7 +4,7 @@

<h3>Building from Source</h3> <p>Building hex from source is easy: just run <code>make</code> after <a - href="https://github.com/h3rald/hex">cloning + href="https://git.sr.ht/~h3rald/hex">cloning the repo</a> to build the hex executable for your platform.</p> <p>This assumes that you have a C compiler like GCC and the make command installed. On Windows, you may want to
M web/contents/home.htmlweb/contents/home.html

@@ -21,7 +21,7 @@ <li>Fully <strong>homoiconic</strong> (everything is data).</li>

<li>Implements a simple <strong>virtual machine</strong> with a bytecode compiler and interpreter.</li> <li>Includes a simple <strong>REPL</strong>.</li> <li>Includes an integrated <strong>help system</strong>.</li> - <li>Distributable through <strong>one single, <a href="https://github.com/h3rald/hex/blob/master/src/hex.c" + <li>Distributable through <strong>one single, <a href="https://git.sr.ht/~h3rald/hex/tree/master/item/src/hex.c" target="_blank">amalgamated C file</a></strong>, making it easier to embed in other programs and port to different platforms.</li> </ul>
M web/contents/learn.htmlweb/contents/learn.html

@@ -84,13 +84,13 @@ <p>Fiiiirst we start a hex REPL.</p>

<p>Then, we enter <code>$!5$$</code> and press <code>ENTER</code>. <code>$$5</code> gets <em>pushed on The Stack</em>, like this:</p> <pre><code> +-----------+ - | $5 | + | $5 | +-----------+</code></pre> <p>Then, we enter <code>$!3$$</code> on The Stack. Now there are two items on The Stack, like this:</p> <pre><code> +-----------+ - | $3 | + | $3 | +-----------+ - | $5 | + | $5 | +-----------+</code></pre> <p>Great, and finally, we are going to push the symbol {{sym--}} on the stack, because that's how postfix notation (a.k.a. <a href="https://en.wikipedia.org/wiki/Reverse_Polish_notation">Reverse Polish Notation</a>) works:

@@ -100,14 +100,14 @@ <p>Anyhow, what happens to The Stack now? Waait... wait...</p>

<pre><code> * * - * +-----------+ - | $3 | + | $3 | +-----------+ - | $5 | + | $5 | +-----------+</code></pre> <p>...magic! Real quick, <code>$:-$$</code> takes two items from The Stack, performs the subtraction, aaaand pushes the result back on The Stack, that now looks like this:</p> <pre><code> +-----------+ - | $2 | + | $2 | +-----------+</code></pre> <p>Symbols ain't that bad after all. And yes, The Stack is AWESOME! Did you know that if you use postfix notation you will NEVER ever need to use parenthesis when performing math operations to tweak operator
M web/contents/lib.htmlweb/contents/lib.html

@@ -1,7 +1,7 @@

<article> <h2>Standard Library</h2> <p>hex comes with a standard library providing common functionality implemented in hex itself.</p> - <p>At present, it only comprises <a href="https://github.com/h3rald/hex/blob/master/lib/utils.hex" + <p>At present, it only comprises <a href="https://git.sr.ht/~h3rald/hex/tree/master/item/lib/utils.hex" target="_blank">utils.hex</a>, a collection of common utility symbols, which is distributed in <code>.hbx</code> format along with the hex executable. To pre-load this file, you can start hex like this:</p>