
Whiteboard problems in pure Lambda Calculus (2017) - jesperht
https://www.jtolio.com/2017/03/whiteboard-problems-in-pure-lambda-calculus/
======
ptero
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.

However, to me, this post was hard to read. Wikipedia
[https://en.wikipedia.org/wiki/Lambda_calculus](https://en.wikipedia.org/wiki/Lambda_calculus)
provides a much better introduction: from informal motivation to formal
descriptions. My 2c.

~~~
PopeDotNinja
I want to budget cognitive learning cycles to learning lambda calculus, but
I've tried superficially a couple of times and couldn't find a practical
reason to do so. Prioritizing picking up a more nuts & bolts skill has always
seemed more engaging and lucrative. If I already know some Lisp-ish stuff from
languages I already know, is there some benefit to picking up Lambda Calculus
that isn't super obvious?

~~~
ptero
Just my 2c -- maybe not, this is just a way of thinking about problems that
might come handy in some usually unexpected way. Also, it could be cool to
mumble to your geek friends on use cases of alpha conversion and beta
reduction.

Seriously though, I do not know Lisp, but if you know OCaml you probably have
a good feel for lambda calculus just from practical application of the
language. My 2c.

~~~
PopeDotNinja
Learning OCaml is something I've wanted to do. I'll add this to the list of
reasons to learn it :) Thanks!

------
gexla
I stopped reading after...

(λ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?.(λ/.(λ%.(λ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)))))

------
juliangamble
_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._

~~~
snaky
The logical way forward is then to _actually just hiring a candidate as a
short term contractor for a week or two to solve real work problems on site,
in a team with other employees and see how that goes_.

~~~
Tharkun
Yeah. Because a programmer in a new team is likely to be productive after a
week or two. /s

~~~
naasking
In my experience, good and bad candidates differentiate themselves pretty
quickly. Being productive is not the expectation, it's about gathering more
empirical data on the candidate's actual skills with real development.

~~~
Tharkun
Which is a really awful way of hiring. Forcing someone to go through the
hassle of being a contractor for a couple of weeks, only so you can decide
whether you want to hire them afterwards. I suggest you don't try this in
Belgium, where employee protection is a thing and this sort of nonsense
doesn't fly.

Unless, of course, you're looking for a long term contractor and not an
employee.

~~~
naasking
What exactly is nonsense about it? They get paid for part-time work they
otherwise would have to do for free during an interview or as homework.

~~~
Tharkun
Everything is nonsense about it. In most parts of the world, setting up to be
a contractor (as opposed to an employee) is a hassle with various implications
(tax, retirement, insurance,..). Doing it for a couple of weeks as part of a
hiring process? Get real.

Getting someone to do actual work during an interview is also a no-no. As soon
as someone walks through your door and you ask them to do actual work, they're
your employee, period. They are now automatically entitled to compensation and
a minimum severance period. You can interview people in almost any way you
want, but as soon as it involves doing actual work, you're toast. This may be
different where you live, but it strikes me as being unethical at the very
least.

Hiring is hard. But exploiting people (by expecting them to do actual work,
homework, forcing them into temporary contracting) is not the answer.

------
lapinot
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't create your own functions). Bonus: since iota/jot/zot only have 1 symbol
+ application, programs are binary trees (with the combinator in the leaves)
which we can write in prefix order as "1" for leaf and "0<program><program>"
for node. And now (modulo some io details) we have a cool language where any
bitstring is a valid program.

[1]
[http://www.nyu.edu/projects/barker/Iota/zot.html](http://www.nyu.edu/projects/barker/Iota/zot.html)
[2]
[https://en.wikipedia.org/wiki/Iota_and_Jot](https://en.wikipedia.org/wiki/Iota_and_Jot)

------
GGfpc
Every day I feel amazed at how much smarter other people are.

~~~
akullpp
Lambda calculus is simple and easy to understand. I learnt it in university
from scratch and I think that everybody can do it. Set theory has a quite
similar, manageable, learning curve.

~~~
_emacsomancer_
And set theory and lambda calculus have nice 'interoperability' (e.g.
λx[Dog(x)] is a characteristic lambda function for the set {x | x is a dog}.)

------
dang
Previously at
[https://news.ycombinator.com/item?id=13914004](https://news.ycombinator.com/item?id=13914004).

------
lisper
Factorials in pure lambda calculus, compiled to native code and running in
non-geological time:

[http://www.flownet.com/ron/lambda-
calculus.html](http://www.flownet.com/ron/lambda-calculus.html)

------
calebm
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?

~~~
nisa
not a good student, can't give you a good overview but this kind of blew me
away:
[https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspon...](https://en.wikipedia.org/wiki/Curry%E2%80%93Howard_correspondence)
\- you also can explain the y-combinator from first principles. Not sure how
practical that is :)

