hi guys
how are you ?!
hope every thing is alright.
well i want to make something like this one
can anyone help me how could i start in steps ?
what books should i read ?!
Thanks your help will be greatly appreciated.

Dani AI

Generated

A practical way to attack this is to treat it as two smaller projects that you integrate: an editor UI and a safe execution service. Start very small (one language, no collaboration) — that keeps scope manageable, which echoes 's caution. You do not need to write a compiler from scratch: invoke existing compilers/runtimes from a sandboxed backend instead of reimplementing language internals, as hinted.

First steps to build a working prototype:

  • Build the editor UI with an embeddable editor (examples: Monaco Editor or CodeMirror). Provide a Run button that posts code + metadata to your server.
  • Implement a backend “runner” service that receives code, writes it into an ephemeral directory, and executes compile/run inside an isolated container. Example minimal runner command (illustrative):
    docker run --rm --net=none --cpus=".5" -m 256m --pids-limit=64 \
    --security-opt=no-new-privileges --cap-drop ALL -u 1000:1000 \
    -v /srv/sandbox/123:/work -w /work gcc:11 bash -lc \
    'g++ main.cpp -O2 -o main && timeout 2 ./main'

    Capture stdout/stderr and return or stream it back to the client (WebSockets are useful for live output).

Important hardening and scaling notes:

  • Never run untrusted code on the host. Use containers/microVMs (Docker, Firecracker) with network disabled, strict CPU/memory/time limits, dropped capabilities, PID limits, and seccomp/AppArmor profiles.
  • Put workers behind a job queue (Redis + worker pool) and pre-warm containers if latency matters.
  • Consider a managed/open-source judge service (e.g., Judge0) if you want to avoid building a sandbox from scratch.

Suggested further reading and resources: Crafting Interpreters for language internals, the classic compiler text (Compilers: Principles, Techniques, and Tools) for deeper theory, and the Docker docs for container security. Begin with one language end-to-end, iterate features (LSP/autocomplete, file workspace, persistent projects) after the core run/return loop is solid.

Recommended Answers

All 3 Replies

That is a pretty serious application! I would certainly not start out with something anywhere near that complex! I'm not even sure c++ would be the right language to start a project like that with.

that is indeed a pretty serious one , besides making compiler isnt a joke ..
U gotto understand a lot of theory and concepts regarding a function of compiler , which mostly include Finite Automata Theory and parsing of grammers and a lot of things pertinent to it.

I would suggest you to first head on with building simple text editors using language of ur choice and later on venture out with new things.
and AFAIK c++ is not used for web based applications.

AFAIK c++ is not used for web based applications.

Yes, you're right. It's pretty much Java, JavaScript & PHP.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.