no92 wrote:
mathematician wrote:
assembly only when they have to.
No. It's used when optimizing heavily.
Not really. Rewriting code in assembly would waste a huge amount of resources, and you just end up doing by hand what the compiler already did for you. That's why almost nobody is doing that, except for people targeting special devices (like small microcontrollers where you have to count every byte), OS-developers (for things like flushing the TLB) and people claiming that "real programmers" only use assembly because it's "so superior" to C. When writing commercial software your resources are better invested in optimizing the high-level code.
Trying to beat a compiler at optimizing is tilting at windmills 99,9% of the time. And when it's not, you most likely just introduced a new bug.
no92 wrote:
I don't know whether it's actually done in practice, but graphics programming would be a big field of application.
It was done once - and everyone agreed to get rid of it. When programmable shader stages first appeared, there was no standardized high-level language to program them, so you had to use vendor-specific assembly languages. It was a pain to program, you had to rewrite the shader programs for different vendors and often even two different GPUs from one vendor couldn't run the same code. Also, manually optimizing the code was horrible, not only because it was error-prone, but also because almost every GPU had different performance-characteristics.
This lead to the creation of HLSL, GLSL and Cg. Of which all are (not coincidentally) based on C-syntax.
And now, with GPGPU being available to almost everyone, the field is dominated by CUDA and OpenCL, utilizing C- and C++-dialects. Afaik NVIDIA added an extension to OpenCL to allow inline-usage of their assembly-dialect, but I have yet to see someone using it.