TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Whiteboard problems in pure Lambda Calculus (2017)

87 pointsby jesperhtover 6 years ago

8 comments

pteroover 6 years ago
IMO Lambda calculus should be taught wider in CS programs. It brings useful models, builds (if one likes theory) good background to functional programming paradigms, etc.<p>However, to me, this post was hard to read. Wikipedia <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lambda_calculus" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Lambda_calculus</a> provides a much better introduction: from informal motivation to formal descriptions. My 2c.
评论 #17830313 未加载
评论 #17829535 未加载
评论 #17827607 未加载
gexlaover 6 years ago
I stopped reading after...<p>(λU.(λY.(λvoid.(λ0.(λsucc.(λ+.(λ*.(λ1.(λ2.(λ3.(λ4.(λ5.(λ6.(λ7.(λ8.(λ9.(λ10.(λnum.(λtrue.(λfalse.(λif.(λnot.(λand.(λor.(λmake-pair.(λpair-first.(λpair-second.(λzero?.(λpred.(λ-.(λeq?.(λ&#x2F;.(λ%.(λnil.(λnil?.(λcons.(λcar.(λcdr.(λdo2.(λdo3.(λdo4.(λfor.(λprint-byte.(λprint-list.(λprint-newline.(λzero-byte.(λitoa.(λfizzmsg.(λbuzzmsg.(λfizzbuzzmsg.(λfizzbuzz.(fizzbuzz (((num 1) 0) 1)) λn.((for n) λi.((do2 (((if (zero? ((% i) 3))) λ_.(((if (zero? ((% i) 5))) λ_.(print-list fizzbuzzmsg)) λ_.(print-list fizzmsg))) λ_.(((if (zero? ((% i) 5))) λ_.(print-list buzzmsg)) λ_.(print-list (itoa i))))) (print-newline nil)))) ((cons (((num 0) 7) 0)) ((cons (((num 1) 0) 5)) ((cons (((num 1) 2) 2)) ((cons (((num 1) 2) 2)) ((cons (((num 0) 9) 8)) ((cons (((num 1) 1) 7)) ((cons (((num 1) 2) 2)) ((cons (((num 1) 2) 2)) nil))))))))) ((cons (((num 0) 6) 6)) ((cons (((num 1) 1) 7)) ((cons (((num 1) 2) 2)) ((cons (((num 1) 2) 2)) nil))))) ((cons (((num 0) 7) 0)) ((cons (((num 1) 0) 5)) ((cons (((num 1) 2) 2)) ((cons (((num 1) 2) 2)) nil)))))
juliangambleover 6 years ago
<i>My team at Vivint, the Space Monkey group, stopped doing whiteboard interviews a while ago. We certainly used to do them, but we’ve transitioned to homework problems or actually just hiring a candidate as a short term contractor for a day or two to solve real work problems and see how that goes. Whiteboard interviews are kind of like Festivus but in a bad way: you get the feats of strength and then the airing of grievances. Unfortunately, modern programming is nothing like writing code in front of a roomful of strangers with only a whiteboard and a marker, so it’s probably not best to optimize for that.</i>
评论 #17826938 未加载
lapinotover 6 years ago
Extra weirdness with this turing-complete combinatory logic with only a single combinator [1,2]. Combinatory logic being like lambda-calculus but where are only allowed to use some predefined functions and function application (you can&#x27;t create your own functions). Bonus: since iota&#x2F;jot&#x2F;zot only have 1 symbol + application, programs are binary trees (with the combinator in the leaves) which we can write in prefix order as &quot;1&quot; for leaf and &quot;0&lt;program&gt;&lt;program&gt;&quot; for node. And now (modulo some io details) we have a cool language where any bitstring is a valid program.<p>[1] <a href="http:&#x2F;&#x2F;www.nyu.edu&#x2F;projects&#x2F;barker&#x2F;Iota&#x2F;zot.html" rel="nofollow">http:&#x2F;&#x2F;www.nyu.edu&#x2F;projects&#x2F;barker&#x2F;Iota&#x2F;zot.html</a> [2] <a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Iota_and_Jot" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Iota_and_Jot</a>
GGfpcover 6 years ago
Every day I feel amazed at how much smarter other people are.
评论 #17828291 未加载
评论 #17828247 未加载
dangover 6 years ago
Previously at <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13914004" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=13914004</a>.
lisperover 6 years ago
Factorials in pure lambda calculus, compiled to native code and running in non-geological time:<p><a href="http:&#x2F;&#x2F;www.flownet.com&#x2F;ron&#x2F;lambda-calculus.html" rel="nofollow">http:&#x2F;&#x2F;www.flownet.com&#x2F;ron&#x2F;lambda-calculus.html</a>
calebmover 6 years ago
Could anyone describe practical benefits to studying lambda calculus (other than, perhaps, to better understand the underlying concepts in LISP)? It seems kind of interesting because it is a way to describe what programs do with a very small number of building blocks. But why is it useful? What insights does it bring?
评论 #17831478 未加载