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
Fast, opinionated, and built for the cloud era, Go trades Ruby's expressiveness for simplicity and raw speed.
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 aroundThe 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 that built the world. Understanding C illuminates Ruby itself, and just about everything else.
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-enforcedThe 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.
Demanding but deeply rewarding, Rust proves memory safety and bare-metal speed aren't in opposition.
Apple's modern language. Optionals, protocols, and value types make safety and expressiveness first-class.
JavaScript with a type system, TypeScript is able to catch whole classes of bugs before they ship, without abandoning dynamism.
Optimal software with no hidden control flow. Like C but with memory safety, error handling, and compile-time code execution built in.
A 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.
Pure, 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 handleThe 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 doC++ 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 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 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 superFunctional-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 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)The 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 syntaxPython 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 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) subtypingThe 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(...) syntaxFunctional 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 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 captureThe 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 factorialGodot's native scripting language, and the natural next engine for a DragonRuby developer β dynamically typed like Ruby, Python-flavored in syntax, with the game's structure living in a retained tree of nodes rather than in one tick function.
args.state every tick; Godot gives you persistent nodes you mutate in _process(delta)died and anything can subscribe, replacing the flag you would poll every tickyield β behavior is passed as a Callable (func(x): return x * 2) and invoked with .call()raise, no rescue; failures come back as error codes or sentinel values that every caller checksvar speed := 200.0 is checked when the script loads and compiles to faster bytecode, which matters at 60 frames a secondmatch is real pattern matching, destructuring arrays and dictionaries much like Ruby 4's case/inA fast, friendly, purely functional language from Richard Feldman β no garbage collector, no lifetimes, no nulls: memory is managed by compile-time reference counting, and all I/O is delegated to a host "platform" written in another language.
! suffix (main!, echo!), so purity is visible in every signaturematch β the compiler catches every unhandled caseTry type replaces both nil and exceptions β every fallible operation returns Ok or ErrThe original BEAM language, born at Ericsson for telephone switches that must never stop β Erlang made lightweight processes, message passing, supervision, and hot code reloading mainstream decades before anyone called it "the actor model."
A delightful language for reliable web applications β Elm is a pure functional language that compiles to JavaScript, famous for producing no runtime exceptions in practice and for compiler errors so helpful they read like a friendly tutor.
The widest gap on this site, and worth crossing once. Odin takes away the garbage collector, objects, blocks, exceptions, and metaprogramming β and hands you the machine, plus an implicit context that makes manual memory genuinely pleasant.
defer delete(...) beside every allocation, or an arena that drops a thousand of them in one call.select.map.sum becomes one loop β the biggest day-to-day adjustment, and the one that stops allocating intermediate arraysor_return forwards them without the pyramid of checkscase that quietly matches nothingmethod_missing, no open classes, no define_method β every call is resolved before the program startsA shell whose pipelines carry structured data, Nushell will feel less like Bash and more like Enumerable β ls | where size > 1MB | sort-by modified is a typed query, not text mangling.
ls returns queryable rows rather than lines to parsewhere, select, sort-by, group-by, reduce β an Enumerable vocabulary at the shell promptlet bindings by default, so swapping each for par-each is all it takes to go parallel3kB and 1min + 30sec are values, not strings to re-parse--flags, and help text generated from commentsfrom json, from csv, parse β every format decodes into the same data model, which is why curl | jq largely disappearsThe Erlang VM with a Ruby-inspired syntax, Elixir makes fault-tolerant, massively concurrent systems approachable β and beautiful.
What your code actually becomes. x86-64 assembly removes the three things every other language on this site provides and never mentions: types, named local variables, and a standard library. What is left is sixteen registers, a flat array of bytes, and a calling convention everyone has agreed to obey.
& gets the addresswrite syscall, and turning a number into text is a division loop you write yourselfcmp is a subtract that keeps only the flagsrecord.score and values[index] both vanish into a single instructionLook Forward To
The original programmable programming language, Common Lisp's macro system lets you reshape the language itself β a power Ruby's metaprogramming only approximates.
The language that defined object-oriented programming, Smalltalk's ideas live inside every Ruby method call, block, and open class.