Project Updates

Tuesday, November 9, 2010

Providing Tengoku as a DLL

Today I considered that to make Tengoku accessible from any language, practically all you need is the system compiled as a dynamic library, and this API of 4 whopping functions. I think.

  • ten_evaluate ( string ) : string
  • ten_push ( int ) : void
  • ten_pop () : int
  • ten_wrap ( function ) : int
And maybe double and triple variants for ten_push and ten_pop.

Ten_wrap would take a native function and make it something that Tengoku can execute, since it makes extensive use of callbacks. 

Ten_evaluate would take a simple string containing Forth "script", likely usually just a single function name, and return a string of whatever was output to the console.  Since it would be against SwiftForth's commercial license, all code compilation words would be inaccessible; and you could only access game engine words.  (So, all logic would be in your native language, which would be the point of it anyway.)

On second thought, that probably isn't it.  You also need multitasking and messages, which right now are intrinsic to Plexi and Walnut, respectively.  And a more efficient way of getting the address of objects and then their properties, else it would just be too slow to be more than a demo.

Maybe there can be a way of automatically go through and generate the DLL and headers using the stack comments. 

No comments:

Post a Comment