Computer Science Canada

Turing and Webpages

Author:  rsshelas [ Mon Sep 27, 2010 8:09 pm ]
Post subject:  Turing and Webpages

Is it possible to upload your code and make it work on a website?

Author:  andrew. [ Mon Sep 27, 2010 8:13 pm ]
Post subject:  RE:Turing and Webpages

No. The user would have to download the source and compile it in order to run it. Or you would have to compile it for Windows and upload that. I'm assuming you want to embed it into the webpage like an applet, and you simply can't do it with Turing.

Author:  DtY [ Mon Sep 27, 2010 8:59 pm ]
Post subject:  Re: RE:Turing and Webpages

andrew. @ Mon Sep 27, 2010 8:13 pm wrote:
No. The user would have to download the source and compile it in order to run it. Or you would have to compile it for Windows and upload that. I'm assuming you want to embed it into the webpage like an applet, and you simply can't do it with Turing.
If there was a working Unix version (or if the Windows version had some way to access standard input/output) you could use it with CGI, theoretically. https://secure.wikimedia.org/wikipedia/en/wiki/Common_Gateway_Interface

Author:  DanShadow [ Mon Sep 27, 2010 10:13 pm ]
Post subject:  RE:Turing and Webpages

Take the next step and learn Java Wink.
Its a relatively easy, very structured language with an easy to use graphics API. Plus you can implement them in a web-page by making it a Java Applet.

Author:  Tony [ Tue Sep 28, 2010 1:07 am ]
Post subject:  Re: RE:Turing and Webpages

DtY @ Mon Sep 27, 2010 8:59 pm wrote:
you could use it with CGI, theoretically.

Or listen on port 80 and run as a webserver itself. http://compsci.ca/v3/viewtopic.php?t=2304

Author:  Srlancelot39 [ Tue Sep 28, 2010 6:26 pm ]
Post subject:  RE:Turing and Webpages

is this possible with C++?

Author:  DtY [ Tue Sep 28, 2010 6:47 pm ]
Post subject:  Re: RE:Turing and Webpages

Srlancelot39 @ Tue Sep 28, 2010 6:26 pm wrote:
is this possible with C++?
Of course, using both methods mentioned; but it wont work on most web hosts.

- Any language that can access standard input, output and environment variables can be used to write CGI scripts
- c++ has a sockets library (actually, I don't think it's standard, might be part of POSIX?) so you could write a web server that would serve the pages for you (skipping another webserver, though you might use a reverse proxy to route it to your program). There's even a c++ library for this (like ruby on rails), but I cannot remember the name.

Author:  andrew. [ Tue Sep 28, 2010 9:55 pm ]
Post subject:  RE:Turing and Webpages

Okay I know that it's technically possible, but it's not practical. It's easier to just rewrite your program in Java as an applet.


: