3 ms·
It's about rate of change, not age. Also about design of the ecosystem in general. In JVM land almost all code is implemented in managed code. This means the
by jpgvm 5y ago
It's about rate of change, not age.
Also about design of the ecosystem in general.
In JVM land almost all code is implemented in managed code. This means the likelihood of severe (runtime degrading) bugs is greatly reduced.
It also means in practice you can just step into any arbitrary library code using an interactive debugger to fully follow the flow of execution.
Contrast that to Python where every library worth using is actually written in C against the CPython interpreter itself. This means a few things:
Broadly speaking you have just extended the exposure of the core runtime by the amount of code you have loaded in native extensions, meaning more bugs, more severe vulnerabilities and generally a bad day.
It also means that code is "invisible" to the runtime. Python has pretty poor tooling anyway but what little tooling is has becomes useless once your problems venture into C extensions and you end up having to drop down into GDB to work out what is going on. This is made harder by the fact that Python doesn't really play that nicely vith the Valgrind toolkit in my experience making use after free/leaks/etc and other nasty bugs harder to debug than straight C code.
Finally it also means you can't just pick up and move your Python code to a different runtime despite them being available. Unlike Java which will mostly run just fine on Hotspot or J9/other proprietary JVM your Python code is actually now CPython code. In practice I guess this isn't a big deal but it's worth mentioning.
TLDR: Python is old, Java is stable. There is a difference.
- 7thaccount 5y agoHow much of a problem is that for users? I figure less than 10% need to do what you're referring to.
- jpgvm 5y agoUsually it's not, but you just described the problem when it does. i.e 90%+ of Python users couldn't actually debug a C extension. I would argue closer to 99% which is insane when you consider the prevalence of them and how critical they are to the Python ecosystem.
- 7thaccount 5y agoI think if you need that kind of control than perhaps Python isn't the best choice most of the time. I think that's perfectly fine too.
- jpgvm 5y agoYou don't seem to be getting it. Nearly every Python program is composed of about 99% C these days, especially because Python slants heavily towards data science now. pandas? numpy? tensorflow? pytorch? All native extensions. All the fast encoders/decoders for various file formats etc are all native extensions. Talk to message queue or anything else that requires fast I/O? Probably also C. Python itself is so slow that it's only really used as glue for these very fast libraries. So it's not about control it's about actually being able to understand the tools you are using. If you are using this stack but don't know C then you don't really understand the software you are using. Again, contrast to Java where as long as you know Java you can probably most libraries in common use with a few exceptions. The main exceptions are crypto, compression libs and stuff like Netty.
- 7thaccount 5y agoOh I get it and use those technologies often and so do many coworkers, but it is irrelevant to me what they're written in as they just work fine for 99.99% of users it would seem. When you say a Java programmer knows the entire system, where do you draw the line? The stack system of the JVM? The assembly I assume it later runs, the machine language? Honestly, unless you're running Forth on a very simple chip, I don't think you can possibly hold the entire system in your head at one time.
- jpgvm 5y agoI draw the line where it crosses into understanding a language other than the runtime language. You don't really need to understand anything more than pure Java to understand 99.99% of popular Java libraries (I already listed the exceptions). You don't even need to understand JVM bytecode (though that can really help for performance optimisation). You can't use almost any meaningful library without running into a C extension in Python-land and that is what I have a serious issue with. (same goes for Ruby and JS though I guess)