Side-by-side, interactive cheatsheets for Pascal programmers
comparing Pascal to other languages. Every example runs live in your browser — no
setup, no installation.
Choose your own path by reordering languages
Pascal and C are contemporaries that made opposite bets — Pascal chose strong types and safe arrays; C chose flexibility and raw performance. C won the systems battle, but Pascal programmers will find the underlying model familiar: compiled, manual memory, no garbage collector, records that map directly to structs.
:= becomes = and = becomes == — the most common Pascal-to-C mistake; C silently lets if (x = 5) compile as an assignmentchar arrays terminated by '\0' — no length stored, no bounds checked; strcmp replaces = for comparisonsarray[10] on a 10-element array is undefined behavior, not a range errorswitch falls through by default — every case needs a break, unlike Pascal's case which exits automaticallyvar parameters become pointer parameters: procedure Swap(var a: integer) becomes void swap(int *a); callers pass &xstruct syntax mirrors record, but pointer field access uses -> instead of Pascal's ^.The "catch it at compile time" philosophy, carried to its logical extreme. Pascal and Rust both reject runtime surprises — but Rust extends the guarantee to memory: ownership and borrowing make use-after-free and data races compile errors, not segfaults discovered at runtime.
Dispose needed — ownership tracking drops heap allocations automatically when they go out of scope, with zero runtime overheadmatch guarantees you handle every variant and the compiler prevents accessing radius on a RectangleOption<T> replaces nullable pointers — None is a safe nil whose variant the compiler makes you handle before useResult<T, E> replaces exceptions — every error is an explicit return value; the ? operator propagates errors without hidden control flowTypeScript is Pascal's software great-grandchild — the same designer, Anders Hejlsberg, brought strong static typing back to the web the same way Pascal brought it to imperative programming in 1970. Union types, structural interfaces, optional parameters, and generics all trace back to Pascal-era ideas, now applied to the JavaScript runtime.
string | number | null) replace Pascal's variant records — the type system tracks which variant is active through control flow`Hello, ${name}!`) replace Format('%s', [name]) — interpolation built into the string syntax itselfclass Foo implements IBar.Free, no SetLength; JavaScript's garbage collector and dynamic arrays handle itC# is Pascal's direct software descendant — same designer, Anders Hejlsberg, three languages apart. Everything you love about Pascal (strong typing, explicit declarations, structured control flow) is here, plus garbage collection, LINQ, async/await, records, and a type system powerful enough to rival TypeScript's.
uses SysUtils ceremony — string formatting, generics, and collections are built into the language and stdlibWhere/Select/Aggregate replace manual loops for filtering, mapping, and reducing collectionsobj.Free calls; the runtime manages memory automaticallyrecord types with structural equality and with expressions — Pascal records finally get == for free{ get; set; } replace Pascal's separate getter/setter procedure pairsasync/await and Task<T> — concurrency Pascal programs have always lacked a clean story forBuilt for exact money math, not binary floating point. COBOL's PIC 9V9 fixed-point fields store decimal digits exactly — the opposite tradeoff from Pascal's binary Real, which is precisely why COBOL, not Pascal, runs the world's bank ledgers.
PIC 9V9 fixed-point decimal fields store money exactly — no IEEE 754 rounding error the way Pascal's Real always carriesprogram ... end. blockvar-parameter contract, just shared global WORKING-STORAGE fieldsrecord...end syntaxMOVE, not :=, is the assignment verb, and fixed-width PIC X(n) fields pad with trailing spaces where a Pascal string holds only its exact charactersUnusually close cousins from the same structured-programming era — with one sharp, genuinely new capability. Fortran and Pascal share almost the same numeric-type vocabulary and a near-exact parameter-passing correspondence, but Fortran treats an array as a first-class value you operate on directly, something Pascal has no equivalent for at all.
prices = prices * 0.9 scales every element in one statement, where Pascal always needs an explicit indexed loopsum(), maxval()/minval(), and where operate on entire arrays at once — a numerical toolkit with no Pascal parallel whatsoeverintent(in)/intent(inout)/intent(out) map almost exactly onto Pascal's plain/var/out parameter modes — one of the closest one-to-one mappings on the whole sitecharacter(len=n) is a genuinely fixed-width field that silently truncates, where Pascal's string grows and shrinks dynamically with no declared maximum at allimplicit none opts IN to what Pascal has always required by default — undeclared Fortran variables otherwise infer their type from their first letter, a historical quirk Pascal never hadtype with % field access is a close structural match to Pascal's record with . accessPascal's spiritual successor for high-stakes software — Ada adopted every good idea from Pascal and hardened it: subtypes with runtime enforcement, mandatory exception handling, and packages that enforce interface boundaries.
subtype Name is Base range Low..High; is Pascal subrange types, but with a better name and automatic runtime checking everywherein, out, and in out replace Pascal's var — the direction is explicit in the procedure signaturebegin ... exception when E => ... end; gives every block structured exception handling.ads) and body (.adb) — a stricter version of Pascal's unit interface/implementationtype Meters is new Float;) prevent accidental unit mixing at compile time(X => 0, Y => 0)) construct records without naming every field separatelyPascal, cleaned up and modularised — Wirth wrote Modula-2 to fix Pascal's worst rough edges: proper separate compilation, explicit import control, and a cleaner separation of functions from procedures.
FROM STextIO IMPORT WriteString, WriteLn; replaces Pascal's implicit writelnfunction keywordREPEAT...UNTIL loops work identically to Pascal'sSET OF Fruit, IN operator, union/intersection with +/*Where a Pascal programmer goes to stop describing the machine and start describing the problem. Ruby trades Pascal's static types, ahead-of-time compilation, and manual New/Dispose for a dynamic, garbage-collected world where every value — even an integer or nil — is an object with methods.
var block and no types — a variable springs into being on assignment and can hold any objectNew/Dispose, no try…finally to balance a Free; the runtime reclaims memorymap, select, each replace the index loops you write by hand in PascalInteger at runtime, and any object that responds to a method just works, with no shared interface to declareSetLength, no TDictionary to Create and Free