Hacker News new | ask | show | jobs
by pjmlp 4 days ago
That is actually Lisp influence on Smalltalk, and Perl, that eventually influenced Ruby.
5 comments

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.

But macros and s-expressions are two of my favorites parts of lisp!
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.

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.

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

Hell, even without [0], you can at least count the parenthesis by hand in a pinch. I remember seeing lots of crazy-awesome stuff done in AutoLisp by 'non-programmers', versus 'structure as spacing' in Python which really sucks if the Editor was designed to use the system default (probably non-monospaced, cause other products in the industry had dialogs that broke if you switched to a monospaced) font. [1]

[0] - but real talk parenthesis matching in an editor is a lifesaver

[1] - oooooold version of a very popular GIS product.

Reminds me of my first exposure to Lisp. It was in a survey course in my final year. This was using punched card input and output on a line printer. You could turn on paren counting, but it was clumsy at best. This was in 1970
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.
"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)

The article doesn't mention Perl at all but it did have some direct influences on Ruby.

Even Ruby's trailing blocks syntax are an homage to Perl's block list subroutines:

  # first Ruby example in article
  users.select { |u| u.admin? }.map(&:email)

  # using Perl's block list
  map {$_->email} grep {$_->is_admin} @users;
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.
Matz directly credits Lisp (through Emacs Lisp) as influence in the design of Ruby and its runtime, with Smalltalk influence on the language itself, and IIRC Perl as "what was popular and we tried to replace"