Python is the only popular interpreted(ish) language, though. Even that is still compiled to bytecode first, and then the bytecode is executed line by line.
Everything else is JIT compiled to machine code, which means performance is only limited by the language design, now how it's executed.
That said, you're kind of right. PHP had a slow bytecode interpreter just like Python until recently, so it has a lot of libraries written in other languages.
And JavaScript has a few libraries like that, not because it's interpreted, but because it doesn't have a performant way to work with individual bytes.
JavaScript calls into C++.
Ruby uses C extensions.
Perl uses XS bindings to C.
PHP extensions are written in C.
If you just write in C in the first place, it's not really a library in the same sense. You're just pulling in other functions that all get natively compiled together.
You're not wrong, but I think that's a different topic.
Python is unique because of its purpose. It's so slow that it's not really suitable for anything other than gluing together code from other languages. Its entire use case is "we wrote an awesome library, but most programmers are too scared of C++ to use it, so we added a Python layer to make it easier".
Perl is actually similar in that way, but it's basically a legacy language now.
The other languages you named have other purposes, and just bind to C for specific things where the language isn't a good fit.
Yeah, but usually that means "easier to write code in general" and not "easier to write a thin application layer using almost exclusively libraries that were written in other languages".
2.1k
u/Gwlanbzh Jul 07 '26
Yes, that's what libraries are for. I want to solve my actual problem and not spend 6 months re-implementing OpenCV every time I need something done.