OSDev.org

The Place to Start for Operating System Developers
It is currently Sat May 18, 2024 12:32 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 10 posts ] 
Author Message
 Post subject: Any compiler that is server based?
PostPosted: Wed Oct 17, 2007 10:28 pm 
Offline
Member
Member

Joined: Thu Jul 07, 2005 11:00 pm
Posts: 1546
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...

_________________
My new NEW blag


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2007 11:47 pm 
Offline
Member
Member
User avatar

Joined: Thu Nov 16, 2006 12:01 pm
Posts: 7615
Location: Germany
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 17, 2007 11:57 pm 
Offline
Member
Member
User avatar

Joined: Thu Dec 21, 2006 3:03 am
Posts: 1029
Location: Hobart, Australia
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.

_________________
My Personal Blog | My Software Company - Loop Foundry | My Github Page


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 18, 2007 1:26 am 
Offline
Member
Member
User avatar

Joined: Mon Jun 05, 2006 11:00 pm
Posts: 2294
Location: USA (and Australia)
http://www.google.com/search?q=online+compiler
I'm sure a few will describe how they're doing it.

_________________
My OS is Perception.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 18, 2007 6:44 pm 
Offline
Member
Member

Joined: Sun Jan 14, 2007 9:15 pm
Posts: 2566
Location: Sydney, Australia (I come from a land down under!)
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

_________________
Pedigree | GitHub | Twitter | LinkedIn


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 18, 2007 9:39 pm 
Offline
Member
Member

Joined: Thu Jul 07, 2005 11:00 pm
Posts: 1546
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...

_________________
My new NEW blag


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 19, 2007 12:19 am 
Offline

Joined: Tue Jul 10, 2007 2:21 am
Posts: 3
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.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Oct 20, 2007 9:43 am 
Offline
Member
Member

Joined: Sun Jun 18, 2006 7:21 pm
Posts: 260
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.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 22, 2007 5:48 am 
Offline
Member
Member
User avatar

Joined: Thu Apr 05, 2007 6:07 am
Posts: 214
http://llvm.org/demo/

HTH


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 23, 2007 3:43 am 
Offline
Member
Member
User avatar

Joined: Sat Oct 21, 2006 5:29 pm
Posts: 275
Location: Brisbane Australia
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"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 21 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group