topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 19, 2018, 09:39 AM
  • Proudly celebrating 13 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Interesting article discussing how C on modern architectures is convoluted  (Read 1331 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 39,030
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Here's an interesting article that argues that using C to write low-level fast code that operates close to the bare metal is no longer a straightforward task, and is becoming increasingly virtualized..

One of the key attributes of a low-level language is that programmers can easily understand how the language's abstract machine maps to the underlying physical machine. This was certainly true on the PDP-11, where each C expression mapped trivially to one or two instructions.  Since then, implementations of C have had to become increasingly complex to maintain the illusion that C maps easily to the underlying hardware and gives fast code... In light of such issues, it is difficult to argue that a programmer can be expected to understand exactly how a C program will map to an underlying architecture.



from osnews.com

IainB

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 7,303
  • Slartibartfarst
    • View Profile
    • Read more about this member.
    • Donate to Member
Here's an interesting article that argues that using C to write low-level fast code that operates close to the bare metal is no longer a straightforward task, and is becoming increasingly virtualized..

...In light of such issues, it is difficult to argue that a programmer can be expected to understand exactly how a C program will map to an underlying architecture.
Yes, quite so. As a longtime pedant and onetime assembler programmer, I could never really see that it was correct to call C "a low-level language" and was skeptical of the terminology.

/Rant on:
Similarly, I was extremely skeptical of what looked like orchestrated obfuscation and fake news narrative around the so-called "Meltdown" and "Spectre" "threats" ("The sky is falling down!"). They are not "threats" per se, but apparently built-in potential security weaknesses that were intelligently and knowingly hard-coded into the CPU firmware in the early days by Intel engineers, to optimise throughput rates. They were probably justifiable as a perfectly valid workaround at the time - i.e., a justifiable trade-off to maximise efficiency. However, following the Snowdengate revelations, it became apparent that any such potential security weaknesses were likely to be exploited at some point - that's what made them "threats" - e.g., including (say) back-doors deliberately coded into Cisco router firmware, maybe (?) as a provision for anticipating the need for remote maintenance/support, etc.
Post-Snowdengate, there's been a sort of FUD-induced insecurity and an almost total cessation of trust (and add to that the Bitcoin scams) - so we'll all be wanting encrypted/blockchained everything and Tandem Non-Stop hardware and operating systems (or similar) at this rate. Then all our social chats can be "secure" and even the most banal data - "Hey! Cool pix of your cat/dog/twerk!" will be "secured" (except to the NSA, of course). We'll probably get it too, but only at a cost. Some people are going to make a lot of $money out of all that FUD.
/Rant off.

The other day, I was trying out a proggie called Domain Name Speed Benchmark <https://www.grc.com/dns/benchmark.htm>. I thought it seemed to be a very fast and rather nifty and small-sized proggie. Then I saw a bullet-point in the features list that said:
Hand-coded in 100% pure assembly language for highest precision and smallest size: 166 KBytes.
That explained it.

Jahandar

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 3
    • View Profile
    • Donate to Member
Interesting rebuttal post by Robert Graham:

https://blog.erratas...s-too-low-level.html

I'll let the people smarter than me decide what's what, but I enjoy the conversation.