Any compiler that is server based?

Programming, for all ages and all languages.
Post Reply
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Any compiler that is server based?

Post by earlz »

Ok, I love to program while on the fly(and hence on unfamiliar computers) and so I'd like if it was possible to compile C or C++ code through a PHP script...

I have yet to see a thing like it...so it might be a future program I attempt to make...
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

Should be dead easy to whip up a script that takes a list of files, and passes them to make / GCC on the server, returning the binary.

I don't know of a ready-made solution however, and don't think there are many around simply because the requirement is a bit... exotic. ;)
Every good solution is obvious once you've found it.
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Post by JackScott »

Have you looked in to SSH? If you don't have any restrictions on port access, it might be really good. There are quite a few free shell servers around, and quite a few good ones (that are fairly cheap). There is also the option of dialing into your home computer, if you know it is on.
User avatar
AndrewAPrice
Member
Member
Posts: 2299
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

http://www.google.com/search?q=online+compiler
I'm sure a few will describe how they're doing it.
My OS is Perception.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

I tried one using exec, system, passthru, none worked for me... Maybe it's because I was trying to do it via Cygwin.

If you can get it to work, I'd love to see your code :D
earlz
Member
Member
Posts: 1546
Joined: Thu Jul 07, 2005 11:00 pm
Contact:

Post by earlz »

meh...it's possible, but it'd mean writing a parser and assembler in PHP(I'd want it to work on any server I put it on, btw)

also, I can't make compilers or parsers or such...so...
bas
Posts: 3
Joined: Tue Jul 10, 2007 2:21 am

Post by bas »

you can execute gcc from PHP with the exec function:
string exec ( string $command [, array &$output [, int &$return_var]] )

and you can get the errors in the output array.
SpooK
Member
Member
Posts: 260
Joined: Sun Jun 18, 2006 7:21 pm

Post by SpooK »

hckr83 wrote:meh...it's possible, but it'd mean writing a parser and assembler in PHP(I'd want it to work on any server I put it on, btw)

also, I can't make compilers or parsers or such...so...
Considering that I have done so, I would say yes. PHP is actually optimal for situations like this because it is stronger with dynamic memory and strings. Sorting arrays and building syntax trees is less tedious. The speed factor is negligible as Zend is pretty good with developing their product.

Also, you can keep up hopes that the Roadsend PHP compiler, which is open-source now, will continue to improve to the point of real usability.
User avatar
binutils
Member
Member
Posts: 214
Joined: Thu Apr 05, 2007 6:07 am

Post by binutils »

User avatar
B.E
Member
Member
Posts: 275
Joined: Sat Oct 21, 2006 5:29 pm
Location: Brisbane Australia
Contact:

Post by B.E »

hckr83 wrote:meh...it's possible, but it'd mean writing a parser and assembler in PHP(I'd want it to work on any server I put it on, btw)

also, I can't make compilers or parsers or such...so...
are you retarded, reading this thread I seen least 4 solutions to what you want.

If your looking for a ready made solution to this very miner problem, then you should learn how to do it _yourself_, rather than blindly copying code.

Sorry if I'm to harsh, but this kind of question really annoys me.
Image
Microsoft: "let everyone run after us. We'll just INNOV~1"
Post Reply