I recently performed this exact exercise of converting a complex library set from one language into an intermediate state machine representation and then translated into N other languages. It worked well but there's a lot of caveats. I'd highly recommend a direct "port" in most cases tbh, as many bugs are "load bearing" and may not survive the intermediate translation. I speak from experience.
> I'd highly recommend a direct "port"
I'm sure there are other caveats. Also cost of the more or less straightforward Bun port was $165000 for 500KLoC.