Like how would I find the entry point in memory, and then capture the returned values. Or for instance, how would I determine the input variables locations that the compiled C code is expecting as inputs, albeit special registers or the stack?

This is an abstract conceptual question with no actual goal or project application at the moment. It would be nice to utilize Arduino libraries in FORTH by writing a function and then encapsulating the compiled binary in a FORTH Dictionary Word definition.

Obviously measures must be taken to preserve the FORTH interpreter’s pointers, stacks, and special registers. Is this ever worth the effort as opposed to sucking it up and rewriting the whole thing from scratch, delving into all the underlying mess of peripheral hardware documentation, or is there some typical way to streamline?

As a further aside, does one ever do this within a Unix like system? Like let’s say I want to only use a single python method present in llama.cpp in the source that has been compiled and cached in another directory. I want to call this method from inside a function written in my .bashrc file. I have called Python executables from bash functions many times, but never some random subroutine.

  • 𞋴𝛂𝛋𝛆@lemmy.worldOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    At one point a few years ago, I was following a UC Berkeley CS open course online. Nothing official, just following the lectures and posted stuff. I think it was getting into this subject with a custom version of the schema language. I stopped following along because I could not get a copy of the specific schema version and everything I tried was incompatible with what was taught in the course. Is that a better glue language for stuff like this on an operating system level?