Tail Call Optimization

  Рет қаралды 8,238

0612 TV w/ NERDfirst

0612 TV w/ NERDfirst

Күн бұрын

Пікірлер: 42
@cameronmackinnon9073
@cameronmackinnon9073 2 жыл бұрын
This is near enough the only effective introduction to this topic on the internet. Thank you!
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help :)
@包軟體工程之路
@包軟體工程之路 10 ай бұрын
This is the only video I found that best explain the topic!!! Thx A LOT
@NERDfirst
@NERDfirst 10 ай бұрын
Hello and thank you very much for your comment and for the super thanks! Very happy to have been of help =)
@blackswan2020
@blackswan2020 2 жыл бұрын
Most underrated programming channel I have come across so far! Super clear explanations -- thank you!
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you so much for your comment! Glad you like the video and the rest of my work =)
@lilitghazaryan3851
@lilitghazaryan3851 3 жыл бұрын
Thank you veeeery much for this video!!!! I’ve been seraching all this stuff anywhere, but only your video was that best one which could explain what I wanted exactly. Such a short but very meaningful video, excellent, thank you again:)
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help :)
@shoshonu7
@shoshonu7 10 ай бұрын
Unsung YT hero! ✨You're a legend, mate! 👑 One of my favourite videos of yours: Priceless for anyone interested in optimization as long as TCO is implemented in your programming language of choice.
@NERDfirst
@NERDfirst 10 ай бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@shimadabr
@shimadabr Жыл бұрын
That`s the best explanation on the subject i`ve seen so far. I was watching a couple of videos and yours have the best bottom-up explanation. Only thing i found lacking was some examples with popular recursive functions (like factorial or fibonacci sequence)
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you for your comment! Yeah that's a good point. Maybe I can revisit this topic sometime. General patterns and how to convert a regular recursive function into tail recursion bears further explanation.
@okay1904
@okay1904 4 жыл бұрын
excellent - Interesting. A good teacher with a good understanding of the topic. Never heard of it but now fully understood.
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@ballafolife19
@ballafolife19 4 жыл бұрын
Just saw your vid from 2014 about serialization. Very concise, and direct, and informative. I originally was searching for what pickling is in Python. You made serialization so easy to understand, that I was able to extract the info and relate it to Python pickle function even though you did not even mention it. Excellent job!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you very much for your comment! Glad you liked my work =D
@bywavy
@bywavy Жыл бұрын
Explanation was very clear. Props to you.
@NERDfirst
@NERDfirst Жыл бұрын
Hello and thank you very much for your comment! Very happy to be of help =)
@Jan_Jan_
@Jan_Jan_ 9 ай бұрын
Great explanation - thank you very much.
@NERDfirst
@NERDfirst 9 ай бұрын
You're welcome! Very happy to be of help :)
@SandeepKumar16
@SandeepKumar16 2 жыл бұрын
Thanks for this awesome content. Great illustrations. Simple is beautiful. All the best. 😊
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@s1n7ax
@s1n7ax 2 жыл бұрын
Bruh. This is a fabulous expiration
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you very much for your comment! Glad you liked the video =)
@tobyuchiwa
@tobyuchiwa 4 ай бұрын
Thanks for the good explanation bro
@NERDfirst
@NERDfirst 4 ай бұрын
You're welcome! Glad to be of help =)
@shivatejamulaveesala5491
@shivatejamulaveesala5491 Жыл бұрын
Tq for clear explanation.
@NERDfirst
@NERDfirst Жыл бұрын
You're welcome! Very happy to be of help =)
@saeedmirzaei1
@saeedmirzaei1 3 жыл бұрын
You are the one. Thank you so much.
@NERDfirst
@NERDfirst 3 жыл бұрын
You're welcome! Very happy to be of help =)
@jeffg4686
@jeffg4686 2 жыл бұрын
Great video. So, if a recursive function is tc optimized, does that mean that stack allocated memory for the function is only allocated once (and reused for all recursive calls)?
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! This may be implementation-dependent, but yes, that's the idea - Either repeatedly reuse or construct and destroy one call stack entry - As long as the entries don't stack up and "wait" for each other, you'll reap the benefits of the tail call.
@Eyetrauma
@Eyetrauma 4 жыл бұрын
Thanks for the overview, this is one of those terms I've certainly heard and had a vague familiarity with but this really brought it into focus. Given the rising popularity of functional composition I can see why being able to optimize deeply nested calls would be a real boon!
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! Yes, I was in the same position as you, this seemed vaguely familiar but I never looked into it until recently. And yes, it's only because I was delving into functional programming!
@samanator19
@samanator19 2 жыл бұрын
What would the memory complexity be?
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! This one is not so easy to discuss in a vacuum, without knowing what code was written in the function(s) involved. Having said that, the short answer is - The memory usage should be similar to if the program was written as iteration, using loops. For certain algorithms that, say, pass arrays around and duplicate them for each recursive call, this could mean space complexity improvements from O(n) or more to O(1), while certain algorithms may not have any space complexity benefits at all.
@billyburton123
@billyburton123 4 жыл бұрын
what software do you use to make your animations/powerpoint slides?
@NERDfirst
@NERDfirst 4 жыл бұрын
Hello and thank you for your comment! All animations in this video were made in PowerPoint.
@MohammadKamran-mo8pj
@MohammadKamran-mo8pj 5 ай бұрын
Thank you.
@NERDfirst
@NERDfirst 5 ай бұрын
You're welcome! Glad to be of help =)
@nyahhbinghi
@nyahhbinghi 2 жыл бұрын
Still unclear to me why you wouldn't have 25 call stacks in memory if you did recursion 25 times..I guess they are just clearing out local variables and the call stack early, is that it?
@NERDfirst
@NERDfirst 2 жыл бұрын
Hello and thank you for your comment! Assuming that tail call _optimization_ is indeed happening, then yes, the call stack entries can be overwritten or deleted once each instance of the function has finished running. You only need to keep track of how to return to the original code that called the function.
Tail Recursion Explained - Computerphile
16:05
Computerphile
Рет қаралды 177 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН
Cheerleader Transformation That Left Everyone Speechless! #shorts
00:27
Fabiosa Best Lifehacks
Рет қаралды 16 МЛН
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Compiler Optimization
11:33
0612 TV w/ NERDfirst
Рет қаралды 18 М.
What on Earth is Recursion? - Computerphile
9:40
Computerphile
Рет қаралды 750 М.
Object Oriented Programming vs Functional Programming
18:55
Continuous Delivery
Рет қаралды 765 М.
How to Sort Lists with Tail Recursion in Scala | Rock the JVM
20:06
CPU Pipelining - The cool way your CPU avoids idle time!
15:25
0612 TV w/ NERDfirst
Рет қаралды 12 М.
how NASA writes space-proof code
6:03
Low Level
Рет қаралды 2,4 МЛН
WHY IS THE HEAP SO SLOW?
17:53
Core Dumped
Рет қаралды 290 М.
Metaprogramming and JIT Compilers - A Brief Overview
15:59
VoxelRifts
Рет қаралды 30 М.
UFC 310 : Рахмонов VS Мачадо Гэрри
05:00
Setanta Sports UFC
Рет қаралды 1,2 МЛН