Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2000 13:12:35 -0400
From:      "M. Adam Davis" <adavis@ubasics.com>
To:        "chat@freebsd.org" <chat@freebsd.org>
Subject:   Re: assembly vs C
Message-ID:  <39199883.35F74895@ubasics.com>
References:  <20000509212637.A73322@dogma.freebsd-uk.eu.org>

next in thread | previous in thread | raw e-mail | index | archive | help
J McKitrick wrote:
> Will there ever be a need for ML again, besides
> optimized device drivers?

Embedded devices are coming more to the forefront of technology, while
mainstream computers are slowing.  Programming in assembly language is useful
for small real-time tasks (read, microcontrollers, network routers, etc)

But even the microcontrollers I program (.5k to 8k of program space) I program
mostly in C (NOT C++, thankyouverymuch).  But there is always room for assembly
routines.

You really cannot say "Which is better".  That is like saying, "which is better,
a hand saw, or a power saw?"  Sure, you can very likely perform the same
operation with either, but you aren't going to carve a granfather clock face
with a power saw, nor are you going to cut framing wood with a hand saw.  They
are designed for different uses, and anyone who only uses one or the other will
limit their effectiveness.

> Or will advanced compilers and OOP replace low level
> programming for most tasks?

Again, it depends on who you are serving.  Consumer devices can(and should) be
whipped out in the least amount of time using a high-level language.  Industrial
or time critical devices should use a mix where needed, but can generally be
mostly high-level.

> Even though C is not OOP, it is low-level enough that
> a good compiler and a tight C program make the benefits
> of ML almost irrelevant, correct?

Almost, but not quite.  If every application in the world had the same exact
requirements, then a single c compiler could optimize every program perfectly. 
This, obviously, is not the case.  Tomorrow, someone will need a routine on a
given processor which is a completely new way of deaing with an old problem. 
The algorithm used, however, is also new, and the C compiler will do a great job
of optimizing it - but a hand tuned optimization would be significantly better. 
And of course this changes according to the processor's capabilities.

Then you have supercomputers preforming floating point operations (for weather,
satellite, atomic simulations).  Given that a particular simulation requires a
particular loop to be executed several billion times, it pays to code it in
assembly (especially when you find out what the supercomputer costs to run per
second)

So, in short, C will not replace assembly (machine code).  Just remember the
predictions of the paperless office of tomorrow...  We won't have a machine
language-less office of tommorow, though it will become less used in favor of
speed.

-Adam

"The paperless office will come soon after the paperless toilet"


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?39199883.35F74895>