8 comments

  • jksmith3 hours ago
    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.
    • atcol3 hours ago
      Which Lisp, out of interest?
    • Blikkentrekker1 hour ago
      That JSON prohibits trailing commata makes it an absolute pain to work with in practice.<p>I also like how in Haskell:<p><pre><code> something = { element , element1 , element2 , element3 } </code></pre> Is an actually idiomatic way to deal with the lack of trailing commata.
      • kazinator1 hour ago
        I did something like that in C++ circa 1998, before seeing it anywhere else:<p><pre><code> MyClass::MyClass(foo bar, int arg1, int arg2) : Base(bar) , member1(arg1) , member2(arg2) { }</code></pre>
  • evw4 hours ago
    For folks that want all of this plus macros (and a lot of other great things), check out Elixir.
    • ashton3143 hours ago
      100% Elixir is much more a Lisp than Ruby is.
  • hyperrail3 hours ago
    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 <i>the opposite way</i> from how I think about it. In the author&#x27;s example:<p><pre><code> orders .select { |o| o.placed_at &gt; 1.week.ago } .group_by(&amp;:customer_id) .transform_values { |group| group.sum(&amp;:total) } </code></pre> 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:<p><pre><code> (reduce #&#x27;+ (map (lambda (o) (getf o &#x27;total)) ; this group_by replacement function ; might be written as hash-table code (my-group-by &#x27;customer-id (remove-if-not (lambda (o) (&gt; (getf o &#x27;placed-at) (- (my-now) (* 60 60 24 7)))) orders)))) </code></pre> 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 &quot;logically&quot; thought from first operation to last when deciding which high-level operations to use in which order.<p>Other imperative languages that support functional code either make you do things imperatively to get the &quot;logical&quot; 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 &quot;single&quot; 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.)
    • evdubs2 hours ago
      Threading macros are nice, though, right?<p><a href="https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;threading&#x2F;introduction.html" rel="nofollow">https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;threading&#x2F;introduction.html</a>
      • whartung14 minutes ago
        They&#x27;re nice, but they&#x27;re not the same thing.<p>The threading macros are (as I understand it) pure sugar.<p>Turning (-&gt; (gather my-list) uppercase-list sort) into (sort (uppercase-list (gather my-list))).<p>In contrast to, say, Java (I can&#x27;t speak to the code above):<p><pre><code> List&lt;Things&gt; things = thingIds.stream() .map(model::findThing) .filter(Objects::nonNull) .toList(); </code></pre> These are streamed. This is pretty much a pipe structure, whereas the threading macros will create a lot of temporary copies of the data (I don&#x27;t know if that&#x27;s a universal truth). That is, if you&#x27;re processing a 1000 items, say `gather` returns a 1000 items, that 1000 item list is passed to `uppercase-list` which return a new 1000 item list to feed to `sort` which returns another 1000 item list (assuming none of these are destructive).<p>I wish CL had something like the Java streams (maybe it does).
    • Blikkentrekker1 hour ago
      I feel languages should just have some kind of sugar or operator for this, in fact in Ocaml the |&gt; operator exists where<p><pre><code> &lt;exp&gt; |&gt; &lt;exp2&gt; &lt;exp2&gt;(&lt;exp&gt;) </code></pre> Are just one and the same<p>For a variadic language you&#x27;d need something more involved though. But some kind of syntax can probably be invented in some language.
      • emidln1 hour ago
        It&#x27;s common to write the thrush combinator as a lisp macro. Clojure ships -&gt;, -&gt;&gt;, as-&gt;, some-&gt;, some-&gt;&gt;, cond-&gt;, and cond-&gt;&gt; out of the box. You can find similar macros for CL[0], Racket[1], and a scheme SRFI[2]. Writing them is a fun exercise in your lisp of choice if you don&#x27;t have a library available.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;dtenny&#x2F;clj-arrows" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;dtenny&#x2F;clj-arrows</a><p>[1] <a href="https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;threading&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;threading&#x2F;index.html</a><p>[2] <a href="https:&#x2F;&#x2F;srfi.schemers.org&#x2F;srfi-197&#x2F;srfi-197.html" rel="nofollow">https:&#x2F;&#x2F;srfi.schemers.org&#x2F;srfi-197&#x2F;srfi-197.html</a>
  • danlitt4 hours ago
    &gt; He’s described Ruby’s design as starting from a simple Lisp, stripping out macros and s-expressions<p>Put the macros back! It would be so cool!
    • KerrAvon3 hours ago
      You kind of don&#x27;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&#x27;s why Ruby is really good for ad-hoc DSLs in ways that Rust and Swift really are not.
      • bashkiddie16 minutes ago
        &gt; because everything is a method or an object or a closure<p>well, except for pattern matching. That is just syntax.
      • yxhuvud57 minutes ago
        Crystal don&#x27;t have the dynamicity but has macros to get the next best thing. Most meta magic in Ruby in good code are done at startup anyhow so you don&#x27;t miss out on that much. YMMV.
  • dismalaf4 hours ago
    I love Ruby, use it for most of my projects that don&#x27;t require performance.<p>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 &quot;faster Rubies&quot; like Crystal don&#x27;t), etc...
    • Syzygies1 hour ago
      I came close to adopting Scala, many parallels to Ruby with vastly better performance.<p>I&#x27;m Ruby or Lean 4.
    • rjsw4 hours ago
      ... or just use Common Lisp.
      • dismalaf4 hours 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&#x2F;C&#x2F;Smalltalk&#x2F;Unix-y.<p>Also I&#x27;m working on a DSL&#x2F;Macros that give me more Ruby-esque quality of life things in Lisp.
        • ralphc2 hours ago
          Common Lisp, and even more so Racket, has reader macros. With a little help from LLMs you might be able to get a Ruby-like language that translates into Lisp.<p>As a last resort look at Racket&#x27;s &quot;Rhombus&quot; language, it&#x27;s basically an infix, Python-like syntax on top of Racket. You can use that or see how they pull it off and add Ruby constructs to it.
  • pjmlp5 hours ago
    That is actually Lisp influence on Smalltalk, and Perl, that eventually influenced Ruby.
    • 0xpgm5 hours ago
      From the article<p>&gt; 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.
      • wglb5 hours ago
        But macros and s-expressions are two of my favorites parts of lisp!
        • dismalaf5 hours ago
          Funny enough Lisp was originally meant to be written in a higher level syntax (with infix operators and everything).<p>But yeah, macros and S-expressions make it easier to write your own DSLs.
          • pjmlp3 hours ago
            With decades later, Dylan and Julia becoming the only ones that kind of managed to get some adoption doing it.<p>For better or worse, parenthesis aren&#x27;t that bad with the proper IDE tooling.
    • Smalltalker-805 hours ago
      Totalle agree, I just googled it: &quot;Yukihiro &#x27;Matz&#x27; 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.&quot; Including the closures and collection operations.
      • riffraff4 hours ago
        &quot;Some may say Ruby is a bad rip-off of Lisp or Smalltalk, and I admit that. But it is nicer to ordinary people.&quot;<p>(Matz speaking at the LL2 conference some 20+ years ago)
    • dragonwriter5 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.
  • DonHopkins5 hours ago
    What have the Lisps ever done for us?<p><a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Qc7HmhrgTuQ" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=Qc7HmhrgTuQ</a>
    • BoingBoomTschak4 hours ago
      Always fun to remind grugs that LISP invented &quot;if&quot; and GC.
  • tug20245 hours ago
    [dead]