Charles Childers
Administrator
Sr. Member
    
Karma: +2/-0
Offline
Posts: 745
|
Today I finally got around to restarting work on a version of RetroForth for use with C. This is the outgrowth of the retroforth.dll that existed in RetroForth/Windows 7.x.
The new libretro is superior to the old dll since it provides more access to the forth language. When I revive the dll in the near future, this will be helpful since it allows richer integration between the languages. Here's an example:
#include "retro.h"
int main() { init_forth(); spush(100); spush(200); evaluate("2dup . '+ emit space . '= emit space + . cr"); bye(); } My next goal for this is to write a function that allows me to map C functions into RetroForth, allowing the forth side to call C seamlessly. This will be helpful for many of my projects, and hopefully be useful to others as well. The code for this is in the repo and nightly build tree now, so check it out.
|