Reference

Programming languages

Choose TypeScript, Go, Rust or C++ and find syntax, everyday APIs, standard libraries and tools in one place.

Scope and conventions

TypeScript/Node, Go 1.23+, Rust 2024 and C++23: from a first CLI to files, JSON, HTTP, concurrency and testing. Complete programs are labeled; other examples identify their surrounding code/imports. Optional libraries and version requirements are named in each entry.

Debugging & diagnostics

TypeScript docs Debugging Node.js ↗

Pause and inspect a failing execution

TypeScript

Use the Node inspector with a compatible debugger; source maps connect emitted JavaScript to TypeScript.

Shell: node --inspect-brk --enable-source-maps out/example.js. Keep the inspector local; pause at a breakpoint and inspect the stack and values.

Check races with a supported tool

TypeScript

A single JavaScript event loop can still have logical races across awaits. Native race detectors do not prove async ordering correctness.

Test controlled interleavings, stale responses and shared-resource updates. Worker/shared-memory code needs its own synchronization policy.

Choose diagnostics for memory and undefined behavior

TypeScript

Use heap snapshots/allocation profiles for retention and the type checker for static diagnostics. Garbage collection does not prevent leaks through retained references.

Check listener cleanup, timers, caches and closures retaining large objects.

Run formatting and static checks separately from tests

TypeScript

The TypeScript project checker reads tsconfig when invoked with -p. Formatting/linting require their separately configured tools.

Shell: npx tsc -p tsconfig.json --noEmit. Optional configured formatter: npx prettier --check src. Type checking is separate from runtime validation.

Reduce a failure to one repeatable case

TypeScript

Record exact input, expected/observed behavior, version/configuration and a focused command. Reduce unrelated code while preserving the failure. Keep the result as a regression test once the cause is fixed.

Fragment

main.ts
Follow appearance
GitHub Light
GitHub Dark
Rosé Pine
Catppuccin Mocha
VS Code Dark+
reproduce → narrow → inspect → change → rerun
retain the failing input or seed