In each Q&A video, I answer questions from the comments on the previous Q&A video, which can be from any part of the course.
Questions addressed in this video:
[00:03] “I still have this dilemma about when to if branch and when to not. My personal preference is to always have some map or enums with unions and dispatch functions with one of those combinations where the enum gets mapped to a function (either through a hashmal that holds enum keys and func value pairs or unions that straight up give you an enum with a callable ), and there’s no need for if branching. Do you have a general rule where this would just be too much? I prefer very deterministic behaviour, so I am always inclined to make as many enum to callable pairs than to have if statements.”
[14:43] “Follow up to my earlier question which you asked for a gist to show what i meant. Here is your code with a new modified Read_32x2Slow (which is sort of like what i wrote myself based on the listing146 before i saw your example in listing150). I have pasted a results file there too showing the timings i get on my system.
The version with the following runs at 469gb/s
add rax, 64
cmp rax, rcx
jb .loop
While the following runs at 317gb/s
sub rcx, 64
jnle .loop”
[22:10] The moment when Casey realizes what is actually going on.
[34:08] “Let's say you want to implement something new, that you haven't done before, for example a Particle System for your in-house engine. Would you try implementing it yourself first, or would you rather go study prior art before attempting your own implementation?”
[39:29] “Hey Casey what is your stance on programming languages having metaprogramming built in (like jai) vs generating C files yourself in a two step compilation (like rjfleury does). What would be the pros and cons of the two apporaches?”
[42:42] “In your recent discussion with ThePrimeagen you said you want a modern language that is simd based. What would you say a minimum set of features or capacities a modern simd langage/compiler should have to meet your needs?”