I can't tell whether you realize this or not, but the product of two symmetric matrices is not (in general) a symmetric matrix. The bottom formula at 4:36 is wrong. It is however true that the product of two symmetric matrices that commute is a symmetric matrix, which is why the approach works in practice. Great project though, keep up the good work 🙂
Reminds me of the time I solved the game where in their turn the players need to flip two adjacent pluses to minuses in a sequence. I wrote ridiculous parallelized fast-Fourier based bitset convolutions, only to realize that the answers became periodic, and then to learn about the Sprague-Grundy theorem. It was a good nerd snipe.
Genuinely the reason I prefer C over C++ is because I find it easier to write good C than good C++. Even if writing C requires more effort to do basic tasks, at least it keeps me from making lazy and costly decisions.
Every one of this videos has a lot of funny things but inside the video somewhere is an absolute banger of a meme. For this video it was "Look at how they mangled _ZN2my3boyE"
@@Davsan1 A lot of compilers “mangle” named functions into a unique identifier which looks like that, and is obviously not as human-readable. The original Godfather quote is “look how they massacred my boy.”
This entire video should be reference material at every uni course in existence, IMHO. "I'm just taking cheap shots at the hidden coefficient in the big-O" was damn near a _refrain_ . . . and yet, your algorithm became faster to a hilarious degree. Goes to show you that "the hidden coefficient" ain't hidden when it gets run on silicon.
It sure can be hard to be imperfect these days. Your humility and light heartedness are a breath of fresh air, not to mention that it can a lot easier to follow along with someone learning than someone teaching. I appreciate this for many reasons on multiple levels. I watched the first video the other day too. This is good content. I’m delighted and inspired, and the funny thing is that I barely care about the topic, but I’m hooked on the attitude. Keep it up, dude.
There is a much better way, just set the main() to be constexpr and the compiler will calculate the numbers in advance, the runtime will be super fast and continue until it breaks when the interger values overflow.
I have been casually programming for years and am an graduating in EE now, but videos like yours really make me want to get deeper into maths! Like I'm genuinely considering getting a math degree, just so I can learn how to abuse objects and numbers like you guys do.
Yeah mom i am watching sheafication of G pretending to understand what he is saying. It's like reading books when I couldn't read and looking only for the pictures.
What I appreciate about this video is that it goes to show that with modern hardware, that hidden constant can change so much from one implementation to another. For so many common scales, big O is almost useless, and even for the scales where big O is very important, that secret hidden constant remains VERY relevant.
1:54 - one thing to note - with the introduction of the debug statements, therefore custom (copy/move)constructors / (copy/move) assignment operators, the number is no longer "trivially copyable" (`std::is_trivially_copyable` will return false for it) if the `number` was before, and the compiler can't do a lot of optimizations anymore. Looking at assembly (with optimizations) when there are not the debug constructors / operators, the compiler won't even put the values into a memory, they will stay in registers and the copy/move is just mov instruction for trivially copyable types. And as someone who wrote (basic) compiler and studies compiler design: any at least a little bit reasonable compiler with turned on optimizations will "know" that the `tmp` is no longer used and will optimize it. And it goes even further, because even tho the assembly of the code has some mov instructions, these are in a lot of cases not even executed due to register renaming inside the CPU and are effectively no-op. Edit: try to compile it with clang if you are not using it already, LLVM is more modern and can vectorize code way better than GCC
I found your channel today's morning, watching this exact video, computing fibonacci numbers. I subscribed because your humor is top notch. Now you drop this. What in the matrix does youtube know?
Good job. I subscribed! This is what programming is all about! It’s what it’s always been about, behind the curtain. And it has literally been forgotten by most of us.
Code maintenance is what you really want to be studying. There was a time when people hand-coded in assembly for speed, but these days compilers can often do a better job, especially for CPUs where maintaining the pipeline is important. When going for speed, what you should be doing is looking at the code the compiler generates, and then seeing if you can improve upon it. Needless to say, you only want to do this *after* you have profiled your code to see what parts of it are actually hogging up the CPU.
I gotta say, i'm a burly looking man in my mid 20s and I giggled in excitment when I saw your video pop up in my feed, then proceeded to run home so I could watch it
Every developer who cares about their craft owes it to themselves to know C. You don't have to use C on a regular basis, you don't even have to like the language, but knowing C has the highest amount of payoff in the world of computing, measured in terms of how many doors it unlocks and how many obscure things it makes clear.
eh, kind of. C does not actually really represent what's going on in your computer. If anything, C is sort of holding us back; we keep designing computers so they emulate the C virtual machine when other ways of writing programs would be faster. read the article "C Is Not a Low-level Language: Your computer is not a fast PDP-11" by David Chisnall if you're curious
The math went way over my head, but I do know one thing : if I hear exponent or log I hear bitshift. Powerful AF. Fast AF. I have a 32x32x32 bitmap that resolves almost entirely by using bitshifts. It feels glorious.
Not sure about Python, but Julia can hit the 34,000,000th Fibonacci number in a second with 10 lines of code... using StaticArrays: SA function fib(n::UInt) n_bits = 8 * sizeof(UInt) - leading_zeros(n) A = SA{BigInt}[1 1; 1 0] B = SA{BigInt}[1; 0] for i in 0 : n_bits - 1 B = iszero((n >> i) & 0b1) ? B : A * B A = A^2 end return B[1] end
if you really want to end this on top, you have build a custom ASICs to run your matrixes in, and the just cut power to everything except the memory and you have your number
Symmetric matrix can be thought of as an operation, that resizes vector space. 3x3 symmetric matrix has 3 orthogonal directions that it non-uniformly scales, each direction being an eigen-vector of a matrix. Hence product of two symmetric matrices can be a rotation/skew matrix (combination of two reflections (negative scaling along some axis) yields a rotation).
I am. beginner and the code at 1:53 illustrates why C++ feels like a nightmare compared both C and python. In C, I will probably leak memory, but it is usually pretty easy to see why. Without inheritance or generic types, leaking memory is easy and, outside of simple programs, managing it is tideous, but I don’t write complex programs. In Python, I don’t need to care. The interpeter is unreasonably fast despite the OOP hierarchy all symbols in the language has. My assumption is that it is a slow language because of my indifference to performance, but sometimes it manages to be really fast despite the sinfull disregard I show towards CAS latency, memory bandwidth and the finite nature of SDRAM.
You don't have to write C++ code that way. I never do it. I just pick features I want or need. I've been a C and C++ developer for 30+ years. Pretty much all C++98 with a tiny bit of C++14. I don't understand why people bash a language because it has features they dont need or want. That would be like hating on a car because it has an extra good toolkit and advanced car audio. I like C, but it lacks some of the features I want. C++ has too many features, whilst C lacks what it needs to be an efficient all-rounder. C is great, but it's niche. You can also use C++ in a C style. Pointer arithmetic works the same way, as do C arrays, and you can leak memory. You're in charge. The biggest difference fir me is that C++ has containers. A simplistic example... C char temp[256]; strcpy(temp, "Hello "); strcat(temp, "World"); C++ string temp; temp = "Hello "; temp += "World";
Either the language is complicated or your program is complicated. With C++ I learn it once and then all my programs have a shot at being simple. In C, anything nontrivial will be hopelessly complicated.
@@toby9999 _"C++ has too many features, whilst C lacks what it needs to be an efficient all-rounder."_ Maybe you should try one of the newer low level options like Zig or Odin. I've been learning a bit of Odin, and its approach to memory management is super neat. It also comes with some common data structures, like maps and dynamic arrays, built in.
I can't see a single reason why you should feel sorry for switching to C. It's a great and powerful language. It has been around for a while, and it will still be around when the last man draws his last breath, because there's no decent other way to write a performant software. Good on you.
I didn't understand everything, but I recently implemented a standard exponentiation algorithm and I had to decide whether to start at the most or least significant bit. I chose the former, which apparently was the right choice.
well written fortran could most likely be faster than c for this application, but he would run into the same issue he ran into with c++. he most likely can't write good enough fortran to get it better than c
@ nothing can saves us from bad programmers. Every attempt to eliminate them with new languages, frameworks, and methodologys has just developed a new crop of bad programmers who are bad in new and interesting ways.
Hello! This is great. Actually, this method isn't new; it can be seen in the CORDIC system. On the subject of computation, I call this method the famous quote of Thanos: "break down to the atoms." Algebra is also used in ODE.
The timing is pretty funny. I recently started choosing C over Rust for whatever reason! C is really captivating, and I don't know why! (It isn't the simplicity, C should at least have namespaces.)
Every line of C code can be roughly translated to one line of assembly, which means that C gives you absolute control to do whatever the fuck you want as long as the actual CPU is capable of doing it What this means is that you get to do some absolute black magic fuckery to squeeze some last bits of performance out of the CPU
There are custom matrix multiplication instructions in x86_64 so you might be interested in those and doing some inline assembly. Personally when I have the choice between C++ and assembly I write assembly. C++ is just way too confusing and modern C is just straightforward. It even has stuff like _Generic.
I do believe you can make more optimized assembly then a C compiler. Its not that hard to do because while the C compiler is very good at what it does, it isnt psychic and needs to work for every situation not just yours. You on the other hand can write code knowing exactly what it can and cant do. Like you can even see what the compiler does and just optimize it by hand if uou want. Its the best of both worlds.
@volbla I mean you don't need to know everything. Some instructions are just significantly less common and useful then others. That being said you are right, writing assembly is just more tedious and time consuming. Like you can write in assembly but most people don't want to for good reasons.
I can't tell whether you realize this or not, but the product of two symmetric matrices is not (in general) a symmetric matrix. The bottom formula at 4:36 is wrong. It is however true that the product of two symmetric matrices that commute is a symmetric matrix, which is why the approach works in practice. Great project though, keep up the good work 🙂
hahahahahahaha omg
the day I stop making videos with embarrassing errors is the day I stop making videos
@@SheafificationOfGyou are a silly goober, I appreciate you
😂 I only noticed because of how much I've made this very mistake myself.
it also makes the diagram wrong :sadge
@@SheafificationOfG Beaten again :)
The level of dedication towards Fibonachi numbers is crazy, horrifying even
Reminds me of the time I solved the game where in their turn the players need to flip two adjacent pluses to minuses in a sequence. I wrote ridiculous parallelized fast-Fourier based bitset convolutions, only to realize that the answers became periodic, and then to learn about the Sprague-Grundy theorem. It was a good nerd snipe.
@@siquodme when i eat chocolate squares
@@siquod I would not feel so bad. Everything becomes periodic eventually in computers - even randomness
@@bigzigtv706chomp chomp
The job interviewer asking you "So how would you implement a Fibonacci calculation" is not ready for the answer
"The interview is only scheduled for half an hour. Maybe I can get through this faster with a flip chart."
I cannot believe well optimized smart C code is faster than poorly optimized naive C++
cope
He forgot to use smart pointers. That was the whole problem.
@@andrewporter1868 I don't even think smart pointers was the problem; it was memory copying
@@thezipcreator Well no he was using naive pointers; and naive pointers are initialized with what they assume you wanted before you finish talking.
Genuinely the reason I prefer C over C++ is because I find it easier to write good C than good C++. Even if writing C requires more effort to do basic tasks, at least it keeps me from making lazy and costly decisions.
At this rate it's going to be the Gibonacci sequence.
Gibbonacci
@@Kaizzer yes given the monkeys in the video this seemed a more complete expression of the continuation.
you say you're not a c++ compiler but you're literally called g++ (a compiler for c++)
he makes that joke at 2:50 lmao
oh my god i got owned nvm
No, he's (g+)+, the parentheses matter
@@jmvr No, it doesn't. You multiply the + so it's g++.
10:31
Every one of this videos has a lot of funny things but inside the video somewhere is an absolute banger of a meme. For this video it was "Look at how they mangled _ZN2my3boyE"
That meme was also in a previous video in this series!
I fully agree and you'd have my like if the counter wasn't already at such a nice(tm) value. Here, take my comment instead.
What's the joke?
@@Davsan1 C++ function name mangling
@@Davsan1 A lot of compilers “mangle” named functions into a unique identifier which looks like that, and is obviously not as human-readable. The original Godfather quote is “look how they massacred my boy.”
Your videos are incredible and the density of interesting and funny points exceeds anything I've encountered on TH-cam before. Keep it up!
This entire video should be reference material at every uni course in existence, IMHO. "I'm just taking cheap shots at the hidden coefficient in the big-O" was damn near a _refrain_ . . . and yet, your algorithm became faster to a hilarious degree. Goes to show you that "the hidden coefficient" ain't hidden when it gets run on silicon.
It sure can be hard to be imperfect these days. Your humility and light heartedness are a breath of fresh air, not to mention that it can a lot easier to follow along with someone learning than someone teaching. I appreciate this for many reasons on multiple levels. I watched the first video the other day too. This is good content. I’m delighted and inspired, and the funny thing is that I barely care about the topic, but I’m hooked on the attitude. Keep it up, dude.
I absolutely love your style of videos. Just the right amount of humor, technicality and useful information. Please keep doing more.
4:59 - Its been...10 years, since I last hear this sound.
I miss you Frank.
Cool video!
'I am a mathematician, I always feel stupid.' goes hard
There is a much better way, just set the main() to be constexpr and the compiler will calculate the numbers in advance, the runtime will be super fast and continue until it breaks when the interger values overflow.
Damn, he worked it out
You're about to discover a world of slow as fuck memory access, with optimizations that do extra work on CPU just to save on those reads
Coming soon to a Stack Exchange near you "how to tell the OS to optimize loading a 2GB executable"
The 4,000,000th fibonacci number takes up 350kB. That is just one number. Numbers this big are stored as an array so it can’t overflow.
@@T3sl4 Hey, loading the executable in memory is not technically the same as executing it's contents :P
You make such clever wordplay that still leads to such informative videos, thank you!
I have been casually programming for years and am an graduating in EE now, but videos like yours really make me want to get deeper into maths! Like I'm genuinely considering getting a math degree, just so I can learn how to abuse objects and numbers like you guys do.
Subscribed, humble man, and if attacked my many is a good clue of people who tries to improve over those who think are themselves ultimate genius.
This is the nth time I'm checking what sheafification means and going into a topology rabbit hole, I hope you're happy 😉 (great videos btw)
You are one of my favorite channels, always good and funny!
1:18 This is a brilliant lesson on constructing more hurtful insults. More people should be aware of this!
Yeah mom i am watching sheafication of G pretending to understand what he is saying.
It's like reading books when I couldn't read and looking only for the pictures.
You misspelled the name.
I love this style of educational content so much.
informationally dense + memes + self-depracating humor = i like, i subscribe
11:01 omg that joke is SO GOOD
(the one FAN propelling you upwards despite the drag)
Every time I watch a (g+)+ video I eagerly await the "...I'll always have one fan at my back" gag variation, and every time it does not disappoint.
What I appreciate about this video is that it goes to show that with modern hardware, that hidden constant can change so much from one implementation to another. For so many common scales, big O is almost useless, and even for the scales where big O is very important, that secret hidden constant remains VERY relevant.
yeah like in radix sort
honestly I have been learning way more about c++ from your videos than most other tutorials and in my classes
1:54 - one thing to note - with the introduction of the debug statements, therefore custom (copy/move)constructors / (copy/move) assignment operators, the number is no longer "trivially copyable" (`std::is_trivially_copyable` will return false for it) if the `number` was before, and the compiler can't do a lot of optimizations anymore. Looking at assembly (with optimizations) when there are not the debug constructors / operators, the compiler won't even put the values into a memory, they will stay in registers and the copy/move is just mov instruction for trivially copyable types.
And as someone who wrote (basic) compiler and studies compiler design: any at least a little bit reasonable compiler with turned on optimizations will "know" that the `tmp` is no longer used and will optimize it.
And it goes even further, because even tho the assembly of the code has some mov instructions, these are in a lot of cases not even executed due to register renaming inside the CPU and are effectively no-op.
Edit: try to compile it with clang if you are not using it already, LLVM is more modern and can vectorize code way better than GCC
"can vectorize code way better than GCC" this is not always the case, for some programs GCC is faster.
@@von_nobody For some that's true, but generally LLVM is better. But it's always better to just try and benchmark the result
@@NejakejTomas yup
`number` is a bignum struct, which is not trivially copyable
@@von_nobodyunder very rare circumstances like running on L*nux
I found your channel today's morning, watching this exact video, computing fibonacci numbers. I subscribed because your humor is top notch. Now you drop this. What in the matrix does youtube know?
Math person doing programming not in Haskell?!?!?!?!?!
🤮🤮🤮
Good job. I subscribed! This is what programming is all about! It’s what it’s always been about, behind the curtain. And it has literally been forgotten by most of us.
You’ve outdone yourself with this one and I can’t wait to break the gold medalist once and for all!
we shall welcome a new (C)had to our c community
You mean (c)ommunity?
@Iuigi_t the (c)ult
@Iuigi_t (C)gfault community
This guy has the voice of CGP Grey, the skills of 3B1B, and the personality of Samonella Academy. Perfection.
1:13 "Unfortunately for them, I am a mathematician: I always feel stupid." I FELT THAT IN MY CORE!
This is Awesome. Never be sorry for using C. And how you stepped through your improvements here is inspiring. Way to go!
I just love the way your videos combine math, programming, and humor, keep it up!
I literally watched the previous video two days ago and was expecting a follow-up by the end of the year XD Can't wait to watch this one
Watching this as a fourth year comp sci student and... wow
I really wanna get on your level in programming, both C and C++
He’s a math major btw haha
This is the wrong person to be looking up to
i mean, hes very good at math
He's good at math. Significantly less good at programming.
Code maintenance is what you really want to be studying. There was a time when people hand-coded in assembly for speed, but these days compilers can often do a better job, especially for CPUs where maintaining the pipeline is important. When going for speed, what you should be doing is looking at the code the compiler generates, and then seeing if you can improve upon it. Needless to say, you only want to do this *after* you have profiled your code to see what parts of it are actually hogging up the CPU.
Great video, I would like you to consider moving some of the text higher above the bottom edge, since it's hidden behind subtitles and cannot be read.
Duly noted for the future!
3rd video about this. It's like you are making Fibonacci series.
This one is the sum of the two last vidéos
I gotta say, i'm a burly looking man in my mid 20s and I giggled in excitment when I saw your video pop up in my feed, then proceeded to run home so I could watch it
High high tier wind pun this video. I hope the streak continues!
Quality video as always, adjoint of adjoint of g
truly excellent. excited for the eventual culmination, imagine the gold trophy but with all the jumps taken out
Your comment section reminds me a lot of all the students in my comp sci classes in college round 1.
In a good way, or a bad way?
@gnikdroy to clarify, I meant the comments he showed on screen. I've not delved into the comments myself. So in a bad way but probably not factually.
this channel deserves more subscribers
2:50 got me good.
10:13 Sonic might be able to break the speed limit of C++, but can he break the speed limit of finite numbers?
ayyy we got a real one here 👊
Nice video! Like the theme!
8:04 727 real
I converted that to decimal in my head and i am unreasonably proud of that :3
You should memorize it as binary
I'M SO GLAD I'M NOT THE ONLY ONE TO GET THAT ONE
Omg I love when stuff like 4:50 happens. I am always so interested din non standard operators. Like the 'clay' addition operator where 1+1=1.
Every developer who cares about their craft owes it to themselves to know C. You don't have to use C on a regular basis, you don't even have to like the language, but knowing C has the highest amount of payoff in the world of computing, measured in terms of how many doors it unlocks and how many obscure things it makes clear.
eh, kind of. C does not actually really represent what's going on in your computer. If anything, C is sort of holding us back; we keep designing computers so they emulate the C virtual machine when other ways of writing programs would be faster.
read the article "C Is Not a Low-level Language: Your computer is not a fast PDP-11" by David Chisnall if you're curious
I agree, wish to have learned C and the main Linux/Unix system calls earlier instead of wasting too much of my time with React
@@thezipcreator That was super interesting, thanks for the recommendation!
@thezipcreator thanks for the recommendation, good reading!
Lmao. It's like telling every developer who cares about their craft to learn assembly.
The math went way over my head, but I do know one thing : if I hear exponent or log I hear bitshift. Powerful AF. Fast AF.
I have a 32x32x32 bitmap that resolves almost entirely by using bitshifts. It feels glorious.
7:58 literal tears i cant escape it
"Unfortunately for them, I'm a mathematician: I always feel stupid." Instant subscription.
10:14 THAT'S THE GOODSTEIN SEQUENCE THING!
the mad man is back at it again
"Do i think i can make optimizations better than a C compiler?" Apparently you can make them better than a C++ compiler
you're so skilled
PLEASE make the gold medalist from c++ video but in c. i wonder how much better the result will be.
As a self-taught programmer and HS senior, I have no fucking clue what's going on here, I just know that big number make brain happy
As a self-taught programmer and Physics Bsc and math minor, I have no fucking clue what’s going on here, I just know that big number make brain happy
Self taught programmer and all I can say is
Too much spent on optimization and it's scary. But optimization makes me happy
Babe wake up a shefification video dropped
Not sure about Python, but Julia can hit the 34,000,000th Fibonacci number in a second with 10 lines of code...
using StaticArrays: SA
function fib(n::UInt)
n_bits = 8 * sizeof(UInt) - leading_zeros(n)
A = SA{BigInt}[1 1; 1 0]
B = SA{BigInt}[1; 0]
for i in 0 : n_bits - 1
B = iszero((n >> i) & 0b1) ? B : A * B
A = A^2
end
return B[1]
end
great video, keep them coming
i like the editing style
That video description made me literally 'LOL'
“I’m a mathematician, I always feel stupid. “ I feel seen.
Absolutely love your videos.
A g++ vid always makes my day
I am not Corry for Cwitching to C
wow this guy really likes fibbonaci numbers
You can compute fibs in 3 distinct ways.
Everything else is just a waste of time.
Recursive. Procedural. Array.
if you really want to end this on top, you have build a custom ASICs to run your matrixes in, and the just cut power to everything except the memory and you have your number
Symmetric matrix can be thought of as an operation, that resizes vector space. 3x3 symmetric matrix has 3 orthogonal directions that it non-uniformly scales, each direction being an eigen-vector of a matrix. Hence product of two symmetric matrices can be a rotation/skew matrix (combination of two reflections (negative scaling along some axis) yields a rotation).
I am. beginner and the code at 1:53 illustrates why C++ feels like a nightmare compared both C and python.
In C, I will probably leak memory, but it is usually pretty easy to see why. Without inheritance or generic types, leaking memory is easy and, outside of simple programs, managing it is tideous, but I don’t write complex programs.
In Python, I don’t need to care. The interpeter is unreasonably fast despite the OOP hierarchy all symbols in the language has. My assumption is that it is a slow language because of my indifference to performance, but sometimes it manages to be really fast despite the sinfull disregard I show towards CAS latency, memory bandwidth and the finite nature of SDRAM.
Do you know Cython?
You don't have to write C++ code that way. I never do it. I just pick features I want or need. I've been a C and C++ developer for 30+ years. Pretty much all C++98 with a tiny bit of C++14.
I don't understand why people bash a language because it has features they dont need or want. That would be like hating on a car because it has an extra good toolkit and advanced car audio.
I like C, but it lacks some of the features I want. C++ has too many features, whilst C lacks what it needs to be an efficient all-rounder. C is great, but it's niche.
You can also use C++ in a C style. Pointer arithmetic works the same way, as do C arrays, and you can leak memory. You're in charge.
The biggest difference fir me is that C++ has containers. A simplistic example...
C
char temp[256];
strcpy(temp, "Hello ");
strcat(temp, "World");
C++
string temp;
temp = "Hello ";
temp += "World";
Either the language is complicated or your program is complicated. With C++ I learn it once and then all my programs have a shot at being simple. In C, anything nontrivial will be hopelessly complicated.
@@toby9999 _"C++ has too many features, whilst C lacks what it needs to be an efficient all-rounder."_
Maybe you should try one of the newer low level options like Zig or Odin. I've been learning a bit of Odin, and its approach to memory management is super neat. It also comes with some common data structures, like maps and dynamic arrays, built in.
programming community try not to be insufferable challange, amazing video!
I can't see a single reason why you should feel sorry for switching to C. It's a great and powerful language. It has been around for a while, and it will still be around when the last man draws his last breath, because there's no decent other way to write a performant software. Good on you.
Crazy Fibsonicci fast go big
Maan, you got my respect
I didn't understand everything, but I recently implemented a standard exponentiation algorithm and I had to decide whether to start at the most or least significant bit. I chose the former, which apparently was the right choice.
8:05 I never thought I’d have a WYSI moment in binary
it's like im watching an anime
waiting for a villain arc
C++: does it all. Good at none of it.
Very impressive optimizations. Maybe this should be added as a python library.
Python/Pythonistas grabbing everything into their repertoire!
try it in fortran, I think the language was designed for stuff like this in mind.
the optimizing compilers are supposed to be better as well.
I'd suggest Octave, but we're talking about g++, not gfortran.
well written fortran could most likely be faster than c for this application, but he would run into the same issue he ran into with c++. he most likely can't write good enough fortran to get it better than c
@ nothing can saves us from bad programmers. Every attempt to eliminate them with new languages, frameworks, and methodologys has just developed a new crop of bad programmers who are bad in new and interesting ways.
4:58 We miss you, Papa Frank
I would get my joke out now, but letting it become irrelevant first in later videos feels like a fitting sendoff to c++
Hello! This is great. Actually, this method isn't new; it can be seen in the CORDIC system.
On the subject of computation, I call this method the famous quote of Thanos: "break down to the atoms." Algebra is also used in ODE.
This is _fantastic_
The speed at which I clicked on this.
cant wait for next part
The timing is pretty funny. I recently started choosing C over Rust for whatever reason! C is really captivating, and I don't know why! (It isn't the simplicity, C should at least have namespaces.)
Every line of C code can be roughly translated to one line of assembly, which means that C gives you absolute control to do whatever the fuck you want as long as the actual CPU is capable of doing it
What this means is that you get to do some absolute black magic fuckery to squeeze some last bits of performance out of the CPU
Once you begin to C you won't want to stop C
rust is a psyop language
you can hack in namespaces with static structs and function pointers :p
Rust isn't about speed though it's about safety and automatic memory management without gc or reference counting
There are custom matrix multiplication instructions in x86_64 so you might be interested in those and doing some inline assembly.
Personally when I have the choice between C++ and assembly I write assembly. C++ is just way too confusing and modern C is just straightforward. It even has stuff like _Generic.
C++ is just a horribly designed language; like any other systems programming language is better
@@thezipcreator BeefLang is better alternative. It looks almost like good old C#.
the obi wan category theory one had me rolling fuckkk
I do believe you can make more optimized assembly then a C compiler. Its not that hard to do because while the C compiler is very good at what it does, it isnt psychic and needs to work for every situation not just yours. You on the other hand can write code knowing exactly what it can and cant do. Like you can even see what the compiler does and just optimize it by hand if uou want. Its the best of both worlds.
Theoretically yes, but that means you have to know all the options available in the assembly for your architecture. Who has time for that? 🫠
@volbla I mean you don't need to know everything. Some instructions are just significantly less common and useful then others. That being said you are right, writing assembly is just more tedious and time consuming. Like you can write in assembly but most people don't want to for good reasons.
@@greatnate29 For sure. On the other hand, Casey Muratori claims assembly is easier to learn than CSS, so idk.
He’s speaking english, but I still want to say “genau” whenever he explains something.
That's definitely a skillset that will bring you very far💀
8 more watches and I'm well on my way to understanding half the information.
In case you're curious, "平方求幂" means "exponentiation by squaring".
8:04 this was maybe the last video id expect a wysi joke in
Heres the mathematical formular for the nth fibonaci number
Runtime = 0.0000001 sec
Fn = (1/√5) * ((1 - √5)/2)^(n+2) * ((1 + √5)/2) - (1/√5) * ((1 + √5)/2)^(n+2) * ((1 - √5)/2)
1:12 Amazing clap back. Too real, too true.
I love your content