Author |
Message |
trishume
|
Posted: Mon Oct 10, 2011 5:29 pm Post subject: Does anyone know of how to link code with external? |
|
|
I have noticed the existence of the "external" keyword. It is minimally documented and it is used in the definition files.
Supposedly it can be used to link Turing code to other compiled code.
For example, here is a line from the Dir.tu file in the predefs folder
Turing: |
external "dir_change" procedure Change (dirpath : string)
|
It would be interesting to be able to link external code written in other languages into Turing. OpenGL anyone?
Possibly the only person who knows is Dr. Holt. Anyone who goes to UWaterloo met him or could ask him? Tony? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
Posted: Mon Oct 10, 2011 6:21 pm Post subject: RE:Does anyone know of how to link code with external? |
|
|
I've had an occasion of seeing Dr. Holt here on campus, but didn't get a chance to talk about Turing.
You could try decompiling the binary that defines dir_change to figure things out. It most likely just jumps the instruction register into library space. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
mirhagk
|
Posted: Mon Oct 10, 2011 10:09 pm Post subject: RE:Does anyone know of how to link code with external? |
|
|
It might even just flag the compiler to the fact that it's a built in instruction, and is not defined by the user, allowing you to call it in turing, but without some of the earlier pieces of the compiler complaining. just my guess though.
One thing it does is makes it really easy to implement the standard library, since many functions all use the same external thing, meaning you don't have to keep track of 3 of 4 different functions in the compiler, makes anyone who wants to implement turing lives easier. |
|
|
|
|
|
trishume
|
Posted: Thu Oct 13, 2011 7:08 am Post subject: Re: Does anyone know of how to link code with external? |
|
|
I have decompiled the turing source code and it does just jump into a library space. Which means that it would be difficult to write code that adds new library functions. |
|
|
|
|
|
mirhagk
|
Posted: Thu Oct 13, 2011 1:55 pm Post subject: RE:Does anyone know of how to link code with external? |
|
|
oh, well poor forethought FTW! Oh and on a related note, has anyone heard of coot? Apparently it's Turing for Linux, but I've never heard of it. |
|
|
|
|
|
trishume
|
Posted: Thu Oct 13, 2011 3:21 pm Post subject: Re: Does anyone know of how to link code with external? |
|
|
Yes. Dr. Holt told me about it when I emailed him. I am actually trying to get the COOT source from Tom West (current owner of the Turing source code) so I can port it to windows and add openGL graphics. |
|
|
|
|
|
mirhagk
|
Posted: Thu Oct 13, 2011 3:31 pm Post subject: RE:Does anyone know of how to link code with external? |
|
|
Oh okay lol, make sure you post the source here if you can, I'd love to check it out. |
|
|
|
|
|
trishume
|
Posted: Thu Oct 13, 2011 5:03 pm Post subject: Re: Does anyone know of how to link code with external? |
|
|
If he ever sends it to me I will ask if I can open-source it.
If I can I'll make a github organization for it's maintenance and hosting. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Nick
|
Posted: Fri Oct 14, 2011 7:34 am Post subject: RE:Does anyone know of how to link code with external? |
|
|
I highly doubt you'll get that source, Dan and Tony have been denied the Turing source code when they personally asked Dr. Holt. |
|
|
|
|
|
trishume
|
Posted: Fri Oct 14, 2011 8:01 am Post subject: Re: Does anyone know of how to link code with external? |
|
|
That's because Dr. Holt does not have the Turing source. I asked him and he referred me to a person named Tom West who has the source. I emailed Tom West and he said he would be happy to give it to me. However I believe that he is having trouble finding the source code in his old files. That or he has forgotten about me, I will remind him on Tuesday.
It also might help that my grandfather (the Hume in the Holt and Hume programming books) is a personal friend of Dr. Holt and Tom West.
Some information I have gleaned from Dr. Holt and Tom:
The OOT interpreter is written in Turing Plus compiled to C with C code linked in. The original Turing Plus source code has been lost. Meaning the code is mostly compiler generated (read ugly and confusing) so it will take some work to understand it. The COOT compiler is written in COOT and compiles to C, it works on linux but was not ported to windows before HoltSoft's collapse. |
|
|
|
|
|
|