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

I don't see how you could argue that C is comparable in terms of level of abstraction to Rust and C++. For instance with Rust memory management is totally abstracted away from you as the programmer, which is a core part of what a computer is doing.

And if you index into an array in C, that's basically like saying `root memory location + stride * index`. In Rust it's calling a trait function which could be doing arbitrary work.

Rust and C++ are on similar levels of abstraction, but C is much, much simpler.



How is Rust memory management totally abstracted away from you? You have to opt in to every heap allocation, just as you have to call malloc() in C.

And it's certainly true that Rust has overloading and C doesn't, but that wasn't what I was getting at. The point is that C is defined in terms of the C virtual machine, not the underlying hardware. The C virtual machine is quite far from the actual CPU instructions.


In Rust you opt into every heap allocation with an abstraction like Rc, Arc, Box etc. With C you would have to implement each of those behaviors with primitives, because C is at a lower level of abstraction than Rust.


How is that different from C++? Since you've explicitly put C and C++ in the same basket, this argument doesn't hold any water…


It sees like you're trying to catch me with some kind of gotcha instead of dealing with the argument in good faith.


malloc is also an abstraction.


I never said C is without abstraction, only that it is a relatively thin abstraction. Are you seriously arguing that Rust is not at a higher level of abstraction than C?


> Are you seriously arguing that Rust is not at a higher level of abstraction than C?

Rust is clearly not at a higher level of abstraction than C++, yet in your own argument you've put C and C++ on the same ground…


No I haven't. I said Rust and C++ are on similar levels of abstraction.


Yet a few comments above in this thread[1]:

> I feel it's missing the quality from C/C++ that they are a very thin abstraction over assembly.

[1]: https://news.ycombinator.com/item?id=30419248


I also said this:

> Rust and C++ are on similar levels of abstraction, but C is much, much simpler.




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

Search: