Hacker News new | ask | show | jobs
by igouy 396 days ago
> … other control flow features like "redo", "retry", "next", "rescue", "finally", and others.

At-a-glance afaict Smalltalk provides those features too, so I would guess Smalltalk blocks may have access to the call stack too?

https://drcuis.github.io/TheCuisBook/The-Debugger.html

1 comments

Yes Smalltalk has continuations. So it can do all of those things as well. But I don't think they're explicitly tied to blocks like they are in Ruby. This really isn't a problem for Smalltalk since it's not as syntax oriented as Ruby.

The invovation is to have those features tied to convenient syntax.

So is the innovation to make something that was available in Lisps / Smalltalks, available within the different constraints of Ruby.

(I should check how Smalltalk blocks behave.)

I would say more broadly the innovation was two fold: 1) to make these features available in a syntactic form that would seem more familiar to programmers and 2) the powerful insight that when combined with Smalltalk style meta programming you can have a language that on the surface seems very conventional but underneath is just as powerful as Smalltalk or Lisp.

Although I would say he didn’t get 100% there although that this point Ruby isn’t too far from that.

These are ideas that I think are worth trying to take even further. In fact, I’ve been experimenting with that.

fwiw "Efficient Implementation of Smalltalk Block Returns"

https://wirfs-brock.com/allen/things/smalltalk-things/effici...

I’ll check it out. Thank you.