Python version 3 update?

There are some really great functions that were added to the Python library since ver 2.5 (currently supported by Ignition). Are there any plans to update Ignition to use a more recent version of Python? Any expected release timeframe? :thumb_left:

Thanks!

Jython 2.7 was just announced. You can voice your support for the upgrade here: ideas.inductiveautomation.com/fo … jython-2-7, although it’s not really necessary because the upgrade is going to happen either way :thumb_left:

Unfortunately the timeline is likely to be Ignition 7.9.

Great to hear it is going in. Thanks.

any word on upgrading to Python 3.1?

It would be really helpful to use some of the newer features, unless there is a case/switch statement available in 2.7?

Ignition uses Jython, because it needs to run on a jvm. The latest version of python that Jython implements is 2.7.
Which means that for Ignition to upgrade to python 3, Jython would need to upgrade to python 3. That's entirely out of IA's control.

Isn't Jython an IA scripting engine/language? How is it out of their control?

That's too bad.

That's not IA.

4 Likes

I guess I can paraphrase what I said on stage at the dev panel at this year's ICC, for posterity and so I can link to this in the future:

So, the question people usually ask is "When is Python 3 coming to Ignition?". But in practice, there's really two broad reasons people are actually asking that question:

  1. They've heard that Python 2.7 is deprecated/old/unmaintained/a security risk/whatever. But that doesn't apply to Ignition, for a few reasons:
    • When folks say "Python" out in the world, they almost always mean CPython, the reference implementation of Python. It's true that this project is officially unmaintained, and security risks are more of a worry here - because the backing code is all C, which has direct access to memory and is therefore vulnerable to classes of issues like buffer overflows.
    • Jython, however, is neither of those things - it's based on Java, so it's implicitly safe from memory corruption errors, and it's still maintained by a core group of contributors.
    • In addition to those public fixes, Inductive Automation already has and continues to implement our own patches for issues as they are discovered, including patching potentially vulnerable standard library dependencies and fixing bugs reported by our users. This gives us the best of both worlds - we get fixes from Jython "upstream", and can implement our own.
  2. They want Python 3, for ecosystem compatibility, or developer experience, or whatever else. But even if Jython 3 existed and was available to us tomorrow, we still couldn't just blindly update the entire Ignition platform to Jython 3.
    • It's still going to be backed by the JVM. So no compatibility with CPython extensions and their implicit reliance on C FFI - meaning no numpy, pandas, TensorFlow, etc.
    • There's a huge library of customer code out there that relies on the exact semantics of Jython/Python 2.7 and its interoperability with Java. As anyone familiar with the Python ecosystem will tell you, the CPython migration from 2 -> 3 was not a painless process, and this would be just as bad.

All that said, we (Inductive Automation) are absolutely aware that we can't just keep coasting on Jython 2.7 forever. Currently, the prevailing internal opinion is that once a suitable alternative is available, we'll come up with some parallel scripting engine/runtime, and offer both Jython 2.7 compatibility and whatever new "mode", in parallel, so that upgrades can continue to be seamless but users can take advantage of the new engine.

It's also important to underscore that not all of the obstacles here are purely technical. "Polyglot" engines that can interpret and run multiple guest languages (Javascript, Python 3, Ruby, Kotlin), such as GraalVM exist - but whatever engine we choose is going to be a choice for the long haul; we take backwards compatibility very seriously at IA, so whatever we offer has to be something we're comfortable supporting for at least the next decade - and there are certain licensing albatrosses around GraalVM in particular that make it an uncomfortable choice right now.

12 Likes

IA adds some patches to the official jython 2.7 open source project. Jython is officially under the Python Software Foundation umbrella, last I checked.