4 ms·
Very informative read. I wonder if it’s start becoming more popular for people to compile & distribute Python byte code once the JIT is done similar to how Java
by _lvbh 2y ago
Very informative read. I wonder if it’s start becoming more popular for people to compile & distribute Python byte code once the JIT is done similar to how Java does it.
- jepler 2y agoThis is quite possible, and I'm sure someone's doing it. At $OLD_DAY_JOB I developed a way to byte compile and then encrypt Python byte code for plug-ins, to meet a requirement from some third party partner. This was long enough ago that it was in the Python 2 days, so I don't know if the method survived the product's transition to Python 3. I do know the method would probably not have survived a dedicated reverse engineer who wanted to figure out how to recover the unencrypted bytecode.
- munch117 2y agoUnlike JVM byte code, CPython byte code is not a stable target. It can and does change from one minor version to the next. So far, it has remained recognisable from one version to the next - someone used to reading (disassembled) CPython 2.7 bytecode would feel right at home reading CPython 3.11 bytecode, for example. But there's no guarantee that it will remain so, and with the faster-cpython project going on, we should probably expect it to change more in the future than we've been used to.
- Someone 2y agoTo make that popular, there would have to be at least some guarantee that bytecode distributed to another system can run there. However, AFAIK, Python currently makes no guarantee at all about bytecode compatibility between versions, and there are no plans to change that.