David Beazley - Lambda Calculus from the Ground Up - PyCon 2019

  Рет қаралды 47,452

PyCon 2019

PyCon 2019

Күн бұрын

"Speaker: David Beazley
These days, programming style guides are all the rage. However, what if your style guide was so restrictive that it only gave you single-argument functions and nothing else? No modules, no classes, no control flow, no data structures, and not even any primitives like integers or regular expressions. Just functions. Could you actually program anything at all? Surprisingly, the answer is yes. In this tutorial, you'll learn how as you work through a ground-up derivation of the lambda calculus in Python.
You will learn nothing practically useful in this tutorial. No packaging. No tools. No libraries. No deployment. No magic Python programming techniques. And certainly learn nothing you would ever want to apply to a real project. You will, on the other hand, have a lot of fun, be completely amazed, and learn some foundational computer science that is a jumping off point for further explorations of functional programming, type theory, programming languages, and more.
Slides can be found at: speakerdeck.com/pycon2019 and github.com/PyCon/2019-slides"

Пікірлер: 68
@TheEntireUniverse
@TheEntireUniverse 5 жыл бұрын
He should do a tutorial on how to customize his environments to do this stuff.
@PGouges35
@PGouges35 5 жыл бұрын
I live for these tutorials. David Beazley is my personal Jesus
@CucuExploziv
@CucuExploziv 4 жыл бұрын
I'd compare him to Moses - spliting the fog of your mind!
@jiamingsun1701
@jiamingsun1701 5 жыл бұрын
The talk continues at 1:43:50
@pahvalrehljkov
@pahvalrehljkov 3 жыл бұрын
its official, im gonna search whole web for david beazleys videos...
@m.h.7121
@m.h.7121 3 жыл бұрын
Yoo, i am not joking at all, David beazley should be nominated as a lord of the python universe. No way the amount of knowledge he has. I am not surprised at all since he started programming at something around 11 years old. What an absolute legend. I always wished i knew programming at an early age of my life. Hopefully, i am still in my 20's. Holy Jesus freak, this guy is the lord of the rings. Anyway, i hope y'all doing great during this shitty pandemic time and shit. Have a good day/night.
@gpk6458
@gpk6458 4 жыл бұрын
Man, this was so much fun to follow along to. I don't think my brain will be done processing this for a while. That kid with the high-pitched voice is very annoying, though.
@plectro3332
@plectro3332 2 жыл бұрын
Hands down best Lambda Calculus tutorial out there
@malikrumi1206
@malikrumi1206 5 жыл бұрын
"... have a lot of fun, be completely amazed, and learn some foundational computer science that is a jumping off point for further explorations of functional programming..." IS practical and useful !!!
@SKyrim190
@SKyrim190 4 жыл бұрын
For some reason his intonation cracks me up!
@x87-64
@x87-64 2 жыл бұрын
This was totally insane. He is a brilliant teacher.
@MatthiasBlume
@MatthiasBlume 8 ай бұрын
To me the best way to understand what that R function is goes as follows: Suppose you have some slightly crappy version of factorial, call it crappyfact that only works for arguments 0 ... N for some number N, but not for arguments bigger than N. Then R(crappyfact) returns a slightly improved version of factorial - slightly less crappy, because it will work for arguments up to N+1. The actual perfect fact is a fixpoint of R because R cannot improve it further. As a matter of fact (no pun intended), this fixpoint is the so-called LEAST fixpoint. It is the "least crappy" version of factorial that cannot be further improved by R.
@thanasiosmetallidis5642
@thanasiosmetallidis5642 3 жыл бұрын
The most interesting video I have ever seen. With this we can build a whole UNIVERSE starting to define the NOTHING ( The emptyness ). Am I write when I say that the definition of NOTHING is the begin of all there is. And that the execution ( instance ) of NOTHING is the creation of ALL
@matthewblott
@matthewblott 4 жыл бұрын
I've watched the first hour and my mind is blown.
@freddupont3597
@freddupont3597 5 жыл бұрын
Have not had so much fun in some time; mind suitably, and delightfully blown! :-) An afternoon well spent, thank you Mr Beazley!
@cheaterman49
@cheaterman49 4 жыл бұрын
Some things are really subtle AF: >>> THREE(FOUR)(incr)(0) 64 >>> THREE(FOUR(incr))(0) 12 I got stuck a while when implementing multiplication. It makes a lot of sense but is very hard to wrap your head around!!! EDIT: Explanation (to the best of my understanding...) - in the first case, we're creating a function that will call three times the "call four times" operator so that's 4*4*4 calls applied to the function, while in the second one we're creating a function that will call four times incr and then we call that function three times, so 4+4+4 calls. EDIT2: Also, to the best of my understanding, there's no easy/good way to reuse ADD to implement MUL - but I'd love to be corrected with an example. :-) EDIT3: Well Tenchi below did it :-) I do stand corrected!
@StefanoBorini
@StefanoBorini 5 жыл бұрын
This lecture broke my brain
@billcolak5253
@billcolak5253 3 жыл бұрын
david beazley is my spirit animal.
@varunpatkar501
@varunpatkar501 3 жыл бұрын
I came here after i failed to solve a codewars question about this topic and now i'm really interested about this
@x87-64
@x87-64 2 жыл бұрын
You just started the journey into the deepest rabbit hole
@2xhTenchi
@2xhTenchi 5 жыл бұрын
When following the course and trying to implement things before David shows how to do them, I came up with a multiply that doesn't involve an F and makes more sense to me: MUL = lambda x: lambda y: y(ADD(x))(ZERO) We repeat y times "ADD(x)" to ZERO
@jlhidalgo
@jlhidalgo 4 жыл бұрын
The "easy" way for me to understand natural numbers in lambda calculus, that makes all this much simpler, is to think that we are defining "once", "twice", "thrice" etc. and using those concepts to represent "one", "two", "three", etc. Then "sum a b" actually means "do a and then do b", as in "do twice and then once more to the result", which equals "do tree times". And "mul" is "do a to b, and then apply it", like in "do twice to twice, and apply that", which equals "do four times". Thus the additional lambda in David's definition of mul is (somehow) obvious.
@cheaterman49
@cheaterman49 4 жыл бұрын
Hehehe, I was looking for this, thanks!
@x87-64
@x87-64 2 жыл бұрын
I came up with the same. We can do Power in a similar way. POW = lambda n: lambda m: m(MUL(n))(ONE)
@mikelezhnin8601
@mikelezhnin8601 5 жыл бұрын
The recursion magic broke me.
@SKyrim190
@SKyrim190 4 жыл бұрын
That was really insightful, specially the way he described the Y-combinator. It made complete sense. I would suggest anyone who already knows basic lambda calculus to jump to around 2:30:00 though
@boomiboom3900
@boomiboom3900 2 жыл бұрын
Wuuuuuut This is like the most amazing math thing ive ever seen.
@oxereviscerator
@oxereviscerator 3 жыл бұрын
Incredible.
@amelemara4615
@amelemara4615 5 жыл бұрын
Damn, that's some really out there python.
@calebgindelberger3046
@calebgindelberger3046 4 жыл бұрын
I'm almost glad I wasn't there, guessing my yelling "zero is false!" Wouldn't have gone well
@MatthiasBlume
@MatthiasBlume 8 ай бұрын
Simplification: You don't have to modify ISZERO and you can use the normal TRUE and FALSE. You would still pass thunks as second and third arguments to ISZERO, and then you invoke the thunk at the end after ISZERO returns: lambda n : ISZERO(n)(lambda dummy: ONE)(lambda dummy: MUL(n)(FACT(PRED(n))))(TRUE) (The last TRUE is the dummy argument and could be anything.)
@DeanLa
@DeanLa 4 жыл бұрын
How does he do the code with slide next to it?
@_intruder
@_intruder 2 жыл бұрын
I've never felt so excited to implement a SUCC, let me tell you.
@michellethalakottur9328
@michellethalakottur9328 3 жыл бұрын
awesommeee
@freddupont3597
@freddupont3597 5 жыл бұрын
ISZERO(CONS(2)(3)) --> ) too.
@aaronhall8039
@aaronhall8039 5 жыл бұрын
Very large gap from 1:20:00 to 1:42:00
@section9999
@section9999 3 жыл бұрын
anybody know where that mind blown meme is from in the image @1:09:00? Its so common I kind of want to see the original video. Was it for like a mediation guru thing or something like that?
@mehoyminoy9224
@mehoyminoy9224 3 жыл бұрын
Tim and Eric's "The Universe"
@section9999
@section9999 3 жыл бұрын
@@mehoyminoy9224 Dude awesome, thank you. 😜
@raghavatreya4533
@raghavatreya4533 5 жыл бұрын
Presentation material link??
@rohithill
@rohithill 5 жыл бұрын
What setup is he using? What is he writing his code in along with presentation?
@StankyPickle1
@StankyPickle1 5 жыл бұрын
Is it Christmas already?!
@kurianbenoy9369
@kurianbenoy9369 5 жыл бұрын
Low audio
@caballopalido
@caballopalido 2 жыл бұрын
WHATEVER GENIUS WAS IN CHARGE OF THE DYNAMIC RANGE OF THIS RECORDING... A CURSE ON YOUR FAMILY
@allenstevens4216
@allenstevens4216 5 жыл бұрын
As soon as you can build a not gate with a function, you can build all circuits, as soon as you can build all circuits you can build a computer, etc etc etc. I don't know how many people minecraft before, but you can build entire computers that run code and software and decision trees inside the game, with nothing more than a not gates, thousands of them. So.... I'm done screaming at the video... But I see where this is going.
@calebgindelberger3046
@calebgindelberger3046 4 жыл бұрын
You get NOR and NAND really early, so full logic is easy and proveable
@omega82718
@omega82718 4 жыл бұрын
Minecraft is Turing-complete so yeah
@clementdato6328
@clementdato6328 2 жыл бұрын
This is not what the video means. When you are talking about binary coding, you talk about an external interpretation of the binary code. In the intrinsic fashion, the ONE defined in there is fundamentally different from the one the you build by stacking up a computer based on the logical gates that he made. The one is the only one, the ONE in that universe. That’s also why the iszero does not work. True False cannot be intrinsically determined. Equality and so on relies on an external interpretation.
@poojanpatel2437
@poojanpatel2437 5 жыл бұрын
that stupid guy at 30:00
@gpk6458
@gpk6458 4 жыл бұрын
He's very annoying all the way through. He's listening to a talk on lambda calculus and how to do logic using nothing but functions and thinks to himself "I wonder if this guy knows about truth tables?" Something you learn in day one of computer science...
@cronaut5429
@cronaut5429 4 жыл бұрын
I don't remember the last time I actually wanted to punch someone in the face, but, somehow, he evoked this feeling in me without me ever seeing that face.
@MrHaste12
@MrHaste12 4 жыл бұрын
@@gpk6458 The way he comments on every single thing is like he thinks he's got a private lesson with Beazley
@amyfalconer1660
@amyfalconer1660 4 жыл бұрын
@@MrHaste12 That guy is killing me right now. His commentary totally breaks the flow. I'm not trying to be mean, as I'm sure he'd feel awful reading this, but geez louise.
@sssveny
@sssveny 3 жыл бұрын
He’s so rude at 1:51:10 basically saying “i don’t find this interesting, can you move on?”
@jeffschlarb4965
@jeffschlarb4965 4 жыл бұрын
github.com/PyCon/2019-slides is 404
@jungjunk1662
@jungjunk1662 2 жыл бұрын
He is confused a bit
@CrapE_DM
@CrapE_DM 5 жыл бұрын
That's not how an electrical switch works... The middle one supplies the power, and the switch decides which of the two sides receives the power.
@crimsun7186
@crimsun7186 4 жыл бұрын
That's only if the switch is a SPDT switch. What David is probably thinking of a SPST switch, which only has two contacts.
Reuven M. Lerner - Practical decorators - PyCon 2019
29:12
PyCon 2019
Рет қаралды 40 М.
The Noodle Stamp Secret 😱 #shorts
00:30
Mr DegrEE
Рет қаралды 66 МЛН
Super sport🤯
00:15
Lexa_Merin
Рет қаралды 16 МЛН
The best home workout !! 😱😱
00:27
Tibo InShape
Рет қаралды 12 МЛН
Raymond Hettinger «Build powerful, new data structures with Python's abstract base classes»
1:02:01
Видео с мероприятий {speach!
Рет қаралды 35 М.
Lambda Calculus - Computerphile
12:40
Computerphile
Рет қаралды 998 М.
The Mental Game of Python - Raymond Hettinger
1:10:00
SF Python
Рет қаралды 122 М.
Lambda Calculus!
9:51
Truttle1
Рет қаралды 48 М.
Essentials: Functional Programming's Y Combinator - Computerphile
13:26
Lambda Calculus: PyCon 2019 Tutorial (Screencast)
3:01:57
David Beazley
Рет қаралды 26 М.
The Noodle Stamp Secret 😱 #shorts
00:30
Mr DegrEE
Рет қаралды 66 МЛН