3 ms·
One the subject of porting code from one language to another (ignoring that the headline says "rewrite", which implies more than a dumb port). Are there any to
by Buttons840 4y ago
One the subject of porting code from one language to another (ignoring that the headline says "rewrite", which implies more than a dumb port).
Are there any tools to help map out the work that needs to be done? I found myself doing this by hand recently, doing graph search on a piece of paper. I needed to port one function, so I identified all the functions that function called, wrote them down, and then looked into the next layer of functions etc. I manually searched the potential call graphs by reading the code and wrote down all possible functions involved. I then crossed of functions that seemed obvious, such as a function to retrieve the value of a dictionary with a default value, such simple functions are trivial and need no special effort. In the end I had a list of functions that needed to be ported one-by-one and I began working from the bottom up.
I was wondering if there are any tools that could automate this process? It seems to be the beginning of a source-to-source compiler, but such a compiler could be kept simple by embracing that most of the work can be presented to a human to perform manually. The "compilers" only job is to structure the work and break it down into small chunks.
- Jtsummers 4y agohttps://en.wikipedia.org/wiki/Call_graph#Free_software_call_graph_generators https://en.wikipedia.org/wiki/Call_graph#Free_software_call_... Lots of software tools for generating call graphs. I've used doxygen (free) for it in the past and LDRA (not free) at an early job. This won't generate the new code for you, but will be a lot easier than manually constructing a call graph.
- rescbr 4y agoI have used SourceTrail for that in the past, sadly its development stopped.