Answer the question
In order to leave comments, you need to log in
How to automatically translate any ready-made algorithm from any PL to any other PL without compromising the speed of the algorithm?
Why and why is it needed? It would be easier to graphically visualize such code, write converters for such code into other languages, and conveniently monitor changes in variables at each step of the algorithm.
Answer the question
In order to leave comments, you need to log in
It is necessary to use template abstractions of primitive operations.
What for?
Does it improve readability? Doesn't improve.
Maybe it's a matter of performance? You just waste it on running around the array.
Maybe less code? Nope again.
Why write them at all?
UPD
No, literally no. Because:
1. Ways to work with memory and optimize performance are different.
2. The constructions used in specific languages for specific algorithms are different.
3. The standard libraries differ, as a result, the algorithm that you want to translate from one language may be in the standard library of another.
Why? Because few people need such a visualization. Most people are happy with the local scope of variables and find that the extra prefix makes it harder to read. And very few people need to convert their JS code into other languages.
But you can do this for your code, if necessary and convenient.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question