News for hackers. Stuff that matters.
Re:Teaching C by scott_s on Tuesday May 10, 2016 @04:15PM (#11670291)
> C cannot do anything that assembly language cannot do.

I know where you're going with this, but I don't agree with this statement. C provides the abstraction of structs and unions, which do not exist in assembly. Arrays are also an abstraction which does not exist in assembly - yes, assembly provides the mechanisms to easily compute addresses for arrays, but that is different than having a named entity for many objects. The direction you're going is that C is a thin abstraction over assembly, which I agree with. But that is different than saying C has a one-to-one mapping, which is what I think your statement implies.

Re:Teaching C by RodgerTheGreat on Tuesday May 10, 2016 @05:31PM (#11670826)
With modern compilers and modern CPUs, C isn't a particularly thin abstraction. Many serious misconceptions stem from naive assumptions about how C will be translated into assembly which are invalidated through compiler code transformations- often with results that surprise even expert compiler maintainers. Please do not spread the idea that C has any straightforward or predictable relationship with assembly language.
Re:Teaching C by z92 on Tuesday May 10, 2016 @08:10PM (#11671716)
"more straightforward and more predictable relationship with assembly language than any other language in the world" is the right way to say it.
Re:Teaching C by RodgerTheGreat on Tuesday May 10, 2016 @08:17PM (#11671742)
That's a rather bold assertion. How would you back it up? What about high-level assembly languages, ISA-agnostic IRs or languages like Forth or Oberon for which compilers intentionally perform only simple optimizations, if any?
Re:Teaching C by robertelder on Tuesday May 10, 2016 @04:27PM (#11670388)
My name is Robert Elder and I approve this message.