←back to thread

22 points ninocan | 2 comments | | HN request time: 0.61s | source

Context: I was tasked with migrating a legacy workflow system (Broadcom CA Workflow Automation) to Airflow.

There are some jobs that contain rather simple JavaScript snippets, and I was trying to design a first prototype that simply takes the JS parts and runs them in a transpiler.

In this respect, I found a couple of packages that could be leveraged: - js2py: https://github.com/PiotrDabkowski/Js2Py - mini-racer: https://github.com/bpcreech/PyMiniRacer Yet, both seem to be abandoned packages that might not be suitable for usage in production.

Therefore, I was thinking about parsing and translating Javascript's abstract syntax trees to Python. Whereas a colleague suggested I bring up an LLM pipeline.

How much of an overkill that might be? Has anyone else ever dealt with a JavaScript-to-Python migration and could share heads-ups on strategies or pitfalls to avoid?

Show context
throwxbnk ◴[] No.43378159[source]
It is not necessary to automate it. Do it manually, say it requires a lot of attention and care and bill the hours.

If they force an LLM on you, say that you are thrilled to use an LLM, give it a try and arrive at the conclusion that unfortunately LLMs are not up to the task. Bill the hours needed to arrive at that conclusion.

There's no need for software engineers to automate themselves away. Look at lawyers, they know how to bill and protect themselves.

replies(1): >>43378423 #
andybak ◴[] No.43378423[source]
Or - do the best job you can with whatever tools you think will help and sleep better at night.
replies(1): >>43378451 #
1. 43h5zqt ◴[] No.43378451[source]
Even the Python2 => Python3 translation with the automated tool "2to3" wasn't a great success. Why would Javascript => Python even work?

The best tool is a manual translation.

replies(1): >>43378907 #
2. andybak ◴[] No.43378907[source]
I think many people will disagree with you on this. (and just to clarify - automated/manual is not a binary choice)