logoalt Hacker News

dathinabtoday at 6:21 AM0 repliesview on HN

most unsafe language to rust transpilations produce not just pretty terrible rust code but also use unsafe everywhere

which is needed, as making things safe often requires refactoring not localized to a single function/code block and doing that while transpiling isn't the best idea. In general I would recommencement a non LLM based transpilation (if possible) and then use an LLM to do bit by bit as localized as possible bottom up refactoring to get ride of unsafe code potentially at some runtime performance cost, followed by another top down refactoring to make thing nice and fast. And human supervision to spot parts where paradigms clash so hard that you have to do some larger changes already during the bottom up step.

anyways that means segfaults likely would stay segfaults in the initial transpilled version