J, an array language, is my main language and find it excellent for 95% of what I do, mainly data analysis working directly from the REPL.
Forth looks great for my remaining 5%, such as:
- domain specific sublanguages,
- on the fly compilation of complex calculation logic that has to run through millions of loops,
- higher level bindings to systems that require repeated DLL calls using small (i.e. non array) objects
- (plus a possible smack of hardware tinkering with data loggers).
I never got round to doing all this in C because on Linux I just find a quick and dirty workaround with shell scripts, whilst on Windows, I wouldn't touch a C compiler with a snake hook.
Ideally, I would like to have both a J and a Forth interactive session open simultaneously, which communicate together, as both languages have the same type of interactive development. I will try and do this with a thread on each side communicating through a websocket. However, this would eventually require sending big arrays back and Forth; if on the other hand I use shared libraries (one way or the other, but more likely J calling Forth), I will be loosing lots of interactivity.
The J FFI can allocate a chunk of memory (full forth system?) and directly call a memory address if needed, as well as provide pointers to the data areas of arrays: maybe this is the way to go in the long run?
So I was wondering, can VfXForth be loaded into the address space of another interpreter to combine the benefits of interactive development without any overheads?
(the use case would probably be for semi-tested code, to reduce the frequency of crashes...)