Join the discussion
Write your take first — we'll ask for email only when you're ready to publish.
- Hacker News
- As I read this, all of my favorite things about ruby compared to something like python were influenced by lisp. Ruby is a joy to program and it seems mostly due to design influence from lisp.by insumanth
- Most of the points listed are hardly considered lispy anymore these days, Python also has most of these.
Where Ruby's lisp lineage really shows is the fact that it's got Kernel#callcc, aka call with current continuation. It doesn't get any lispier than that!
by muvlon - > Both marks come from Scheme, where [...]
Reminds me of an email I wish I still had.
Circa 2000, I wrote that I was leaning towards moving to Scheme, for more rapid R&D work than I could do in Java.
Some nice-sounding person I didn't know emailed me from Japan, to mention a language I hadn't heard of, called Ruby.
I don't know whether the person was Yukihiro Matsumoto himself, but it's a small world.
by neilv - For folks that want all of this plus macros (and a lot of other great things), check out Elixir.by evw
- 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...
by dismalaf - I've never been more thoroughly convinced that I would like ruby more than from this article. I'm currently stuck reaching for python a lot of the time (absolutely love it tbc), but maybe it's worth changing things up and trying to give ruby a shot.
It was one of the first programming languages I was introduced to at 16 or so, but an older person that I looked up to told me it would get me stuck in "hobby coder land". He was wrong in so many ways, but even if he was right, I wanna have fun in my hobby code :)
by 0x3444ac53 - One way I find traditional Lisp style more painful for functional code than Ruby is that fully functional-style Lisp pushes me to read and write code the opposite way from how I think about it. In the author's example:
the equivalent Lisp code would either be written in imperative style as multiple statements that each write to a temporary variable or (let) binding, or would look like this:orders .select { |o| o.placed_at > 1.week.ago } .group_by(&:customer_id) .transform_values { |group| group.sum(&:total) }
where I now have to read from bottom to top to understand the order of operations on the `orders` record set, even though when I wrote the code earlier, I "logically" thought from first operation to last when deciding which high-level operations to use in which order.(reduce #'+ (map (lambda (o) (getf o 'total)) ; this group_by replacement function ; might be written as hash-table code (my-group-by 'customer-id (remove-if-not (lambda (o) (> (getf o 'placed-at) (- (my-now) (* 60 60 24 7)))) orders))))Other imperative languages that support functional code either make you do things imperatively to get the "logical" ordering of functional operations like I feel Lisp pushes you to do, or they do something like Ruby where things can be chained left to right in a "single" statement even for operations that were not thought of ahead of time by the creators of opaque data structures you later need to operate on. (Everything is a user-extensible object like Ruby, unified function call syntax in D, extension methods in C#, or pipelines of structured objects in PowerShell.)
by hyperrail - Now that I'm out of the corporate tyranny and have my own company, I use lisp for everything. There's certain satisfaction in writing config files and persisting data directly in s-expressions. Any json requirements are triggered by exports to foreign systems.by jksmith