Комментарии:
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.
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.)
I've never felt so excited to implement a SUCC, let me tell you.
ОтветитьThis was totally insane. He is a brilliant teacher.
ОтветитьWuuuuuut
This is like the most amazing math thing ive ever seen.
Hands down best Lambda Calculus tutorial out there
ОтветитьTHIS IS FRUSTRATING HE DID THIS BULLSHIT ONE ARGUMENT FUNCTION RULE THEN HAS DONE NOTHING BUT BREAK IT. WHAT A GREAT SPEAKER. SO WORTHWHILE. THE CONSISTENCY. "WELL IT WORKS LIKE THIS IN PYTHON, BREAKING THE RULES OF COURSE." WOW OKAY THANKS. SO SMART
ОтветитьWHATEVER GENIUS WAS IN CHARGE OF THE DYNAMIC RANGE OF THIS RECORDING... A CURSE ON YOUR FAMILY
ОтветитьHe is confused a bit
Ответитьawesommeee
Ответитьdavid beazley is my spirit animal.
Ответить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
its official, im gonna search whole web for david beazleys videos...
ОтветитьIncredible.
Ответить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.
ОтветитьI came here after i failed to solve a codewars question about this topic and now i'm really interested about this
Ответить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!
How does he do the code with slide next to it?
ОтветитьI've watched the first hour and my mind is blown.
ОтветитьFor some reason his intonation cracks me up!
Ответить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.
ОтветитьI'm almost glad I wasn't there, guessing my yelling "zero is false!" Wouldn't have gone well
ОтветитьPresentation material link??
ОтветитьThis lecture broke my brain
ОтветитьThe recursion magic broke me.
Ответить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.
ОтветитьDamn, that's some really out there python.
Ответить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
Low audio
ОтветитьI live for these tutorials. David Beazley is my personal Jesus
Ответить"... 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 !!!
Ответить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.
ОтветитьWhat setup is he using? What is he writing his code in along with presentation?
ОтветитьISZERO(CONS(2)(3)) --> <function __main__.TRUE(x)>) too.
ОтветитьHave not had so much fun in some time; mind suitably, and delightfully blown! :-) An afternoon well spent, thank you Mr Beazley!
ОтветитьIs it Christmas already?!
ОтветитьHe should do a tutorial on how to customize his environments to do this stuff.
Ответить