gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Embedding wishlist


From: Ulf Herrman
Subject: Embedding wishlist
Date: Mon, 06 Feb 2023 19:09:49 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

I'm considering embedding gforth in a C program that uses an event
loop. I need to be able to suspend the current forth task and return to
C. I *think* the right primitive for this is (bye), unless I'm
mistaken. But once it's been suspended, I'd like to be able to resume
it. This could be done by having a forth wrapper word around (bye) which
will push the succeeding ip onto the return stack, and then executing
EXIT when it's time to resume. But I'd like it if I could resume
directly from what invoked (bye). I see that there's a saved_ip, but is
it current after returning from gforth_engine? I don't see a place where
it would be kept up to date... would (bye) have to be modified to store
it?

Also, it would be nice if gforth could be initialized without having to
install signal handlers.

It would also be nice if gforth_stacks could be instructed to leave out
the guard pages and page-alignment requirements. This would allow for
tasks that are known to only require small stacks to be very compact. At
present this isn't even configurable at compile-time: totalsize is
always at least 10 pages large.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]