2

I am looking for a web api that can execute programs and return the result. The language would be specified, and it would be given stdin, and then would send back stdout (and maybe stderr.)

  • Should support a large number of languages
  • Accesses through an API
    • Code and language can be entered manually, but stdin must be able to specified via the API
  • Sends back stdout
  • Free would be good
  • Bonus
    • If it leaves the program running to receive more stdin
    • Gives stderr as well

The purpose is that on http://codegolf.stackexchange.com, we often run "KoTH" challenges, but it is a challenge dealing with all the different languages. If there was an API to execute the code for us, it would be a lot easier.

1

I tagged this question to see if something interesting came up, and sadly it doesn't seem like it does. However here are some online editors, and a thought regarding the Ideone API...

Some online editors

I guess you've heard of these which are found searching for online compiler editor, and possibly already use one or two of them:

With slight variations these provide multiple languages, and different options for running your software online. But most of them only allows for stdin to be put into a textbox on the html page, and provides not only a pure stdout back.

And although not tested, I hardly doubt they are able to communicate with other programs, or to keep stdin open. That is not something easily done using the HTTP protocol.

A closer look at Ideone

When further specifying the search into online compiler editor with stdin api, most of these fell out, but Ideone remained and in the reference for CodeTwist it says: "CodeTwist uses Ideone API © by Sphere Research Labs". This indicates that there might be a little hope for you...

The description of Ideone says this about it self:

Ideone is powered by: Sphere Engine™

Ideone is an online compiler which attracts hundreds of thousands of users every month.

But do you know the technology which powers Ideone?

Your favourite compiler runs using Sphere Engine™, a proprietary technology bringing you far more possibilities than just code execution.

  • Sphere Engine™ executes your code on remote servers thanks to a simple API.
  • Sphere Engine™ supports 60+ programming languages, which are kept up-to-date and come equipped with both popular and non-standard libraries.
  • Sphere Engine™ works in a complete & secure runtime environment.
  • Sphere Engine™ comes with an optional module and Content Management System for setting programming challenges and programming contests.
  • Sphere Engine™ is used commercially in: recruitment, training & certification, education, programming contests & hackathons

Just imagine how many things you could do with this powerful technology in the service of your company! You can try it out for free: visit www.sphere-engine.com to see the demo version in action, consult the complete documentation, and the API.

To me this text suggests that it could be possible to use the API directly, and control what you send in, and how you respond to the return from the API. In other words, it might be possible to build your own solution where you send in code through the API with your stdin, and then redirect the stdout result back into another call triggering a different program.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.