General statistics
List of Youtube channels
Youtube commenter search
Distinguished comments
About
MrAbrazildo
No Boilerplate
comments
Comments by "MrAbrazildo" (@MrAbrazildo) on "Rust: Turtles all the way down" video.
4:34, in C++, it's possible to overload most operators without using metaprogramming. And it can be restricted to a class or not. Tied to a class, it's not bad form, because the class meaning should be self-explanatory. 9:01, how many lines of code this mean? In C++, 5s for ~10k lines, with optimization flags on.
2
@NoBoilerplate I don't know Lisp macros. C++ has 3 special ways to deal with compile time: - constexpr: it can make all calculations, but the result must be const. It can be attributed to a const, though. - template: a model of how a f() will work. It will make 1 for each type, according to calls. - macro: it pretends you wrote the code in a specific way. I heard the difference is that Rust uses "hygienic" macros. Probably avoiding the classical error: #define add(a, b) a + b int x = 3*add (1, 2); //Resulting in 3*1 + 2 = 5, not the expected 3*(1 + 2 = 3) = 3*3 = 9. There's also a 4th hidden way, dealing with variables at compile time: making template f()s generate other template f()s, with different constants, according to "variable" changes. PS: I forgot to say that that C++ time has exceptions flags off. PS2: your link shows this same video.
1