Side-by-side, interactive cheatsheets for Rubyists
exploring new languages. Every example runs live in your browserβno setup,
no installation, no context-switching.
Choose your own path by reordering languages
The closest major language to Ruby, Python shares Ruby's readable syntax and expressive idioms β a smaller leap than most, and dominant in data science and machine learning.
The language of the web, JavaScript is unavoidable, powerful, and capable of running almost anywhere.
this binding: a call-site-determined design that arrow functions exist to work aroundFast, opinionated, and built for the cloud era, Go trades Ruby's expressiveness for simplicity and raw speed.
JavaScript with a type system, TypeScript is able to catch whole classes of bugs before they ship, without abandoning dynamism.
Apple's modern language. Optionals, protocols, and value types make safety and expressiveness first-class.
The language that built the world. Understanding C illuminates Ruby itself, and just about everything else.
Demanding but deeply rewarding, Rust proves memory safety and bare-metal speed aren't in opposition.
Optimal software with no hidden control flow. Like C but with memory safety, error handling, and compile-time code execution built in.
The language behind Flutter, Dart brings sound null safety, async-first design, and ahead-of-time compilation to cross-platform development.
The pragmatic JVM language, Kotlin combines expressive syntax, null safety, and interoperability with Java β popular for Android and server-side development.
Typed Ruby β without leaving home. Crystal's syntax is so close to Ruby that reading it feels familiar from day one, but a static type system catches entire classes of bugs before the program runs.
String | Nil instead of String? makes nilability explicit and compiler-enforcedA modern Lisp for the JVM, Clojure brings immutable data, functional programming, and fearless concurrency to wherever Java runs.
A mature, versatile language from Microsoft, C# blends object-oriented and functional styles with a type system powerful enough to rival TypeScript's.
The language Rubyists most often encounter in enterprise work, Java makes explicit what Ruby hides β types, access modifiers, checked exceptions, and the full machinery of a statically typed object system.
Ruby's spiritual ancestor, Perl established many of the ideas Ruby refined β regex literals, postfix conditionals, CPAN, and the conviction that there's more than one way to do it.
The embeddable scripting language, Lua is the language inside Neovim, Redis, Nginx, and countless game engines β small, fast, and surprisingly deep.
The language of relational databases, SQL is the raw power beneath every Rails Active Record call β understanding it makes your queries faster, your data models clearer, and your debugging sharper.
.where, .joins, and .includes actually doPure, lazy, and relentlessly principled, Haskell enforces immutability and static typing so strictly that if your code compiles, it usually works.
IO, making code easy to reason about and testMaybe and Either replace nil and exceptions with types the compiler forces you to handleC++ is C with a full OOP tower on top β classes, templates, lambdas, the STL, and memory safety via RAII, all the way down to bare metal.
vector, map, sort, transform β Ruby's Enumerable, but statically typedstd::format, ranges, structured bindings, std::optionalThe shell every Rubyist already uses, Bash rewards understanding β the more you know, the fewer Ruby scripts you'll write for things the shell does natively.
${var:-default}, ${var^^}, ${var//old/new} β a mini-language for string manipulation$(( )) β integer math without spawning a subprocessThe language that runs the world's money, COBOL processes trillions of dollars daily β and its verbose, English-like syntax is unlike anything a Rubyist has seen.
PIC 9(7)V99 for a 7-digit decimalADD 1 TO COUNTER instead of counter += 1The original language of scientific computing, Fortran introduced arrays, subroutines, and floating-point arithmetic to the world β and still dominates supercomputing today.
prices * 0.9 discounts every element at oncemap version simultaneouslyThe English-readable .NET language that pioneered RAD β with static typing, LINQ, and the full .NET ecosystem.
If...Then...End If, For Each...NextAndAlso / OrElse short-circuit logic vs And / OrNothing for nil, Me for self, MyBase for superThe disciplined ancestor of modern programming β structured, strictly typed, and the language that taught a generation how to think algorithmically.
begin...end blocks instead of Ruby's implicit block delimitersvar block before any code runs:= for assignment, = for comparison β the reverse of every other languagediv for integer division; / always returns a real numberThe shell macOS ships by default, Zsh extends POSIX shell with powerful parameter flags, cleaner array handling, and a thriving plugin ecosystem β the Rubyist's daily driver.
${(U)var}, ${(j::)array}, ${(s::)string} β built-in join, split, and case conversion without external tools${fruits[1]} is the first element (unlike Bash's 0-indexed)typeset for all variable declarations β integers, read-only, namerefs, and associative arraysmatch[] array for regex captures β stores groups after [[ =~ ]] without Bash's BASH_REMATCHsetopt EXTENDED_GLOB β ^pattern negation and (a|b) alternation built into glob syntaxThe functional language that influenced Rust, OCaml combines Hindley-Milner type inference, algebraic data types, and first-class modules into a language that is both mathematically rigorous and practically fast.
let cannot be reassigned; mutation is explicit via refoption instead of nil: absence is a type-level guarantee, not a runtime surprise|> pipe operator (the original β F#, Elixir, and others adopted it from OCaml)Functional-first on .NET, F# combines immutability by default, expressive pattern matching, and the pipe operator into a language that makes data transformation feel natural.
|> pipe operator makes data pipelines read top-to-bottom β the idiomatic alternative to Ruby's method chaininglet bindings cannot be reassigned without the explicit mutable keywordOption and Result types replace nil and exceptions for expected failure pathsThe actor-model language with compile-time memory safety, Pony eliminates data races and garbage-collection pauses through its unique reference capability system β every object knows exactly who can read or write it.
iso, val, ref, box, tag, trn) make data races impossible by constructionval references are globally immutable, shareable across actors like Ruby 4.0's frozen strings β but enforced by the compiler?trait (nominal) and interface (structural) subtypingPython syntax with C-level performance, Mojo is a new systems language from the creators of LLVM that combines the familiarity of Python with zero-cost abstractions, SIMD, and compile-time metaprogramming.
def (Python-style, flexible) and fn (strict, typed, zero-cost)struct value types with explicit ownership β no garbage collector pausesfn process[size: Int](data: SIMD[DType.float64, size])raises annotations β the error contract is part of the type signatureThe logic programming language, Prolog has no loops, no variables in the imperative sense, no if/else β only facts, rules, and questions. You describe what is true, and the engine figures out the how.
append([1,2],[3,4],X) concatenates; append(X,Y,[1,2,3]) finds all splits[H|T]The language that powers a third of the web, PHP 8.x brings first-class types, enums, fibers, and match expressions to a language Rubyists will find surprisingly familiar.
attr_accessor plus initialize::from() and ::tryFrom() β first-class value types, not just constantsstrlen(...) syntaxThe minimalist Lisp dialect from MIT β lexical scope, first-class continuations, and a tiny core that fits on a postcard. The language behind SICP.
call/cc β capture the rest of a computation as a callable valuesyntax-rules β pattern-based code rewriting without variable captureFunctional meets object-oriented on the JVM β Scala blends immutable values, powerful pattern matching, and a rich type system into a language that scales from scripts to distributed systems.
val β Ruby's lack of enforced immutability is a Scala non-starterOption[A] replaces nil β absence is explicit in the type system, not a runtime surpriseflatMap/map/filter chains β monadic pipelines made readableThe modern systems language C never became, D adds a module system, garbage collection, ranges, built-in unit tests, and compile-time metaprogramming β without the weight of C++ history.
arr.filter!(x => x > 0).map!(x => x * 2) chains any function like a methodstd.algorithm and std.rangeunittest blocks and contract programming (in/out/invariant)Multiple dispatch taken to its logical extreme β Julia is a high-performance dynamic language designed for scientific computing, where functions dispatch on the types of every argument simultaneously.
. β any function or operator applied element-wise: sqrt.(numbers), x .^ 21:10, 1:2:10) follow mathematical convention@time, @show, and @assert macros for profiling, debugging, and validationArray programming taken to its extreme β APL reduces programs that would take dozens of lines in Ruby to a handful of symbols, operating on entire arrays at once without explicit loops.
2Γ1 2 3 4 5 doubles every element; +/ sums an array in one glyph2Γ3+4 is 14, not 10; there is no operator precedence(+/Γ·β’) is the average function with no variables{βΊ+β΅} adds two arguments; {β΅β€1:1 β β΅Γββ΅-1} is factorialLook Forward To
The Erlang VM with a Ruby-inspired syntax, Elixir makes fault-tolerant, massively concurrent systems approachable β and beautiful.
The language that defined object-oriented programming, Smalltalk's ideas live inside every Ruby method call, block, and open class.
The original programmable programming language, Common Lisp's macro system lets you reshape the language itself β a power Ruby's metaprogramming only approximates.