3 comments

  • Trung02463 hours ago
    Here&#x27;s a funny Z combinator in typescript in pure SKI form for lambda calculus purist:<p><pre><code> const K = &lt;A, B&gt;(a: A) =&gt; (_b: B) =&gt; a; const S = &lt;A, B, C&gt;(a: (x: C) =&gt; (y: B) =&gt; A) =&gt; (b: (x: C) =&gt; B) =&gt; (c: C) =&gt; a(c)(b(c)); const Z = S(K(S(S(K)(K))(S(K)(K))))(S(S(K(S))(K))(K(S(K(S(S)(S(K))))(S(S(K(S))(K))(K))))); </code></pre> <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fixed-point_combinator" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fixed-point_combinator</a>
  • p4bl02 hours ago
    I feel like introducing lambda calculus (using JS syntax) would be less cumbersome and convoluted than referring to &quot;the challenge&quot; without really justifying it and deferring to respect the rules for so long. But maybe some people entirely unfamiliar with these concepts find this approach easier?
    • the_other1 hour ago
      I found it extremely confusing.<p>It sets a challenge as a rhetorical tool, but then completely fails to honour the challenge through the bulk of the explanation.<p>- don’t use recursion: spends multiple paragraphs implying that a function calling itself isn’t recursion<p>- don’t use declaration: ignoring that defining arguments to a function is declaration<p>I’m not saying the article is “wrong”. But I thunk I’d have preferred a plain intro to lambda calculus.<p>(Writing this as someone who has struggled to learn “real” functional programming the few times I’ve tried over the past 20+ years, but who very much likes using RxJS and the functional flavour of lodash and wishes I could see deeper into that black hole.)
      • mrkeen53 minutes ago
        &gt; don’t use recursion: spends multiple paragraphs implying that a function calling itself isn’t recursion<p>It did the opposite. It wrote many paragraphs of code and threw each one out as soon as recursion showed up.
      • p4bl01 hour ago
        So it&#x27;s as confusing as I thought to do it that way. I wasn&#x27;t sure if I thought so because I&#x27;m already familiar with all these concepts or because this introduction is indeed convoluted. Thanks for taking the time to reply!
  • satvikpendem3 hours ago
    Good to see this in the second chance pool. Unfortunately I don&#x27;t think most commenters know what the article is about and thus we may end up with this submission leaving the front page quickly, a shame though as the YC namesake is from similar articles as these, a company that produces other companies, as Paul Graham had said.