all repos — hex @ dbfd0eb44b964ceea477ec29655a1f7b7362d7e8

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

web/contents/about.html

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
<article>
    <h2>About</h2>
    <p>The core idea behind <strong>hex</strong> is to be a really small language for experimenting with the <a
            href="https://concatenative.org" target="_blank">concatenative</a> programming paradigm and at the same time
        being somewhat useful for practical things like creating short scripts or be used as glue code for automating
        common tasks.</p>
    <h3>How hex was born</h3>
    <p>When I first implemented <a href="https://min-lang.org" target="_blank">min</a>, the intent was to create a
        minimal language, hence the name. The reality however turned out to be very different: in no time, I found
        myself adding a lot of syntactic sugar, complex data types, support for XML processing and HTTP client and
        server... it became more of a batteries-included language with a somewhat spartan syntax than anything else.
    </p>
    <p>The second attempt was to essentially fork part of the min codebase and create <a href="https://h3rald.com/mn"
            target="_blank">mn</a>, which was a lot more limited, but still not minimal <em>enough</em>. The one thing
        that was bothering me the most was, in the end, the fact that it was implemented in Nim. Not that Nim is a bad
        language (quite the opposite!), but I really wanted to keep things simple, and implement something in C.</p>
    <p>And that&#39;s how <strong>hex</strong> was born! Actually... I started off asking ChatGPT to implement a
        tokenizer for a small stack-based language able to process integers, then an interpreter, then I asked for
        string support, and then... well, the boilerplate wasn&#39;t too bad. A few tweaks here and there and I was able
        to improve a few things, and in a few days I realized that I had re-learnt some C programming skills I
        hadn&#39;t been using in the past 20 years!</p>
    <p>So there you have it. A language that is purely concatenative, truly minimalist and yet powerful enough, limited
        to 64 native symbols and yet manages to be somewhat useful, hopefully. The fact that I could get it to compile
        to
        WASM with just a few hours worth of extra work (mainly to manage stdin properly) also meant that this little
        thing also has its own browser-based <a href="/play">playground</a>!</p>
    <p>The only annoying thing is that it only understands hexadecimal integers. Well... I figured I could take a little
        <em>poetic license</em>, and introduce a small quirk that would justify its nice, almost magical, three letter
        name!
    </p>
    <h3>About the logo</h3>
    <p>
        The hex logo is a small ASCII art representing a horizontal stack of three hexagons, each one representing a
        stack element.
    <pre><code>      _*_ _
     / \hex\* 
    *\_/_/_/ 
         *</code></pre>It also features four <em>stars</em>, representing
    the the 64 native symbols provided by the language (four times 16, so <code>0x40</code> in hexadecimal format).
    They also hint at the magic of the language itself, and the dual meaning of the word <em>hex</em> (as in
    <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"
            target="_blank">static-site generator</a> implemented in hex itself.
    </p>
</article>