Computer Science Canada Turing in C++ |
Author: | mirhagk [ Fri Jul 09, 2010 10:11 am ] |
Post subject: | Turing in C++ |
I thought I'd put this in the Turing thread, since it affects Turing users the most. I am currently in the process of making a class for c++ that lets you use all of Turing's functions, and create windows etc. I have some of the drawing commands done, I'll finish the rest of them today, and upload the code tonight. I just wanted to let you guys know, as well as ask some help from experienced c++ coders. I can do almost all of Turings commands, and can even get like offscreenonly working and stuff like that. I'm going to reach a huge roadblock once I get to the Network commands. (I think I can get parrallel ports working easily, depends if I still have my code from computer engineering) I also have no clue how to implement the picture class, so I'll need help with that (and the sprite class) |
Author: | Cezna [ Fri Jul 09, 2010 10:30 am ] |
Post subject: | RE:Turing in C++ |
Are you going to put in any of the stuff that was incomplete when Turing was droped by Holtsoft? Such as the Mouse.Hide (think that was going to be the command line) function? |
Author: | mirhagk [ Fri Jul 09, 2010 11:16 am ] |
Post subject: | RE:Turing in C++ |
It will start off with just the stuff Turing has, and then I/we can advance it from there. The purpose for this is to change Turing code into C++ with relatively easy changes (how variables are declared, change put to put(), and move functions to outside of the main program) It will be an easy process, one that could be automated by a computer if you catch my drift ![]() |
Author: | Tony [ Fri Jul 09, 2010 11:48 am ] |
Post subject: | Re: RE:Turing in C++ |
mirhagk @ Fri Jul 09, 2010 11:16 am wrote: one that could be automated by a computer...
Perhaps by some sort of a compiler program... |
Author: | mirhagk [ Fri Jul 09, 2010 3:51 pm ] |
Post subject: | RE:Turing in C++ |
or better yet, a simpler translator, letting me focus on adding features. edit: sorry I haven't uploaded it yet, I was trying to get the colors to work right first. It draws with RGB right now, I want to use Turing color codes. Speaking of which, can anyone tell me a way to find the RGB values for all the turing colors? Like instead of creating a turing program to ouput its whole color scheme and convert it to RGB values. |
Author: | mirhagk [ Thu Aug 05, 2010 11:27 pm ] |
Post subject: | RE:Turing in C++ |
so its been a while... well a long while, but I am still working on it, and *hopefully* tomorrow I will have something that will blow your mind holes. Like pray that everything works out, cuz if it does, Turing will never be the same. (like I'm not even kidding, you will be shocked). I'm not gonna reveal too much right now, until everything is final, but itll be awesome |
Author: | Tony [ Thu Aug 05, 2010 11:42 pm ] |
Post subject: | RE:Turing in C++ |
I am holding onto a solid object in anticipation. The demo will be available on my platform, right? |
Author: | Insectoid [ Fri Aug 06, 2010 7:04 pm ] |
Post subject: | RE:Turing in C++ |
This sounds pretty cool. I hope it'll run on macs as well. I really don't like Turing's editor. I want to be able to run my stuff from the command line. Tbh, I only want to see the basic stuff like graphics (lines, drawing pictures from files, etc)and string operations as well as some useful changes to the way Turing handles recursion and 'flexible' arrays. |
Author: | SNIPERDUDE [ Fri Aug 06, 2010 8:50 pm ] |
Post subject: | RE:Turing in C++ |
Awesome, can't wait to see it. |
Author: | mirhagk [ Wed Aug 11, 2010 11:07 pm ] |
Post subject: | RE:Turing in C++ |
k, I'm really sorry guys, I'm actually waiting on an email, and I'm literally praying like crazy that it comes soon, and with what I want. Just so you know, here's my last email I got from Ric Holt. "Hi Nathan: You are welcome to make a script version of Turing... but don't underestimated the difficulty of the task. For the record, I have a version of Turing that runs on Linux. Its generated code executes quite fast ... its compiler transcribes Turing to C. This compiler itself is written in Turing. We also wrote a Unix implementation in Turing. At one point I prototyped a pure interpreter version of Turing (written Turing), but it is long sense lost. Cheers Ric Holt " yeah... So I emailed him back, like pretty much begging to see the code, or even just get the program, and hopefully I get it soon. Cross compatable, super fast. |
Author: | Tony [ Wed Aug 11, 2010 11:39 pm ] |
Post subject: | RE:Turing in C++ |
Well it wouldn't be fair to just post Dr. Holt's code as your own. Last time Dan has spoken with Dr. Holt about open sourcing Turing, it seemed that the source code was "too embarrassing" (or something along such lines) for public consumption. |
Author: | andrew. [ Thu Aug 12, 2010 12:56 pm ] |
Post subject: | RE:Turing in C++ |
I was wondering, how do you write a compiler in Turing? Is that even possible? To me, it seems that Turing is limited in so many ways compared to "full-blown" languages like C++. |
Author: | Tony [ Thu Aug 12, 2010 1:33 pm ] |
Post subject: | RE:Turing in C++ |
Turing (the language) is Turing-complete (the machine), and so Turing (the Mathematician) tells us that it is possible. http://en.wikipedia.org/wiki/Church%E2%80%93Turing_thesis To make claims that Turing is missing critical features, you'd need to figure out how to write a compiler in C++ (from scratch, not by simply plugging a grammar into yacc) Though to be fair, I believe that the bootstrapped version of the Turing compiler was written in Turing+ http://en.wikipedia.org/wiki/Turing_Plus |
Author: | mirhagk [ Fri Aug 13, 2010 7:30 am ] |
Post subject: | RE:Turing in C++ |
I would not try to pass it off as my own, and the thing I'm working on is a scripted version, not a compiler. (I want to be able to run Turing code on any device, particularly my iPod touch) |
Author: | DtY [ Fri Aug 13, 2010 10:01 am ] |
Post subject: | Re: RE:Turing in C++ |
mirhagk @ Fri Aug 13, 2010 7:30 am wrote: particularly my iPod touch) You're going to want to stop using c++ then |
Author: | mirhagk [ Fri Aug 13, 2010 7:30 pm ] |
Post subject: | RE:Turing in C++ |
yeah, sorry, my program like drastically changed from when I posted my first post. It's simply a program that runs a scripted version of Turing (actually I'm working on gettting a differently structured Turing-like language to work first). After I finish the interpreter I will be working with a close friend of mine to rebuild the program so it can run on an iPod touch. The current dumbed down version is going to be built in Turing, the final computer one will be built in XNA, allowing it to run on the 360 as well. It should be a fun project, and I will keep you updated. |
Author: | DtY [ Fri Aug 13, 2010 8:23 pm ] |
Post subject: | RE:Turing in C++ |
XNA is C#, right? You should probably consider writing it in plain C, so that it can be compiled with c++, c# or objective c. Of course, once you get to Turing's OOP, compiling down to a non-OOP language will be more challenging, but it'd probably be worth it, since C++, C# and Objective C's object system have their differences. (IIRC, Turing's object system is a lot like c++'s, which would make it drastically different from Obj. C's, and I have no idea about c#.) |
Author: | Euphoracle [ Fri Aug 13, 2010 8:29 pm ] |
Post subject: | RE:Turing in C++ |
What? Since when can you compile C to Objective-C or C#? What are you even talking about? |
Author: | Dan [ Fri Aug 13, 2010 8:29 pm ] |
Post subject: | Re: RE:Turing in C++ |
mirhagk @ 13th August 2010, 7:30 pm wrote: After I finish the interpreter I will be working with a close friend of mine to rebuild the program so it can run on an iPod touch. The only way this will happen is with a jailbroken iPod. Apple strictly disallows compilers and interpreters. Do you have a grammar for your version of Turing yet? |
Author: | DtY [ Fri Aug 13, 2010 9:46 pm ] |
Post subject: | Re: RE:Turing in C++ |
Euphoracle @ Fri Aug 13, 2010 8:29 pm wrote: What? Since when can you compile C to Objective-C or C#? What are you even talking about? Objective C (and c#, afaik) are both strict supersets of C (like c++), any valid C program is also a valid obj. c (and c#, afaik).
There are some differences though, for example C99 allows static arrays who's size are calculated at runtime, but obj. c does not allow this. I believe the latest objective c standard is based on C89. |
Author: | chrisbrown [ Fri Aug 13, 2010 10:04 pm ] |
Post subject: | RE:Turing in C++ |
Objective-C is a strict superset of C, but C# is more similar to Java than either of those. Regardless, Objective-C would probably be a little more friendly to develop with. I personally find pure C too tedious for most applications. |
Author: | Atma Weapon [ Fri Aug 13, 2010 10:05 pm ] |
Post subject: | Re: Turing in C++ |
mirhagk @ Fri Jul 09, 2010 11:11 pm wrote: I thought I'd put this in the Turing thread, since it affects Turing users the most.
I am currently in the process of making a class for c++ that lets you use all of Turing's functions, and create windows etc. I have some of the drawing commands done, I'll finish the rest of them today, and upload the code tonight. I just wanted to let you guys know, as well as ask some help from experienced c++ coders. I can do almost all of Turings commands, and can even get like offscreenonly working and stuff like that. I'm going to reach a huge roadblock once I get to the Network commands. (I think I can get parrallel ports working easily, depends if I still have my code from computer engineering) I also have no clue how to implement the picture class, so I'll need help with that (and the sprite class) This sounds fantastic, I'd try it immediately and it would be I think of immense use to try to wean myself from Turing onto something harder. Please do finish it! And selfishly, but perhaps wisely, please leave networking stuff 'til last, that sounds really complicated and don't get discouraged. I'm currently using Turing as like a prototyping language to show off my ideas, but a C++ implementation of turing commands would mean people like me have something concrete to comapre to when they're trying to learn the more powerful language, right? Fantastic idea, keep going! |
Author: | Tony [ Sat Aug 14, 2010 1:08 am ] |
Post subject: | RE:Turing in C++ |
But there's still an issue, as Dan pointed out, that you will not get this past Apple's approval process. Also, I'm not sure why I would want to _write_ Turing code on an iPad. |
Author: | mirhagk [ Sat Aug 14, 2010 7:07 am ] |
Post subject: | Re: RE:Turing in C++ |
Tony @ Sat Aug 14, 2010 1:08 am wrote: But there's still an issue, as Dan pointed out, that you will not get this past Apple's approval process. Also, I'm not sure why I would want to _write_ Turing code on an iPad.
dang, I thought that might be a problem, wasn't sure what their rules were. I'll look more into to double check, but basically I would want the ability to not only develop games VERY easily for it, but I also would like to be able to check my ideas for algorithmns and things at any time. Okay well I am still going to build the scripted version for practice, but I'll put more focus back into building the commands into C++ (actually I started doing it in XNA, since that is a LOT easier to use, and would encourage people to go above and beyond the library I create. |
Author: | DemonWasp [ Sat Aug 14, 2010 11:38 pm ] | ||
Post subject: | RE:Turing in C++ | ||
Notably, C++ isn't a strict superset of C, because C++ reserves additional keywords. The following file will compile in gcc, but not in g++:
|
Author: | andrew. [ Sun Aug 15, 2010 10:00 am ] |
Post subject: | Re: RE:Turing in C++ |
Tony @ Sat Aug 14, 2010 1:08 am wrote: But there's still an issue, as Dan pointed out, that you will not get this past Apple's approval process. Also, I'm not sure why I would want to _write_ Turing code on an iPad.
Or you can do what some others have done and hide features in your app. Apple doesn't look at the source, they only try the app to see if it violates their rules. ![]() |
Author: | Insectoid [ Sun Aug 15, 2010 10:49 am ] |
Post subject: | Re: RE:Turing in C++ |
andrew. @ Sun Aug 15, 2010 10:00 am wrote: Tony @ Sat Aug 14, 2010 1:08 am wrote: But there's still an issue, as Dan pointed out, that you will not get this past Apple's approval process. Also, I'm not sure why I would want to _write_ Turing code on an iPad.
Or you can do what some others have done and hide features in your app. Apple doesn't look at the source, they only try the app to see if it violates their rules. ![]() Just don't let Gizmodo hear about it. |
Author: | mirhagk [ Sun Aug 15, 2010 4:06 pm ] |
Post subject: | RE:Turing in C++ |
lol so then I just gotta come up with a reason for the app other than running Turing code. Um also how far is compiling, like for instance, a program reading a file that tells it how to generate a map, is that compiling, how about a program that reads a file that describes a mission in the game? Or something that reads a file to desribe AI behaviour? Or something that reads commands on how to run a certain program? Is a scripter for Turing allowed as long as the user can't make code? Is something akin to RPG maker allowed? |
Author: | TheGuardian001 [ Sun Aug 15, 2010 5:40 pm ] |
Post subject: | Re: Turing in C++ |
Nothing that allows the creation of another application (either by compilation, or by interpretation) will get in. Reading a file used in your program may be allowed (I'm not sure how iPhone apps keep track of data,) However it would not be allowed to be edited by the user directly. A scripter is useless if the code cannot be modified (You're just making an open source App at that point.) RPGMaker style things would probably be allowed provided they did not provide a way to export the content as an App, or allow direct access to the iPhone API (So the RPGMaking segment, yes, the RGSS scripting segment, no.) All of this is just my opinion based on what I've heard of Apple's rules though. For all I know, they might block out pretty much anything the user can fully customize. |
Author: | DtY [ Mon Aug 16, 2010 12:19 pm ] |
Post subject: | Re: Turing in C++ |
TheGuardian001 @ Sun Aug 15, 2010 5:40 pm wrote: (I'm not sure how iPhone apps keep track of data,) You can include files in the app bundle (for read only), or there is somewhere on the filesystem that your app can read and write to (there's one that's specific to the app, and another that is common to all).
Apple rejects any applications that aren't written in objective c, but I have no idea how they figure out what is and what isn't. |
Author: | mirhagk [ Mon Aug 16, 2010 3:09 pm ] |
Post subject: | RE:Turing in C++ |
But basically, the stuff in RPG Maker that allows creation of events and objectives through GUI (ie clicking a button that adds an event to change the sprite, or teleport the character) is allowed? The only difference between that and a scripting language is that it is created through GUI, not text. I'll have to read this for myself, does anyone know where I can find this stuff? |
Author: | TheGuardian001 [ Mon Aug 16, 2010 3:42 pm ] |
Post subject: | Re: Turing in C++ |
I don't think they have too many explicitly written rules (If they do, I don't know where to find them.) Most of it is just them publicly saying "We will not accept applications that do X" after receiving lots of applications that do X. The only explicitly written rule that I know of is as follows: Quote: Applications must not contain any obscene, pornographic, offensive or defamatory content or materials of any kind (text, graphics, images, photographs, etc.), or other content or materials that in Apple?s reasonable judgment may be found objectionable by iPhone or iPod touch users. So all the usual, plus anything Apple doesn't like. |
Author: | mirhagk [ Mon Aug 16, 2010 3:48 pm ] |
Post subject: | RE:Turing in C++ |
so wait... are you saying a scipter is allowed? It wouldn't compile any code, just merely run scripts, and it'd come packed with a couple games, just allows users to make their own |
Author: | andrew. [ Mon Aug 16, 2010 4:01 pm ] |
Post subject: | RE:Turing in C++ |
Well I know that Spacetime (math program) for the iDevices allows you to write scripts an functions and it uses it's own custom GUI as well. So maybe it just depends on your program. I think as long as the user doesn't have direct access to the Apple APIs, Apple doesn't really care. |
Author: | DtY [ Mon Aug 16, 2010 7:24 pm ] |
Post subject: | Re: RE:Turing in C++ |
mirhagk @ Mon Aug 16, 2010 3:48 pm wrote: so wait... are you saying a scipter is allowed? It wouldn't compile any code, just merely run scripts, and it'd come packed with a couple games, just allows users to make their own All apps have to go through the Apple approval process. If your app allows anyone to bypass this (ie. allow users to add applications that do not need to go through Apple's acceptance process) your app will be rejected.
e; I imagine that the scripting on spacetime is pretty much just keystroke processing? That's probably why it was allowed, you can't really do anything with it (as far as running new applications goes) |
Author: | mirhagk [ Wed Aug 18, 2010 6:38 pm ] |
Post subject: | RE:Turing in C++ |
but they wouldn't be new apps, they wouldn't have access to Mac's API, only to the commands Turing has (with some more restrictions, like not full file I/O and networking). Yeah you could make a script that they wouldnt approve as an app, but the same can be said for a picture editing tool (ie you can draw some images that they wouldnt allow through the store). |
Author: | DtY [ Thu Aug 19, 2010 10:42 am ] |
Post subject: | RE:Turing in C++ |
There's a difference between programming and drawing. Apps have been rejected before because they allow you to program without going through the app store approval process. |
Author: | TheGuardian001 [ Thu Aug 19, 2010 1:53 pm ] | ||||
Post subject: | Re: Turing in C++ | ||||
Well, if you create a drawing app(program flow):
No matter what the user inputs, the actual program flow and function remain largely unchanged. If you create a scripting app:
Based on what the user inputs, the program flow and function are completely different for every set of input. See the difference? And as for what the user can draw VS what the user can program: -the rules against pornography/adult content is simply because the platform is family friendly. What the user produces on their own iProduct is their business. They only care about what is placed in the public marketplace. -The rule against scripting/programming apps is because Apple wants control over their API (at the end-user level, not the developer level) and their app store. If a scripting app were allowed, end-users would have access to the API, as well as no incentive to ever use the app store (since they can just freely distribute scripts.) Whether or not full access to the API is being supplied is irrelevant. They have the rule "NO USERS ACCESSING THE API." They don't care how much or how little of it you access, if you access it in a way not explicitly defined at compile time, you will get rejected. |
Author: | mirhagk [ Sat Aug 21, 2010 6:50 am ] |
Post subject: | RE:Turing in C++ |
okay, so now going on the other side of things, is it possible/difficult to jailbreak it or something and get on this app without going through the store? |
Author: | DtY [ Sat Aug 21, 2010 7:28 am ] |
Post subject: | Re: RE:Turing in C++ |
mirhagk @ Sat Aug 21, 2010 6:50 am wrote: okay, so now going on the other side of things, is it possible/difficult to jailbreak it or something and get on this app without going through the store? If you jailbreak your phone, you can get apps outside of the app store, yes. You can also put apps on without the itunes store if you pay 100USD for a developers account (but you may have to compile them yourself). |
Author: | andrew. [ Sat Aug 21, 2010 7:43 pm ] |
Post subject: | Re: RE:Turing in C++ |
mirhagk @ Sat Aug 21, 2010 6:50 am wrote: is it possible/difficult to jailbreak it?
Nope. A quick Google search will supply you with many different methods for jailbreaking. Generally, you want an untethered jailbreak, which means that the device can boot up by itself without being connected to a computer. |
Author: | mirhagk [ Sun Aug 22, 2010 1:22 am ] |
Post subject: | RE:Turing in C++ |
okay thank you all |
Author: | Tony [ Sun Aug 22, 2010 6:33 am ] |
Post subject: | RE:Turing in C++ |
You just have to be careful around updates and make sure that they are cleared/patched, before applying to a jailbroken device. |
Author: | michaelp [ Sun Aug 22, 2010 12:43 pm ] |
Post subject: | RE:Turing in C++ |
This thread has really been derailed. ![]() |
Author: | andrew. [ Sun Aug 22, 2010 6:44 pm ] |
Post subject: | RE:Turing in C++ |
Bringing this thread back on track, mirhagk, could you post whatever code you have? I really want to see how this is looking. |
Author: | Srlancelot39 [ Mon Sep 20, 2010 6:45 pm ] |
Post subject: | RE:Turing in C++ |
ok so...this program can run Turing code in C++?....can it translate Turing code into C++ somehow? I'm very interested in this because I have a 5.5k line Turing rpg (Grail Quest if any of you remember it) that I would like to rewrite in C++. |
Author: | andrew. [ Tue Sep 21, 2010 11:35 am ] |
Post subject: | RE:Turing in C++ |
Basically, it is a Turing compiler/interpreter written in C++. This means that it will still read Turing source code, and should produce the same output as the "real" Turing compiler. So it doesn't change Turing source into C++ source or C++ into Turing. The reason this is being developed is because the real Turing program is discontinued, and the only way to implement new functions and features into the language is to create your own compiler (because Holtsoft won't give us their source). |
Author: | mirhagk [ Tue Sep 21, 2010 2:50 pm ] |
Post subject: | RE:Turing in C++ |
Well actually I started working on more what he is actually talking about. Stage one was to create a C++ library/module that worked identically to the way Turing does things, then stage two would be basically a search and replace program to replace if (condition) then statements end if with if (condition){ statements } Unfortuneatly neither one has come very far, as I was sidetracked with schoolwork and trying to figure out how to do a lot of the stuff Turing does. I was thinking about doing this all in C# with XNA, since that is simple to use, yet powerful. |
Author: | Srlancelot39 [ Tue Sep 21, 2010 11:58 pm ] |
Post subject: | RE:Turing in C++ |
Very impressive! =P |