Though this is a question with broader scope, I want to write a Online Test Code for my company where people can be given questions to write code in java/php/c etc and the code run and compiles online. I have seen this happening in site like codeacademy, Udacity etc. Just want to understand the architecture behind it. I have searched a lot along the similiar lines a lot on Google but couldnt find a concrete answer. Though after reading bits and pieces here and there i understood that the code is sent to compiler on server and then the results are sent back. Not sure how exactly that happens. Can somebody point me to a starting point of it.
Step 1: Open the website JDoodle.com and sign in, if you don't have an account then you must register first. Step 2: Select any one programming language and write your code and save it. Click on editable share and copy the embed URL.
The short answer is "no". The current implementation of PHP is that of an interpreted language.
Java can be considered both a compiled and an interpreted language because its source code is first compiled into a binary byte-code. This byte-code runs on the Java Virtual Machine (JVM), which is usually a software-based interpreter.
What you can basically have, according to a MVC pattern applied to a web architecture, is something like this:
The sequence of operations could be:
However, more in general, the point is that compilers and interpreters are base software. They are not intended for general users, which can easily live with the Operating System only. Therefore, "on line compiling", at the best of my knowledge, is something different from "posting code, letting it execute on a server, and visualizing the answer". Online compiling would mean distributing the responsibility of compiling across the network, which does make sense, but, in my opinion, it is not meant to use for demonstrative purpose (like you are mentioning).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With