3 ms·
I once had to convert a Java program to C++ and once from Swift to Java (or was it the reverse, it's been a while). In each case it could/should have been done
by karmakaze 5y ago
I once had to convert a Java program to C++ and once from Swift to Java (or was it the reverse, it's been a while). In each case it could/should have been done manually but I was curious how far I could get by automating it since the code bases came complete with unit tests that I could also convert to give some confidence. The challenge with the C++ one was returning heap allocated objects which I merely returned const references that were copied by the caller and that process could repeat through multiple call/stack frames. I was concerned about the performance of all the copying but it didn't factor in at all. I'd say that 95%+ was automated and worth taking the approach. The Swift one was way more challenging in that I didn't know it and got annoyed by the number of different ways that lambda functions can be written. Swift syntax is special.