在线编译器
免费、即时且私密地编写并运行 C、C++、Python、JavaScript、TypeScript、R、PHP、Ruby、Lua、SQL、Prolog、Scheme、Clojure 和 CoffeeScript 代码。所有编译器都通过 WebAssembly 在浏览器中运行,代码永远不会离开您的设备。
How our online compilers work
Traditional online compilers send your code to a remote server, run it there and send the output back. Ours take a different approach: the language runtime itself (CPython, R, SWI-Prolog, the Ruby interpreter, PHP, Lua or SQLite compiled to WebAssembly, a complete Clang/LLVM toolchain that compiles C and C++ to WebAssembly, or your browser's own JavaScript engine) is downloaded once and runs inside a sandboxed Web Worker in your browser. That means instant re-runs, no queue, no account, and complete privacy: the code you write is never uploaded or stored on our servers.
What you can do
- Learn a language and experiment with examples.
- Test snippets, algorithms and regular expressions before using them in a project.
- Practise SQL against a real SQLite database.
- Teach and demo code without asking students to install anything.
Limitations
Because everything runs in a browser sandbox, programs cannot open network sockets, access your files or install system packages, and each run is limited by the time limit you choose. Compiled languages such as Java, C#, Go, Rust and C/C++ need a different kind of runtime and are coming later.
Looking for formatters instead? See all developer tools, including the JSON formatter and SQL formatter.
指南
- 在线编译器原理:如何在浏览器中运行代码: WebAssembly 如何让 C、C++、Python、R 和 SQL 在浏览器标签页中运行,与服务器端在线编译器有何不同,又有哪些局限。
- 什么是 JSON?语法、常见错误与校验方法: JSON 是什么:通过示例讲解对象、数组、数据类型、最常见的语法错误及修复方法,对比 JSON、YAML 与 XML,并介绍如何校验 JSON。
常见问题
How do the online compilers run code?
They use WebAssembly builds of the real compilers and interpreters, so your code runs inside your browser rather than on a server.
Can programs read input?
Yes. Type standard input in the input box before you run the program.
Can I code together with someone?
Yes. Use Code together to open the same code in the collaborative editor and share the link.