Thanks! I really appreciated Ben and Dan who gave us opportunities to deep dive into c and c++.
@LS-cb7lg2 сағат бұрын
Great talk. good thing i knew most of it already, but a great refresher nonetheless :) the workaround with the opaque functions is a good thing to keep in mind!
@japedrКүн бұрын
To be fair, I believe one of the mistakes of C and C++ is that the value and not the address is what is declared volatile, where it only makes sense in practice is when it's under a pointer/reference. I believe a much more cleaner solution would be having special functions like "volatile_read" and "volatile_write" that modify volatile memory locations. That would even allow adding non-volatile read and writes mixed in where needed; or even hardware-specific functions with their own particular set of guarantees (e.g. "semi-volatile").
@sanjaygatne1424Күн бұрын
नीट समजावून सांगितले. होलाटाइल बद्दलच्या शंका दुर झाल्या. धन्यवाद.
@xorbe2Күн бұрын
primer at 0:36 volatile at 20:29 summary at 44:05 audience questions at 46:40
@milasudril2 күн бұрын
Can the language be made more expressive in order to prevent compiler bugs related to volatile?
@Fardin.AlizadehКүн бұрын
you are more Peter Gregory that Peter Gregory itself =))))
@jefffriedman69422 күн бұрын
it shouldn't take an hour to learn what volatile is. this is a core problem with c++ and the people surrounding it. 1 hour presentations in a world that had already been dominated by 140 characters over a decade ago.
@ZeroPlayerGame2 күн бұрын
have you watched the talk or just read the title and looked at runtime
@srnissen_2 күн бұрын
Explaining how to use it takes a second if you're not touching hardware ("don't"), one sentence if you're doing C++ ("The standard says it does the same as C"), and one (different) sentence if you're doing C ("Ask your hardware provider.") I would be wildly surprised to learn that it's any different for Zig or Rust. "What it is" can take arbitrarily long, depending on how long of a history lesson you want.
@ShtrikeBirb2 күн бұрын
So true
@juliovata9194Күн бұрын
@@jefffriedman6942 it’s a feature adopted from C…
@japedrКүн бұрын
Within 140 characters: Just use volatile for memory mapped hardware registers as the compiler would generate wrong code otherwise. Do not use it for other purposes. For the longer explanation, watch the talk. I mean, I agree that often C++ is overly complicated, but this particular issue affects all low-level languages with an optimizing compiler (like pure C, Rust, Zig or even Ada). The only way to avoid this problem is to write the assembly code yourself.