Skip to content
DevMeme
4436 of 7590
Languages Post #4862 · source on Telegram

From Lua Tables To Haskell Typeclasses: The Spectrum Of Type Safety

Description

Vertical four-panel meme titled "What Languages Say about Type Safety." Panel 1 shows a relaxed person leaning back with feet on a desk; the Lua logo is overlaid and text reads, "Why not make everything a table." Panel 2 has a meditating figure by a stream with the JavaScript logo and the caption, "Mismatched types? dont worry, we have implicit conversions for anything. If that doesn't please you, try my younger brother Typescript." Panel 3 depicts a sharply dressed individual adjusting a suit; the C++ logo sits above the line, "Whilst compatibility with C is preferred, we view it neccesary to add extra security that plain C does not provide." Panel 4 features a confident businessperson; a purple lambda (Haskell) logo accompanies, "With our complex and strict typesystem, you may enjoy maximal safety with much expressiveness. Enjoy our multiple math inspired typeclasses where even actions are types." The meme humorously contrasts dynamic versus static typing philosophies, implicit coercion, backward-compatibility trade-offs, and advanced type theory - all familiar pain points for seasoned language polyglots

Comments

13
Anonymous ★ Top Pick If your architecture review sounds like this meme, congratulations - you’ve accidentally built a microservice zoo where each service demands its own definition of "int" and Lua’s already suggested storing the whole thing in one giant, totally-type-safe™ table
  1. Anonymous ★ Top Pick

    If your architecture review sounds like this meme, congratulations - you’ve accidentally built a microservice zoo where each service demands its own definition of "int" and Lua’s already suggested storing the whole thing in one giant, totally-type-safe™ table

  2. Anonymous

    The real type safety was the runtime errors we discovered in production along the way - because no matter how sophisticated your type system, someone will always find a way to pass null where it shouldn't go, and Haskell developers will still spend 3 hours explaining why IO Monad makes perfect sense once you understand category theory

  3. Anonymous

    This perfectly captures the type safety spectrum: Lua's 'everything is a table' philosophy (until you need actual structure), JavaScript's infamous '[] + {} !== {} + []' shenanigans that spawned TypeScript as damage control, C++'s attempt to add guardrails to C without breaking 40 years of legacy code, and Haskell's 'if the compiler accepts it, it probably works' approach where you spend more time satisfying the type checker than solving the actual problem. The real irony? Each language's defenders will claim their approach is the only sane one, while the rest of us are just trying to ship features before the heat death of the universe

  4. Anonymous

    Type safety roadmap: Lua says everything is a table, JS says everything becomes a string eventually, C++ says everything is compatible with 1972, and Haskell says everything is a proof; ship when QED

  5. Anonymous

    Lua's 'everything's a table' meets JS's runtime roulette, C's pointer freedom, and TS's type Tetris - pick your poison for prod incidents

  6. Anonymous

    At scale, “type safety” usually means JS will coerce it, C++ will template it, Haskell will prove it, and your API will stringify it

  7. Deleted Account 3y

    Typeclasses are just better interfaces

    1. Deleted Account 3y

      Yes

  8. Deleted Account 3y

    > Haskell > complex typesystem Lmao

  9. @viktorrozenko 3y

    Yeah, Haskell type system is boss

    1. Deleted Account 3y

      idris

      1. @viktorrozenko 3y

        What's Idris?

  10. @dinoretro 3y

    Rust: I'm totally typesafe but you need to add some ancient hieroglyphs

Use J and K for navigation