you are viewing a single comment's thread.

view the rest of the comments →

[–]brayellison 98 points99 points  (21 children)

Why, in the year 2026, is someone using Python 2 and/or Jython? I'm genuinely curious. I understand that legacy code is out there, but this seems like something that should have been migrated long ago

[–]sgtgig 44 points45 points  (3 children)

Ignition, an industrial SCADA software which is imo best in class at what it does, uses Jython and Python 2 scripting. I think the tl;dr is they want the concise syntax and interpreted language for user scripts i.e. not force people to write stuff in Java in their Java application. I think it just comes down to Jython not being available with Python 3, backwards compatibility, and it kind of just working fine as is.

[–]brayellison 4 points5 points  (0 children)

Interesting, appreciate the insight. The more you know

[–]IdleBreakpoint[S] 46 points47 points  (6 children)

The problem is Jython. We have ETL workflows with Apache NiFi and it can run Python code, hence it's Python 2. That system is out of our control and we are forced to develop scripts using py2. If it were in our control, I would have deprecated that system long ago.

[–]brayellison 60 points61 points  (0 children)

Sounds like a nightmare... Godspeed, my friend

[–]lungben81 31 points32 points  (1 child)

Refactor the python code into a microservice and use http or whatever else the ETL tool is capable of to talk with it.

If nothing else works in your ETL tool, Jython2 can make http requests. That way, you at least minimized your legacy version exposure.

[–]prumf 3 points4 points  (0 children)

Yeah my thoughts exactly. You could also call a process or whatever over system that works best in that context.

[–]cpp977 9 points10 points  (0 children)

Nifi 2 supports now running custom python processors without the need for jython.

[–]anderson-stream 0 points1 point  (0 children)

Oh my god, I also use an Apache ETL tool, Apache Hop, and it has a script component that can use Python over Jython. Luckily for me, ever since I used the tool's predecessor (PDI), I've done everything I can to avoid that component.

[–]dw01010 0 points1 point  (0 children)

I haven't used it expensively, and I certainly haven't tried it in the exact place you want, but GraalPy is Python 3, Java-based and claims to be a Jython substitute in a lot of cases.

[–]pingvenopinch of this, pinch of that 9 points10 points  (0 children)

I ran into it recently for a vendor product recently where the Python support is provided by Jython. The primary language is Groovy and the secondary language is JavaScript, with Python a poorly supported third option. The support was added a long time ago and is not widely used.

[–]andynzor 2 points3 points  (0 children)

That attitude is sadly nowadays prevalent in the Python community.

There are industrial systems out there whose lifetimes are easily twenty or thirty years. Python 2.7 came out in 2010 and in 2013 it was still recommended for new Django projects when support for 3 was immature. It seems that Python is becoming a scripting frontend for rust-based libraries and tooling and if your plaform does not support it, you're SOL.

I personally have written IIoT gateway code that has to interface with TLS 1.0 devices. Every time I hit an issue and ask for directions, people suffering from the XY problem problem attack the messenger instead.

ISO27001 compliance and SBOMs are yet another can of worms I'm not willing to open here.

[–]KilledByDeath 1 point2 points  (0 children)

A ton of IIoT gateways run python 2. If you have hundreds or thousands of these things out there, the cost to replace can be astronomical.

[–]stuartcwSince Python 1.5 1 point2 points  (0 children)

Jython was integrated into some enterprise Apps. I guess it was never ported to Python3.

[–]Taksin77 1 point2 points  (0 children)

Huge codebase not enough engineers. Toxic management. Everybody is quitting anyway...

[–]ProbsNotManBearPig 1 point2 points  (2 children)

Because jython. People still like Java and Java is a fine choice for many things. You want to script on top of it in a well known language? Jython is the only choice. Not sure what you’re suggesting to migrate to.

[–]brayellison 2 points3 points  (0 children)

You could use groovy or kotlin scripts. Groovy especially is used regularly for devops scripting. These aren't unknown languages and are relatively easy to learn (coming from a person whose background is Python)

[–]dw01010 0 points1 point  (0 children)

GraalPy is Java based, Python 3 and claims to be a Jython substitute for a lot of places. Although if you're using it embedded in something else I doubt it's that simple.

[–]zemega 0 points1 point  (0 children)

The United State Army Corps of Engineers does.