QuinnBaetz
QuinnBaetz

Reputation: 559

c exec embeded in webpage

Does anyone know for a tool that allows a c executable to be run in the browser? I'm looking for a javascript, java, or flash solution because I don't have privileges to run c executables on the server.

The executables are basic input and output programs.

Upvotes: 0

Views: 110

Answers (3)

ephemient
ephemient

Reputation: 204886

Emscripten is an LLVM-to-JavaScript compiler. It takes LLVM bitcode (which can be generated from C/C++, using llvm-gcc or clang, or any other language that can be converted into LLVM) and compiles that into JavaScript, which can be run on the web (or anywhere else JavaScript can run).

Using Emscripten, you can

  • Compile C and C++ code into JavaScript and run that on the web
  • Run code in languages like Python as well, by compiling CPython from C to JavaScript and interpreting code in that on the web

Upvotes: 0

onteria_
onteria_

Reputation: 70557

Looking at your comments, I hear you mention students and running simple programs. As a suggestion, you might want to look into CodePad. This will let you interpret simple C programs. Note that everything needs to be in one place, so you'll have to combine C and header files.

Here is a sample:

http://codepad.org/qQS31BwM

EDIT

Here's another one I found:

http://ideone.com/

When you run the program, at the bottom there is a link for input. You can use it to run the program with given input as entered.

Upvotes: 1

R.. GitHub STOP HELPING ICE
R.. GitHub STOP HELPING ICE

Reputation: 215397

You could use this as a basis for solving the problem:

http://bellard.org/jslinux/

Upvotes: 0

Related Questions