News for hackers. Stuff that matters.
Re:Own Constant Folder in C/C++ by nalrqa on Saturday June 22, 2024 @08:55AM (#40758803)
> How is a non-expert in the language supposed to learn tricks/... things like this?

By learning C and inline asm. For a C developer, this is nothing out of the ordinary. C++ focuses too much on new abstractions and hiding everything in the stdlib++, where the actual implementations of course use all of this and look more like C, which includes using (OMG!) raw pointers.

Re:Own Constant Folder in C/C++ by pas on Saturday June 22, 2024 @10:09AM (#40759263)
arguably vast-vast-vaaast majority of projects, problems, solutions, developers simply don't need this.

but yes, given the premise of the article is that a friend wants to use a specific CPU instruction, yeah, at least minimum knowledge of one's stack is required (and usually the path leads through Assembly, some C/Rust and an FFI interface - like JNI for Java, cffi/Cython for Python, and so on)