5

This question may sound crazy.Is there anything browser based compiler out there ?

Malavan
  • 789
  • 7
  • 27

3 Answers3

3

Native Client is a sandbox for running compiled C and C++ code in the browser efficiently. You can explore this.

  • Can you please explain , where does the compilation part takes place ?. Because it running compiled C and C++ code. Am I right ? – Malavan Jan 24 '19 at 07:07
  • Native Client web application consists of JavaScript, HTML, CSS, and a NaCl module written in a language supported by the SDK. The NaCl SDK currently supports C and C++. Please go through this [video](https://youtu.be/MvKEomoiKBA) & this [website](https://developer.chrome.com/native-client/overview) for understanding it better. – Curiousdeveloper Jan 24 '19 at 08:14
  • 1
    Native Client is now obsolete, so it [will be removed from Chrome](https://developer.chrome.com/native-client/migration) later this year. – Anderson Green May 26 '19 at 17:50
  • Native client has been removed as of 2022. – waasss Apr 16 '22 at 20:15
2

It is possible to run native binaries in a browser using an x86 emulator in JavaScript, so a C compiler could run in a browser in this way.

It is also possible to write a "self-hosting" C-to-WebAssembly compiler that runs in a browser, such as emception.

Anderson Green
  • 30,230
  • 67
  • 195
  • 328
2

You can run linux in the browser, it also has the gcc compiler which you can use from the command line: jslinux

Adder
  • 5,708
  • 1
  • 28
  • 56