←back to thread

22 points ninocan | 2 comments | | HN request time: 0.519s | 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
austin-cheney ◴[] No.43360659[source]
> How much of an overkill that might be?

It sounds like a complete waste of time. If you are talking about small code snippets then simply write new original Python to replace them.

replies(1): >>43360970 #
1. ninocan ◴[] No.43360970[source]
Yep, I thought about that... Still, there's a few hundreds of workflows to migrate, so I was looking for a systematic approach
replies(1): >>43378236 #
2. simonw ◴[] No.43378236[source]
LLMs are absolutely the right thing to look at for migrating hundreds of "simple" workflows like this.

The hard work will be validating that the code they write for you is exactly right. You would have to do that if you wrote the code yourself, too. The LLMs will accelerate the writing-the-code part but the manual QA work will still be on you: https://simonwillison.net/2025/Mar/11/using-llms-for-code/#y...