News for hackers. Stuff that matters.
Re:Why C Is Not Assembly by jacquesm on Tuesday September 14, 2010 @01:00AM (#1689536)
It's not too much of a stretch to look at just 'C' as a very sophisticated macro assembler.

And probably you should strip out the 'macro' bit there because in reality that's the pre-processor doing it's work and even though there isn't a C compiler without a pre-processor technically speaking it is not part of the compiler since all it does is output more C.

Re:Why C Is Not Assembly by Someone on Tuesday September 14, 2010 @02:53AM (#1689761)
"And probably you should strip out the 'macro' bit there because in reality that's the pre-processor"

I disagree. Looping constructs that typically would be macros in an assembler such as 'while' and 'for' are C constructs. Also, C itself has automatic field offset computations.

Re:Why C Is Not Assembly by berntb on Tuesday September 14, 2010 @05:09AM (#1689969)
>>automatic field offset computations

A macro for subroutine entry could reserve stack space and define offset constants. A macro for subroutine returning releases the extra space.

It could be neat to use, if the processor architecture has sane addressing modes. (I might have seen/done something similar... doesn't feel like a new idea to me. :-) )

(The entry macro might need a simple preprocessor.)

Disclaimer: C and lower was another life, dimly remembered. :-)

Re:Why C Is Not Assembly by mfukar on Tuesday September 14, 2010 @03:03AM (#1689783)
It's not too much of a stretch to look at just ' FIXME' as a very sophisticated macro assembler.

s/FIXME/Ruby, or Python, or Perl, or any other language. Where does one draw the line that distinguishes a language from a sophisticated enough assembler?

Re:Why C Is Not Assembly by jacquesm on Tuesday September 14, 2010 @06:01AM (#1690051)
Those are interpreters, not compilers.
Re:Why C Is Not Assembly by mfukar on Tuesday September 14, 2010 @06:45AM (#1690120)
If you're not comfortable with interpreted languages, substitute for Java, C++ or other compiled languages. My question still stands for itself.
Re:Why C Is Not Assembly by jacquesm on Tuesday September 14, 2010 @09:07AM (#1690360)
No it doesn't.

In java any kind of minimal assignment can explode behind the scenes into a a whole pile of function calls, that would never happen in C, what you see is what you get.

Re:Why C Is Not Assembly by logicalmind on Tuesday September 14, 2010 @10:31AM (#1690665)
It's interesting to compare the real difference here. In C, what you see at compile-time is what you get. As compared to an interpreted language where what you see at compile-time is probably going to be completely different from what happens at runtime. The difference is really where the optimizations occur. Runtime optimizations have certainly come a long way.
Re:Why C Is Not Assembly by mfukar on Tuesday September 14, 2010 @01:45PM (#1691483)
jasonwatkinspdx and hackermom have explained why your statement is highly inaccurate.