4 ms·
> but weirdly you don't see things like implicit return that's been a thing in ruby since probably forever and it's one of the defining things about it
by weaksauce 4y ago
> but weirdly you don't see things like implicit return
that's been a thing in ruby since probably forever and it's one of the defining things about it
- ravi-delia 4y agoAnd Elixir, from both parents. Ruby is an odd duck in a lot of ways, being so lisp- and smalltalk-inspired. It also only has expressions- another functionalish feature that seems like a total no-brainer. Beyond Ruby though, we just aren't looking at a huge number of dynamic languages with these features.
- tmtvl 4y agoRuby might have taken that from Perl, which also implicitly returns the last evaluated statement in a subroutine.
- weaksauce 4y agoprobably did... ruby took a lot from perl... also took a lot from many other languages but perl probably the most
- lilith_of_debts 4y agoFun fact: Matz was a lisper prior to creating ruby. He even wrote an email client entirely in Emacs lisp. Not wrong that ruby took a lot from perl, but it was heavily influenced by lisp and smalltalk and I'd personally argue those are the two largest influences. It does seem that ruby was specifically designed to grab Perl programmers though. Several features match exactly.
- EFreethought 4y agoAnd maybe Perl got it from Lisp. It seems like the longer I am in software development, I find out that more and more things came from Lisp.
- wglb 4y agoAgree, but it did kind of borrow the format statement from Fortran.
- srcreigh 4y agoIt’s also a thing in Rust and other functional languages such as Haskell, Scala
- ravi-delia 4y agoAbsolutely, but not in dynamic languages. Elixir (well, and Erlang) and Ruby are the only non-lisp dynamic languages I'm aware of with the feature. It's not the only thing I like, but it's a major component of the "functionalish" features that I really like and mostly see attached to static functional languages. Rust is fairly mainstream, and I think a step in the right direction. Honestly I suspect that many people who like Rust actually just like a fast systems language with niceties like implicit return and iterators.
- weaksauce 4y agorust is interesting but also a decent amount of ruby folk went to rust... i have no clue if they were part of the building of rust or not but the bundler people went to rust and made the package manager for rust too. the OP was talking about dynamic languages... haskell and scala are not too surprising that they have implicit returns since they are functional paradigms foremost.
- culebron21 4y agoJulia has it as well.
- ravi-delia 4y agoI hear Julia is quite lisp-y in general, so that makes sense. I've been meaning to get around to it regardless- it seems like it could be a lot more ergonomic than relying on numpy.