X
X
xmoonlight2020-01-07 16:02:12
Programming
xmoonlight, 2020-01-07 16:02:12

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

3 answer(s)
X
xmoonlight, 2020-05-11
@xmoonlight

It is necessary to use template abstractions of primitive operations.

I
index0h, 2020-01-07
@index0h

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.

D
dollar, 2020-01-07
@dollar

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 question

Ask a Question

731 491 924 answers to any question