<feed xmlns='http://www.w3.org/2005/Atom'>
<title>tinywasm/crates/parser, branch bota-tortuise</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.</subtitle>
<id>http://botahamec.dev/cgit/tinywasm/atom/crates/parser?h=bota-tortuise</id>
<link rel='self' href='http://botahamec.dev/cgit/tinywasm/atom/crates/parser?h=bota-tortuise'/>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/'/>
<updated>2026-10-31T15:26:16Z</updated>
<entry>
<title>Fix match</title>
<updated>2026-10-31T15:26:16Z</updated>
<author>
<name>Mica White</name>
<email>botahamec@outlook.com</email>
</author>
<published>2026-10-31T15:26:16Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=ce42e619e1c64eaefeb382a4ef439a2bbc9ebc65'/>
<id>urn:sha1:ce42e619e1c64eaefeb382a4ef439a2bbc9ebc65</id>
<content type='text'>
</content>
</entry>
<entry>
<title>chore: v0.11.0</title>
<updated>2026-09-19T20:40:25Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-09-19T20:37:35Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=fa7b34fb0ad7fe8afa7e78af712a40c209923eb2'/>
<id>urn:sha1:fa7b34fb0ad7fe8afa7e78af712a40c209923eb2</id>
<content type='text'>
Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
<entry>
<title>fix: harden instantiation, stream parsing, and host reentrancy</title>
<updated>2026-09-16T10:06:46Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-09-16T10:06:46Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=6a7a6af9e25d0daa49bb142c85a298c5c81e76a4'/>
<id>urn:sha1:6a7a6af9e25d0daa49bb142c85a298c5c81e76a4</id>
<content type='text'>
Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
<entry>
<title>feat: initial wasi p1 implementation</title>
<updated>2026-09-15T13:27:00Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-09-15T13:23:11Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=dc8e5732d71b6f66e730b090ab02bdccc69ec888'/>
<id>urn:sha1:dc8e5732d71b6f66e730b090ab02bdccc69ec888</id>
<content type='text'>
Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
<entry>
<title>feat: replace parser optimizer with streaming selection</title>
<updated>2026-09-14T08:48:16Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-09-14T08:48:16Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=795ec871806ea189818bbf2fd2a69455384d2004'/>
<id>urn:sha1:795ec871806ea189818bbf2fd2a69455384d2004</id>
<content type='text'>
Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
<entry>
<title>chore: update deps, remove inline from dispatch handlers (closes #55)</title>
<updated>2026-09-13T15:45:53Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-09-13T15:45:53Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=ded2780129ef8c58edfc1af51ea23be2524a15b1'/>
<id>urn:sha1:ded2780129ef8c58edfc1af51ea23be2524a15b1</id>
<content type='text'>
Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
<entry>
<title>fix(parser): do not fuse local.get/local.tee across a branch target (#56)</title>
<updated>2026-09-10T13:37:04Z</updated>
<author>
<name>Steve Fan</name>
<email>29133953+stevefan1999-personal@users.noreply.github.com</email>
</author>
<published>2026-09-10T13:37:04Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=0263bf19ecb2d58336c58a6146c46e6fe84f38f3'/>
<id>urn:sha1:0263bf19ecb2d58336c58a6146c46e6fe84f38f3</id>
<content type='text'>
I was trying to compile TCC to WASI and run it using tinywasm thanks to
the exception implementation (sigh, which is because of the use of
setjmp/longjmp for compiler rewind, that's the whole reason, WASI
syscall is really not that hard to say the least), but it went into a
mysterious bug that keeps trapping on the same address.

And yes, that means I did have a WASIp1 implementaion and I actually
implemented it with a VFS (nix the network socket just yet), so I can
theoretically have a cross-platform JIT compiler where I can have safe
reentrancy, and it is not until recently the TCC mob branches have their
TLS implementations, but it is all too late and they still rely on CRT.
It is also theoretically possible.

So my plan is to compile libtcc as small as possible to WASI using fat
LTO, and I keep getting trapped on the same address. Under NodeJS with a
shim WASI implementation, the whole libtcc fat LTO WASI actually works.
So it has to be a problem in tinywasm

Claude said this (it is Fable 5.1 btw):

&gt; `visit_local_tee` peeked at the last emitted instruction and, when it
was a `local.get`, replaced the pair with `LocalCopy(src, dst);
LocalGet(dst)`. It never checked whether the tee's position is a jump
target. When the `local.get` is a block's fallthrough result and the
`local.tee` is the first instruction after `end`, every branch to that
label lands on `LocalGet(dst)` instead of the tee: the branch's value is
left dangling on the stack and a stale local is pushed on top. Loop
starts and if/else joins have the same shape.
&gt; 
&gt; TinyCC compiled with clang -Os/-Oz hit this in musl's realloc: the `if
(!p) { r = malloc(n); br 1 }` path returned n instead of r, so the
caller wrote into address 1200 and later trapped with an out-of-bounds
load, while V8 and wabt ran the same module correctly.
&gt; 
&gt; The lowering step now always emits a plain `LocalTee`. The fusion
moves into the peephole rewriter, which only matches within a basic
block and so cannot cross a label. Regression test covers the block-end,
if/else-join and loop-start cases.
&gt; 

I will try to use https://www.npmjs.com/package/@yowasp/clang to see if
there are more VM shenanigans, though a simple benchmark shows me that
the interpreter is 17x slower than native, and I guess the clang in
tinywasm wouldn't take less than 3 minutes to get a meaningful outcome
-- except if it blows up midway during execution.</content>
</entry>
<entry>
<title>feat: add nightly tail-call interpreter dispatch</title>
<updated>2026-08-29T20:20:06Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-08-29T20:20:03Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=c67ce64bfc88eada4d2b611e30b2dd307a7f7526'/>
<id>urn:sha1:c67ce64bfc88eada4d2b611e30b2dd307a7f7526</id>
<content type='text'>
Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
<entry>
<title>chore: improve optimizer and simplify function execution</title>
<updated>2026-08-29T12:34:58Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-08-29T12:34:58Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=bb17468c990ba2ef819e5d3349539bb7a4aaedbd'/>
<id>urn:sha1:bb17468c990ba2ef819e5d3349539bb7a4aaedbd</id>
<content type='text'>
- add stack-constant and fused local-update rewrites
- split host and Wasm function storage and execution paths
- add the default full feature
- recursively discover WAST test files

Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
<entry>
<title>chore: simplify operands, extract more exec_ methods</title>
<updated>2026-08-27T14:06:57Z</updated>
<author>
<name>Henry</name>
<email>mail@henrygressmann.de</email>
</author>
<published>2026-08-27T14:06:57Z</published>
<link rel='alternate' type='text/html' href='http://botahamec.dev/cgit/tinywasm/commit/?id=843e0ff5601479239791f452bec9865df779839b'/>
<id>urn:sha1:843e0ff5601479239791f452bec9865df779839b</id>
<content type='text'>
Signed-off-by: Henry &lt;mail@henrygressmann.de&gt;
</content>
</entry>
</feed>
