Open dcnorris opened 3 months ago
Thanks for the heads up. I don't think anyone has raised this issue before.
If you have Conklin & Rather's Forth Programmer's Handbook 3ed., §7.5 'Interactive Programming' is extremely interesting vis-à-vis your SLIME concept. (Ch. 7 is about Forth Cross compilers, where a microcontroller target is programmed by a PC host.) Here's an excerpt:
The head of compiled definitions are retained in the host, along with an image of the target's
CDATA
andIDATA
. Thus, the host can "know" at all times what the target's code and initialized data space contains.
This white paper is publicly available, in case you don't have Conklin & Rather.
It has occurred to me that your SLIME concept might best come into its own in supporting precisely this kind of interaction with a microcontroller Forth. I am working on the PIC24 platform, for which FF implements only a limited assembler and SEE. The Forth, Inc. perspective of course imagines the host to be a Forth system as well (what other programming languages exist?) but there's no reason it can't be Emacs.
To interact with FlashForth running in a
serial-term
, I've modifiedforth-interaction-send-raw-result
as below. Basic things work nicely, such as sourcing regions viaC-c C-r
, for which I had formerly depended onisend-mode
. As I smooth out the rough edges in this, I will aim to work toward submitting a PR.It seems to me that supporting interaction with a
term
would be entirely in-scope for a SLIME-for-Forth, but may present some [useful!] challenges to assumptions that may have been made inforth-mode
that a resident Forth was running. So I wanted to start a conversation on that point.Has anyone else pursued this kind of effort to use
forth-mode
with a microcontroller Forth?I've also got a mode hook set up like this, establishing in particular the
forth-interaction-buffer
: