Computer Science Canada

External

Author:  chrisbrown [ Tue Dec 30, 2008 1:08 am ]
Post subject:  External

If anyone knows, how would I incorporate a routine written in C into a Turing program? I know I need the "external" keyword, but do I need a dll extension or what?

Author:  Tony [ Tue Dec 30, 2008 2:30 am ]
Post subject:  RE:External

According to the documentation for external, half of it is not even implemented, and it sounds like it works differently for "run" and "stand-alone" versions of the code.
Quote:
the linkage would be by means of a standard, operating system-specific linkage editor.

It sounds like if you can get your OS to link a compiled library to your binary (by means outside of Turing?), Turing could actually run those routines...

Though really, I haven't seen this done. Would be interesting if anyone could point to a working example though.

Author:  chrisbrown [ Tue Dec 30, 2008 1:12 pm ]
Post subject:  RE:External

Quote:

Would be interesting if anyone could point to a working example


Take a look in Turing\Support\Predefs. Most (all?) of the .tu's make use of the external keyword, but I can't figure out how or what it's linked to.

Author:  Tony [ Tue Dec 30, 2008 3:57 pm ]
Post subject:  RE:External

From what I remember, all that use of external does is redefines the keyword used to call code that is already available to the Turing environment.


: