Is necessary develop currently in Assembly...?

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
User avatar
mathematician
Member
Member
Posts: 437
Joined: Fri Dec 15, 2006 5:26 pm
Location: Church Stretton Uk

Re: Is necessary develop currently in Assembly, ..., hex cod

Post by mathematician »

no92 wrote:
mathematician wrote:c.) Assembly language tends not to be very much used nowadays, although it cannot be completely avoided if you are writing an operating system.
Source? I'd say Assembly is used by many programmers. You need it for things like heavy code optimization, shellcoding and compilerDeving. That's not just a little part; it's a big one. Some c-only programmers don't need it, but still know it.

As soon as you start to program on a arch other than IA-32(e), you will run into trouble with your C compiler. For example, there's no good C compiler for Zilogs (ask the KnightOS guys if you don't believe what I'm saying).
C is used even for embedded systems, and assembly only when they have to. As for compiler writing, probably less than 1% of the programmers in the world are engaged in that activity, with even fewer osdev'ing.
The continuous image of a connected set is connected.
no92
Member
Member
Posts: 307
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: Is necessary develop currently in Assembly, ..., hex cod

Post by no92 »

mathematician wrote:assembly only when they have to.
No. It's used when optimizing heavily. I don't know whether it's actually done in practice, but graphics programming would be a big field of application.
Kevin
Member
Member
Posts: 1071
Joined: Sun Feb 01, 2009 6:11 am
Location: Germany
Contact:

Re: Is necessary develop currently in Assembly, ..., hex cod

Post by Kevin »

Which is part of "when they have to". Nobody in their right mind would use assembly for productive software if they didn't have to. It's different for a hobby OS, of course, because there the motivation for choosing it might just be the fun factor - and if it crashes, nobody cares anyway.

But considering all software that is developed today, "Assembly language tends not to be very much used nowadays" seems to be a fair description.
Developer of tyndur - community OS of Lowlevel (German)
User avatar
Arto
Member
Member
Posts: 44
Joined: Wed May 15, 2013 5:49 pm
Location: Berlin
Contact:

Re: Is necessary develop currently in Assembly, ..., hex cod

Post by Arto »

Kevin wrote:But considering all software that is developed today, "Assembly language tends not to be very much used nowadays" seems to be a fair description.
And could indeed be backed up quantitatively as well:
Developer of libc11
no92
Member
Member
Posts: 307
Joined: Wed Oct 30, 2013 1:57 pm
Libera.chat IRC: no92
Location: Germany
Contact:

Re: Is necessary develop currently in Assembly, ..., hex cod

Post by no92 »

Even a well-known programming language like Lua is not used as much as Assembly. I think these statistics do not tell us a lot: Assembly is often used together with C, as Lua sometimes is with C++. These statistics seem to ignore that fact.
User avatar
darkinsanity
Member
Member
Posts: 45
Joined: Wed Sep 17, 2008 3:59 am
Location: Germany

Re: Is necessary develop currently in Assembly, ..., hex cod

Post by darkinsanity »

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.
Octocontrabass
Member
Member
Posts: 5512
Joined: Mon Mar 25, 2013 7:01 pm

Re: Is necessary develop currently in Assembly, ..., hex cod

Post by Octocontrabass »

darkinsanity wrote:
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.
You've forgotten video and audio manipulation, where the same equation might need to be evaluated for millions of sets of input data, and the compiler is usually too dumb to produce a SIMD interpretation with decent performance.

It's not "heavy" optimization when a single function makes up more than 25% of your program's CPU time. ;)
Post Reply