| ▲ | never_inline 3 days ago | ||||||||||||||||
Most important information is missing here.
As usual these AI coding posts tend to be loose on actual measurements. Don't like it. Granted you can't do too much experimentation with prompting techniques since you're paying per token. But at least you can assess the code that was produced? | |||||||||||||||||
| ▲ | aka-rider 3 days ago | parent [-] | ||||||||||||||||
Thanks for the feedback. My main goal was to present the idea with an intermediate representation, I didn't payed much attention to the specifics of this translation, it would vary wildly depending on code bases. 65k LoC of Go without comments resulted in roughly 60k LoC of Rust witout comments (code column of the cloc tool). The error handling is not so different between Rust and Go, in both cases I cannot panic to avoid the data loss. So it boils down to if (failure) return something for graceful degradation. And generally errors in my case (a text editor) are rare, only disk IO, which is encapsulated in one VFS module, everything else, like non-closed brackets in code is expected behavior. The biggest differences were in third party libraries, UI, markdown parsing — completely different API and paradigms. > Performance characteristics of resulting rust I haven't measured. I don't think there's any significant difference between Go and Rust if app doesn't do allocations on a critical path. The reason I started this project was mainly to experiment (now I use similar approach to refactor much bigger legacy code base), and tree-sitter support is better Rust so it seemed like a good fit. | |||||||||||||||||
| |||||||||||||||||