Testing web script.
h3rald h3rald@h3rald.com
Mon, 30 Dec 2024 10:47:23 +0000
3 files changed,
93 insertions(+),
26 deletions(-)
M
.gitignore
→
.gitignore
@@ -59,6 +59,7 @@ *.hbx
src/hex.c example.hex web/out/ +web/out2/ web/assets/hex.js web/assets/hex.wasm *.com.dbg
M
CHANGELOG.md
→
CHANGELOG.md
@@ -1,6 +1,71 @@
-<article> <h2>Changelog</h2> <ul> -<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.3.0">v0.3.0 — 2024-12-25</h3> <h4>Breaking Changes</h4> <ul> <li>Removed the native symbols %:filter%%, %:clear%%, and %:each%%.</li> <li>Bytecode: some opcodes changed values; programs compiled with tbe previous version must be recompiled.</li> </ul> <h4>New Features</h4> <ul> <li>Added symbol <a href="https://hex.2c.fyi/spec#operator-symbol">::</a> to define operators (immediately-dequoted quotations).</li> <li>Added symbol <a href="https://hex.2c.fyi/spec#symbols-symbol">symbols</a> to get a list of all stored symbols</li> <li>Added symbol <a href="https://hex.2c.fyi/spec#throw-symbol">throw</a> to throw an error.</li> <li>Increased the size of the STDIN buffer to 16Kb.</li> </ul> <h4>Fixes</h4> <ul> <li><a href="https://hex.2c.fyi/spec#lessthanequal-symbol"><=</a> now returns correct results.</li> </ul> <h4>Chores</h4> <ul> <li>Updated Vim syntax highlighting (%:hex.vim%%).</li> </ul> <h3 id="v0.2.0">v0.2.0 — 2024-12-20</h3> <h4>New Features</h4> <ul> <li>Implemented a virtual machine with a bytecode compiler and interpreter.</li> <li><a href="https://hex.2c.fyi/spec#read-symbol">read</a>, <a href="https://hex.2c.fyi/spec#write-symbol">write</a>, <a href="https://hex.2c.fyi/spec#append-symbol">append</a> now support reading and writing from/to binary files as well.</li> <li><a href="https://hex.2c.fyi/spec#eval-symbol">!</a> can now evaluate a quotation of integers as hex bytecode.</li> <li>Increased maximum stack size to 256 items.</li> <li>Improved and consolidated error messages and debug messages.</li> </ul> <h4>Fixes</h4> <ul> <li>Ensured that <a href="https://hex.2c.fyi/spec#dec-symbol">dec</a> 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> </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 concatenate them together before compiling</li> </ul> <h3 id="v0.1.0">v0.1.0 — 2024-12-14</h3> <p>Initial release, featuring:</p> <ul> <li>A multi-platform executable for the <em>hex</em> interpreter.</li> <li>Integrated REPL.</li> <li>Integrated help and manual.</li> <li>Debug mode.</li> <li>0x40 (64) native symbols.</li> <li>Support for 32bit hexadecimal integers, strings, and quotations (lists).</li> <li>A complete <a href="https://hex.2c.fyi">web site</a> with more documentation and even an interactive playground. </li> </ul> </article> +<article> + <h2>Changelog</h2> + <ul> +<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.3.0">v0.3.0 — 2024-12-25</h3> + +<h4>Breaking Changes</h4> +<ul> + <li>Removed the native symbols %:filter%%, %:clear%%, and %:each%%.</li> + <li>Bytecode: some opcodes changed values; programs compiled with tbe previous version must be recompiled.</li> +</ul> + +<h4>New Features</h4> +<ul> + <li>Added symbol <a href="https://hex.2c.fyi/spec#operator-symbol">::</a> to define operators (immediately-dequoted quotations).</li> + <li>Added symbol <a href="https://hex.2c.fyi/spec#symbols-symbol">symbols</a> to get a list of all stored symbols</li> + <li>Added symbol <a href="https://hex.2c.fyi/spec#throw-symbol">throw</a> to throw an error.</li> + <li>Increased the size of the STDIN buffer to 16Kb.</li> +</ul> + +<h4>Fixes</h4> +<ul> + <li><a href="https://hex.2c.fyi/spec#lessthanequal-symbol"><=</a> now returns correct results.</li> +</ul> + +<h4>Chores</h4> +<ul> + <li>Updated Vim syntax highlighting (%:hex.vim%%).</li> +</ul> +<h3 id="v0.2.0">v0.2.0 — 2024-12-20</h3> + +<h4>New Features</h4> +<ul> + <li>Implemented a virtual machine with a bytecode compiler and interpreter.</li> + <li><a href="https://hex.2c.fyi/spec#read-symbol">read</a>, <a href="https://hex.2c.fyi/spec#write-symbol">write</a>, <a href="https://hex.2c.fyi/spec#append-symbol">append</a> now support reading and writing from/to binary files as well.</li> + <li><a href="https://hex.2c.fyi/spec#eval-symbol">!</a> can now evaluate a quotation of integers as hex bytecode.</li> + <li>Increased maximum stack size to 256 items.</li> + <li>Improved and consolidated error messages and debug messages.</li> +</ul> + +<h4>Fixes</h4> +<ul> + <li>Ensured that <a href="https://hex.2c.fyi/spec#dec-symbol">dec</a> 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> +</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 + concatenate them together before compiling</li> +</ul> +<h3 id="v0.1.0">v0.1.0 — 2024-12-14</h3> + +<p>Initial release, featuring:</p> +<ul> + <li>A multi-platform executable for the <em>hex</em> interpreter.</li> + <li>Integrated REPL.</li> + <li>Integrated help and manual.</li> + <li>Debug mode.</li> + <li>0x40 (64) native symbols.</li> + <li>Support for 32bit hexadecimal integers, strings, and quotations (lists).</li> + <li>A complete <a href="https://hex.2c.fyi">web site</a> with more documentation and even an interactive playground. + </li> +</ul> + +</article>
M
scripts/web.hex
→
scripts/web.hex
@@ -4,7 +4,7 @@ "0.3.0" "meta-release" :
"web/assets" "d-assets" : "web/templates" "d-templates" : "web/contents" "d-contents" : -"web/out" "d-out" : +"web/out2" "d-out" : "releases" "d-releases" : ; Get all files from a directory@@ -69,10 +69,10 @@ while
; Push highlighted text on the stack t-text ; Free temporary symbols - "t-text" # - "t-count" # - "t-delimiter" # - "t-replacement" # + ;"t-text" # + ;"t-count" # + ;"t-delimiter" # + ;"t-replacement" # ) "highlight" :: ; Convenience symbol for debugging@@ -92,9 +92,9 @@ (pt-content pt-tag tag index 0x0 >)
(pt-content pt-tag tag pt-repl replace "pt-content" :) while pt-content - "pt-repl" # - "pt-tag" # - "pt-content" # + ;"pt-repl" # + ;"pt-tag" # + ;"pt-content" # ) "process-tag" ::@@ -122,10 +122,10 @@ "sym-" t-symbol cat
t-repl process-tag ; Free temporary symbols - "t-repl" # - "t-symtag" # - "t-href" # - "t-symbol" # + ;"t-repl" # + ;"t-symtag" # + ;"t-href" # + ;"t-symbol" # ) "process-symbol" :: ; Load releases content for changelog@@ -141,8 +141,8 @@ d-releases "/" id-release cat cat read releases-content swap cat "releases-content" :
_releases_count 0x1 - "_releases_count" : ) while - "_releases_count" # - "id-release" # + ;"_releases_count" # + ;"id-release" # ) "process-releases" :: ; Create changelog toc@@ -165,8 +165,8 @@ changelog-toc
"</ul>\n" cat cat "changelog-toc" : - "_gct_count" # - "id-release" # + ;"_gct_count" # + ;"id-release" # ) "generate-changelog-toc" ::@@ -191,7 +191,7 @@ changelog-content symbol-links _c get process-symbol "changelog-content" :
_c 0x1 + "_c" : ) while -"_c" # +;"_c" # ; Write CHANGELOG.md changelog-content@@ -223,7 +223,7 @@ new-content symbol-links _i get process-symbol "new-content" :
_i 0x1 + "_i" : ) while - "_i" # + ;"_i" # ; Highlight syntax new-content highlight "new-content" : (fn-content "home.html" ==)@@ -233,6 +233,7 @@ d-out "/index.html" cat "dst-file" :
) ( (d-out id-content "index.html") () map "/" join "dst-file" : + ("sh -c \"mkdir -p " d-out "/" id-content "\"") () map "" join exec ) if " - Writing: " dst-file cat puts@@ -240,7 +241,7 @@ new-content dst-file write
_c 0x1 + "_c" : ) while -"_c" # +;"_c" # ; Write assets@@ -259,7 +260,7 @@ ("cp" src-file dst-file) () map " " join exec
_c 0x1 + "_c" : ) while -"_c" # +;"_c" # "*** Done!" puts