Are there any programs for converting code from some popular scripting language in C ++ . Converters that add dependencies to the code are not interested. It will be enough for me if the converter can convert only a part of the original language.
An example of what I want to get:
a = [1, 3, 2] a.sort() print(a) vvv
#include <algorithm> #include <iostream> #include <vector> using namespace std; int main() { vector<int> a = {1, 3, 2}; sort(a.begin(), a.end()); for (int i = 0; i < a.size(); i++) { cout << a[i] << " "; } } Where can be useful:
- Sometimes you need to write a small script for which speed is critical. The existence of such a converter will save time.
- In a scripting language, it may be easier to write an algorithm, and it will most likely be clearer. Such a converter is useful not to write the same code several times.
translate.pycan RPython (a subset of Python) to transform, for example - jfs