Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I program in ARM assembler, C, Rust, Java and Clojure on a daily basis and for me C is definitely low level language.

For me a "level" up is something that helps me structure my program in a fundamentally better way. Java has VM and garbage collector, Lisps have macros and REPL. For me these are fundamental enablers to create different types of flows that would not be at all practical in assembly or C.

The difference between assembly and C is just that you need couple of instructions in Assembly to get an equivalent of line of code in C but the fundamental program structure is the same.

The automation is nice but other than reduced overhead the same problems that are difficult in Assembly are still difficult in C and for me this means they are roughly on a same level.



> The difference between assembly and C is just that you need couple of instructions in Assembly to get an equivalent of line of code in C but the fundamental program structure is the same.

This is absolutely not true, unless you turn off all optimizations. If you take that route you find that your C code is slower (sometimes orders of magnitude slower) than code written in other languages.

C is less interesting without breaking the idea that "couple of instructions in assembly" == "a line of C code". Is also much less interesting without undefined behavior (which is what allows many of the optimizations that makes C "fast" and thus "closer to the metal" in many people's minds).

I don't fully agree with the article, but I certainly think it is long past time for a new systems programming language that is safe-by-default. There is plenty of proof that we can define away most types of "undefined behavior", get many kinds of memory safety, while still providing escape hatches for situations where it really matters. Unfortunately we are still firmly in the "denial" phase with half of our industry arguing that C is just fine and dandy.


Compiler optimizations are something that people were rolling off in assembly long before they were realized in C compilers.

You will also notice that compiler optimizations have not much to do with a language being lower or higher level. You go for a higher level language because you have performance to spare and you would instead want to write your large application with less effort.


The level up that c represents is: abstract flow control structures and abstraction of the processor instructions.


I call these automations because they automate what you could otherwise do by hand like in old days.

An experienced C and assembly developer can take almost any piece of assembly code and easily write C equivalent of it and vice versa, take any piece of C code and write equivalent assembly.


> An experienced C and assembly developer can take almost any piece of assembly code and easily write C equivalent of it...

If the assembly was originally compiled from C, the new "C equivalent" can have radically different flow than the original had.

Modern compilers can do rather crazy and surprising transformations to your code.

They might omit large chunks or even turn your loop structure "inside out" to enable vectorization optimizations.

They can pattern match your algorithm and replace it with something faster. See: https://lemire.me/blog/2016/05/23/the-surprising-cleverness-...


I can do the same with e.g. Turbo/Free Pascal, yet no one claims it is an high level Assembler.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: