Sujet : Re: Build Forth interpreter into a C/C++ application
De : the.beez.speaks (at) *nospam* gmail.com (Hans Bezemer)
Groupes : comp.lang.forthDate : 16. Feb 2025, 19:06:12
Autres entêtes
Organisation : KPN B.V.
Message-ID : <nnd$65fee9ad$45bf091f@2c86a5de5a7f3599>
References : 1 2 3
User-Agent : Mozilla Thunderbird
On 12-02-2025 03:06, Buzz McCool wrote:
Your second idea is along the lines of the Gforth/ATLAST concept where Forth is a scripting language for a C/C++ application. I have another Linux based embedded system that has some pieces that are always changing. Maybe a Forth task inside a C/C++ program that would pick up changeable scripts from the SD Card would be better than constantly recompiling my C/C++ application and re-flashing main memory.
That was the original idea of 4tH - a scripting language for a C application. As a matter of fact, the different 4tH incarnations were originally meant as "example programs" for the library.
Nowadays, everybody thinks it's "the 4tH compiler". Wrong.. Although in a sense it became somewhat true..
Every 4tH incarnation is a testament to the original idea, since every single one of them contains embedded 4tH:
4th - the block editor;
4tsh - the command line;
pp4th - the entire preprocessor.
The program in question is saved as a compressed applet. When invoked, it creates a sandbox - according to the applet's specifications - and executes the applet. When it quits, it discards the entire sandbox.
You can also compile and execute an external script (as long as you link in the compiler as well, of course).
Hans Bezemer