Content is user-generated and unverified.

Programming Languages Runtime Cheat Sheet

Compilation & Execution Methods by Language

LanguageCompilation TypeRuntime RequiredFile ExtensionsHow to RunNotes
CCompiled to native binaryNone (after compilation).c.exe/.outgcc file.c -o program && ./programDirect machine code execution
C++Compiled to native binaryNone (after compilation).cpp/.cc.exe/.outg++ file.cpp -o program && ./programDirect machine code execution
JavaCompiled to bytecodeJava Runtime (JRE/JVM).java.classjavac File.java && java FilePlatform-independent bytecode
C#Compiled to bytecode (IL).NET Runtime.cs.exe/.dlldotnet run or csc file.cs && ./file.exeRuns on .NET CLR
PythonInterpreted (bytecode cached)Python interpreter.pypython file.pyBytecode compiled on-the-fly
RustCompiled to native binaryNone (after compilation).rs.exerustc file.rs && ./file or cargo runMemory-safe compiled language
GoCompiled to native binaryNone (after compilation).go.exego build file.go && ./file or go run file.goFast compilation, single binary
JavaScriptInterpreted/JIT compiledJavaScript engine.jsnode file.js (Node.js) or browserV8, SpiderMonkey, etc.

Execution Categories

Compiled Languages (Native Binary)

  • Languages: C, C++, Rust, Go
  • Process: Source code → Machine code
  • Runtime: No additional runtime needed
  • Performance: Fastest execution
  • Distribution: Single executable file

Bytecode Languages

  • Languages: Java, C#
  • Process: Source code → Intermediate bytecode → Runtime execution
  • Runtime: Virtual machine required (JVM, CLR)
  • Performance: Good, with JIT optimization
  • Distribution: Bytecode + runtime dependency

Interpreted Languages

  • Languages: Python, JavaScript
  • Process: Source code executed line-by-line or JIT compiled
  • Runtime: Language interpreter/engine required
  • Performance: Flexible, but generally slower than compiled
  • Distribution: Source code + interpreter

Detailed Language Information

C

bash
# Compile and run
gcc hello.c -o hello
./hello

# With debugging
gcc -g hello.c -o hello

# With optimization
gcc -O2 hello.c -o hello
  • Runtime: None after compilation
  • Output: Native machine code
  • Performance: Highest
  • Use cases: System programming, embedded systems

C++

bash
# Compile and run
g++ hello.cpp -o hello
./hello

# With C++17 standard
g++ -std=c++17 hello.cpp -o hello

# With optimization
g++ -O2 hello.cpp -o hello
  • Runtime: None after compilation
  • Output: Native machine code
  • Performance: Highest
  • Use cases: Games, system software, performance-critical apps

Python

bash
# Run directly
python hello.py

# Run with specific version
python3 hello.py

# Run module
python -m mymodule

# Interactive mode
python
  • Runtime: Python interpreter (CPython, PyPy, etc.)
  • Output: Interpreted with bytecode caching
  • Performance: Moderate (fast development)
  • Use cases: Web development, data science, automation

Java

bash
# Compile and run
javac Hello.java
java Hello

# Compile with classpath
javac -cp ./libs:. Hello.java

# Run with classpath
java -cp ./libs:. Hello

# Create and run JAR
jar -cvf myapp.jar *.class
java -jar myapp.jar
  • Runtime: Java Virtual Machine (JVM)
  • Output: Bytecode (.class files)
  • Performance: Good (JIT compilation)
  • Use cases: Enterprise applications, Android apps, web services

C#

bash
# .NET Core/5+ (cross-platform)
dotnet new console
dotnet run
dotnet build
dotnet publish

# Traditional .NET Framework (Windows)
csc Hello.cs
Hello.exe

# With specific framework
dotnet build -f net6.0
  • Runtime: .NET Runtime (CLR)
  • Output: Intermediate Language (IL) bytecode
  • Performance: Good (JIT compilation)
  • Use cases: Windows applications, web services, games (Unity)
bash
# Compile and run single file
rustc hello.rs
./hello

# Using Cargo (recommended)
cargo new myproject
cargo run
cargo build --release
  • Runtime: None after compilation
  • Output: Native machine code
  • Performance: Highest (like C/C++)
  • Use cases: System programming, web backends, blockchain

Go

bash
# Run directly
go run hello.go

# Compile to binary
go build hello.go
./hello

# Install and run
go install
myprogram
  • Runtime: None after compilation
  • Output: Native machine code
  • Performance: High
  • Use cases: Web servers, cloud services, DevOps tools

JavaScript

bash
# Node.js (server-side)
node hello.js

# Browser (client-side)
# Load in HTML: <script src="hello.js"></script>

# NPM script
npm run start

# Interactive REPL
node
  • Runtime: JavaScript engine (V8, SpiderMonkey, etc.)
  • Output: Interpreted/JIT compiled
  • Performance: Good (modern engines are fast)
  • Use cases: Web development, server backends, desktop apps

Performance Comparison

LanguageExecution SpeedDevelopment SpeedMemory UsageLearning Curve
C⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
C++⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Rust⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Go⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Java⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
C#⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
JavaScript⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐
Python⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐⭐

Quick Reference Commands

bash
# Compilation (produces executable)
gcc hello.c -o hello          # C
g++ hello.cpp -o hello        # C++
rustc hello.rs               # Rust
go build hello.go            # Go

# Bytecode compilation (requires runtime)
javac Hello.java             # Java (creates .class)
dotnet build                 # C# (creates IL)

# Direct execution (no separate compilation step)
python hello.py              # Python
node hello.js                # JavaScript
go run hello.go              # Go (compile + run)
cargo run                    # Rust (using Cargo)
java Hello                   # Java (run compiled .class)
dotnet run                   # C# (compile + run)
Content is user-generated and unverified.
    Programming Languages Runtime Cheat Sheet | Claude