Hacker News new | ask | show | jobs
by DylanSp 1704 days ago
I don't really see how Java is closer to C than it is to Python in terms of what level of abstraction it's working on, could you elaborate?
2 comments

It's a matter of opinion whether Java's level is closer to C or Python. But I can name a bunch of high-level features in Python that aren't in Java:

List literals, dictionary literals, tuples, bigint literals, byte strings, f-strings, sequence unpacking assignment, named parameters (kwargs), decorators, closures (functions within functions), metaclasses, generators, async, list/set/dict/generator comprehensions, multiple inheritance, natural JSON support, ...

C# has most of this stuff and I think Java has at least a few of these but I wouldn't say any of these are really much of a differentiator.
However Java do support dynamic typing for every object even if it is a bit cumbersome so putting it at the same level as C++ isn't accurate either.
And at what level of abstraction does ISO C work on?

"C Is Not a Low-level Language, Your computer is not a fast PDP-11."

https://queue.acm.org/detail.cfm?id=3212479

That would be a good point if you actually could write the final code for CPU's, but you can't since the CPU internals do that for you. So from an application programmers perspective machine code is as low as it gets and C maps really well to machine code so C is a low level language.
> So from an application programmers perspective machine code is as low as it gets and C maps really well to machine code so C is a low level language.

C only "maps really well" to PDP-11 style machine code. If you want SIMD, parallel algorithms, heterogeneous programming, memory hierarchies/domains, etc then ISO C is completely useless.

Only if that machine is a 8 or 16 bit CPU, with code compiled as -O0.

And even then, it's impossible to write something like malloc() without using either an external Assembler or language extensions.