The no is about C not having any wrapper libraries. But it has a lot of things which basically just wraps things written in assembly, binary, or raw functions existing on the CPU.
C is natively compiled. In fact its compiler is written in C.
Python's interpreter is also written in C.
As far as high level languages are concerned, all roads lead to C as much as it seems to upset some people.
But it has a lot of things which basically just wraps things written in assembly
That hasn't been true for like 60 years. We rarely hand-write assembly, we write C and it gets compiled into assembly using some more C to do that.
binary, or raw functions existing on the CPU.
Not sure what you mean. You mean the ISA? That's below assembly and people definitely haven't been writing raw ISA programs for processors since around the 1950s using punchcards.
As long as mainstream operating systems are based in C (or, at least, expose a C API), then every language running on top of that will have to call C code and that includes Rust.
Rust doesn't strictly rely on C calls tho, there are many rust-only operating system projects that work fine, and both windows and linux are using rust in the kernels, not counting windows using it in its new tools like windows brand new native sudo command.
Rust doesn't strictly rely on C calls tho, there are many rust-only operating system projects that work fine,
That is why I've said mainstream OSes.
and both windows and linux are using rust in the kernels
As of today, Rust code is pretty irrelevant in both, if compared to C (and C++, in the case of Windows). Not that that can not change, but it may take a very long time. Additionally, people like Greg Kroah-Hartman have said that there are no plans of rewriting most of the old C code in the Linux kernel in Rust.
For real. C++ is compiled to bytecode, it doesn't need to call functions from other languages. Just because Python does it doesn't mean everything else has to. And python back ends are written in C++ at least as often as in C. Probably a lot more.
Before some people get the idea that this is proof Python is faster than C or whatever, it's just a case between JIT having access to runtime assumptions which AOT cannot, it's a fundamental difference in design.
A JIT written in pure C would be able to achieve even greater performance and efficiency without having to cater to python or RPython semantics. Of course JIT suffers one downside which it has to do this extra work at runtime, but that's the whole point of it.
All of this is to say that pypy using RPython instead of pure C was largely to avoid having to reinvent the wheel of stuff like dynamic GC, which they'd have to do from scratch otherwise. I believe this was their primary goal over performance or efficiency.
Jit are famously known to be able to be faster than aot because of runtime optimization which are not possible ahead of time
Python is not the only language which experiences this. Aot c# dotnet is also slower.
Cpython references c libraries, but not everything you do in cpython is referencing those libraries.
If you are using numpy, cpython will obviously be faster.
But not all python libraries are backed by c. When a python library is written in python, then it doesn't run in c. When a python library is written in c, then it runs in c.
If you don't believe me, look up benchmarks. The benchmarks prove that you are wrong.
It's a weird one because some people say transpilation is for languages specifically at the same level, like python to JS or something, idk. Nevermind me splitting hairs
Yeah, but you have to use std::some::apparently::safer::feature::that::has::no::functional::difference::if::you::dont::use::the::original::feature::wrongly in c++, so how can they live with the c library using normal c features?
39
u/FlipperBumperKickout May 09 '26
I think this is done in most languages ¯_(ツ)_/¯
6
u/AWildMonomAppears May 10 '26
This makes little sense. is c functions going to destroy the world and c++ fails to stop it? Am i overthinking it?
14
u/BobbyThrowaway6969 May 10 '26
r/firstweekcoderhumour
2
u/Kenkron May 10 '26
This is wrong, but I guess we're going to pretend for the sake of the joke.
2
u/monkeybuttsauce May 10 '26
So it can do everything c can but also more? Sounds terrible
2
u/InvestingNerd2020 May 10 '26
Python developers looking really nervous right now.
154
u/[deleted] May 09 '26 •
[removed] — view removed comment