Lisp's Influence on Ruby

(blog.tacoda.dev)

142 points | by tacoda 3 days ago

6 comments

  • evw 52 minutes ago
    For folks that want all of this plus macros (and a lot of other great things), check out Elixir.
    • ashton314 39 minutes ago
      100% Elixir is much more a Lisp than Ruby is.
  • danlitt 1 hour ago
    > He’s described Ruby’s design as starting from a simple Lisp, stripping out macros and s-expressions

    Put the macros back! It would be so cool!

    • KerrAvon 37 minutes ago
      You kind of don't need them in Ruby, because everything is a method or an object or a closure and you can dynamically create and alter those at runtime. That's why Ruby is really good for ad-hoc DSLs in ways that Rust and Swift really are not.
  • dismalaf 1 hour ago
    I love Ruby, use it for most of my projects that don't require performance.

    Nothing I would love more than a Ruby with a Common-Lisp like compiler and runtime. Unboxed types, native compilation, partial compilation, live image (Ruby has this but "faster Rubies" like Crystal don't), etc...

    • rjsw 1 hour ago
      ... or just use Common Lisp.
      • dismalaf 1 hour ago
        Which is what I do. One can dream though right? Of a world where Ruby stayed just a tad more Lisp-y and less Perl/C/Smalltalk/Unix-y.

        Also I'm working on a DSL/Macros that give me more Ruby-esque quality of life things in Lisp.

  • pjmlp 2 hours ago
    That is actually Lisp influence on Smalltalk, and Perl, that eventually influenced Ruby.
    • 0xpgm 2 hours ago
      From the article

      > Matz has said as much. He’s described Ruby’s design as starting from a simple Lisp, stripping out macros and s-expressions, then adding an object system, blocks, and Smalltalk-style methods. The features most Rubyists fall in love with aren’t the object-oriented ones. They’re the functional ones, dressed in friendlier clothes.

      • wglb 1 hour ago
        But macros and s-expressions are two of my favorites parts of lisp!
        • dismalaf 1 hour ago
          Funny enough Lisp was originally meant to be written in a higher level syntax (with infix operators and everything).

          But yeah, macros and S-expressions make it easier to write your own DSLs.

          • pjmlp 31 minutes ago
            With decades later, Dylan and Julia becoming the only ones that kind of managed to get some adoption doing it.

            For better or worse, parenthesis aren't that bad with the proper IDE tooling.

    • Smalltalker-80 2 hours ago
      Totalle agree, I just googled it: "Yukihiro 'Matz' Matsumoto heavily credits Smalltalk as the deepest structural inspiration behind Ruby’s object model. He combined Smalltalk’s beautiful object-oriented architecture and message-passing system with features from other languages to create a tool designed primarily for developer happiness." Including the closures and collection operations.
      • riffraff 1 hour ago
        "Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people."

        (Matz speaking at the LL2 conference some 20+ years ago)

    • dragonwriter 2 hours ago
      No, its actual influence from Lisp-family languages (including Scheme). Yes, Lisp also influenced Perl and Smalltalk, but Matz was not ignorant of Lisp with the only influence om Ruby from Lisp being indirect through those other languages.
  • DonHopkins 1 hour ago
    What have the Lisps ever done for us?

    https://www.youtube.com/watch?v=Qc7HmhrgTuQ

    • BoingBoomTschak 43 minutes ago
      Always fun to remind grugs that LISP invented "if" and GC.
  • tug2024 2 hours ago
    [dead]