OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Apr 16, 2024 5:25 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Is necessary develop currently in Assembly, ..., hex cod
PostPosted: Thu Dec 04, 2014 3:58 am 
Offline
Member
Member
User avatar

Joined: Fri Dec 15, 2006 5:26 pm
Posts: 437
Location: Church Stretton Uk
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.


Top
 Profile  
 
 Post subject: Re: Is necessary develop currently in Assembly, ..., hex cod
PostPosted: Thu Dec 04, 2014 8:25 am 
Offline
Member
Member

Joined: Wed Oct 30, 2013 1:57 pm
Posts: 306
Location: Germany
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.

_________________
managarm


Top
 Profile  
 
 Post subject: Re: Is necessary develop currently in Assembly, ..., hex cod
PostPosted: Thu Dec 04, 2014 9:11 am 
Offline
Member
Member

Joined: Sun Feb 01, 2009 6:11 am
Posts: 1070
Location: Germany
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)


Top
 Profile  
 
 Post subject: Re: Is necessary develop currently in Assembly, ..., hex cod
PostPosted: Thu Dec 04, 2014 9:19 am 
Offline
Member
Member
User avatar

Joined: Wed May 15, 2013 5:49 pm
Posts: 44
Location: Berlin
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:

http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html wrote:
#29 Assembly (0.599%)

_________________
Developer of libc11


Top
 Profile  
 
 Post subject: Re: Is necessary develop currently in Assembly, ..., hex cod
PostPosted: Thu Dec 04, 2014 12:29 pm 
Offline
Member
Member

Joined: Wed Oct 30, 2013 1:57 pm
Posts: 306
Location: Germany
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.

_________________
managarm


Top
 Profile  
 
 Post subject: Re: Is necessary develop currently in Assembly, ..., hex cod
PostPosted: Fri Dec 05, 2014 5:25 pm 
Offline
Member
Member
User avatar

Joined: Wed Sep 17, 2008 3:59 am
Posts: 45
Location: Germany
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.


Top
 Profile  
 
 Post subject: Re: Is necessary develop currently in Assembly, ..., hex cod
PostPosted: Sat Dec 06, 2014 11:53 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5134
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. ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 89 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group