all repos — hex @ e2d0cd28b135657af2a436e643f9b09b114fcd2c

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

Improved stack trace.
h3rald h3rald@h3rald.com
Fri, 20 Dec 2024 08:18:30 +0100
commit

e2d0cd28b135657af2a436e643f9b09b114fcd2c

parent

565880095ec78d7659fa3b0f14cafbdd55225d39

3 files changed, 4 insertions(+), 2 deletions(-)

jump to
M CHANGELOG.mdCHANGELOG.md

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

-<article> <h2>Changelog</h2> <h3>v0.2.0 &mdash; <em>Under development</em></h3> <h4>New Features</h4> <ul> <li>Implemented a virtual machine with a bytecode compiler and interpreter.</li> <li>{{sym-read}}, {{sym-write}}, {{sym-append}} now support reading and writing from/to binary files as well.</li> <li>{{sym-!}} can now evaluate a quotation of integers as hex bytecode.</li> <li>Increased maximum stack size to 256 items.</li> </ul> <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> </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>v0.1.0 &mdash; 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> <h3>v0.2.0 &mdash; <em>Under development</em></h3> <h4>New Features</h4> <ul> <li>Implemented a virtual machine with a bytecode compiler and interpreter.</li> <li>{{sym-read}}, {{sym-write}}, {{sym-append}} now support reading and writing from/to binary files as well.</li> <li>{{sym-!}} can now evaluate a quotation of integers as hex bytecode.</li> <li>Increased maximum stack size to 256 items.</li> </ul> <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> </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>v0.1.0 &mdash; 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 releases/0.2.0.htmlreleases/0.2.0.html

@@ -12,6 +12,7 @@ <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> </ul> <h4>Chores</h4>
M src/stack.csrc/stack.c

@@ -32,6 +32,7 @@ {

hex_item_t value; if (hex_get_symbol(ctx, item.token->value, &value)) { + add_to_stack_trace(ctx, item.token); result = HEX_PUSH(ctx, value); } else

@@ -43,6 +44,7 @@ }

} else if (item.type == HEX_TYPE_NATIVE_SYMBOL) { + add_to_stack_trace(ctx, item.token); hex_debug_item(ctx, "CALL", item); result = item.data.fn_value(ctx); }

@@ -104,7 +106,6 @@ }

int hex_push_symbol(hex_context_t *ctx, hex_token_t *token) { - add_to_stack_trace(ctx, token); hex_item_t value; if (hex_get_symbol(ctx, token->value, &value)) {