Syntax Compare
20 languages side by side, from hello world to concurrency and GPU kernels: Python, C++, Rust, CUDA, Triton, WGSL and more.
How it works
Pick a topic on the left and the languages you want to compare. Topics run from basic (variables, loops, functions) through intermediate (types, errors, generics, files) to advanced (concurrency, memory), and a GPU & shaders track (kernels, shared memory, atomics, launching work).
- Python snippets have a Run button that executes them in your browser.
- CUDA, HIP, OpenCL, SYCL and Triton are for general GPU compute. Metal, HLSL, GLSL and WGSL are shader languages, so they have no printing, files or strings; where a concept does not exist the card says why.
- GPU examples assume a launch like the one in “Launching work”. They show the kernel, not a full runnable program.
- Snippets are short teaching examples, not production code. Zig and Mojo change between releases, so check their docs if one does not compile on your version.
- Your language selection is remembered in this browser only.
Related tools
Big-O Cheat Sheet
Time and space complexity of data structures, sorting and graph algorithms, colour-coded and filterable.
Regex Tester
Test JavaScript regular expressions live, with match highlighting, capture groups and a plain-English breakdown.
Git Command Finder
Find the right git command by describing what you want to do, with danger warnings.