The Python → 11l → C++ transpiler is a union of 2 transpilers:
In a sense, the 11l programming language acts as an intermediate language, but since it is very similar and close to the Python language (albeit semantically, not syntactically), it is generally not required to study it specifically.
Also it should be noted that this transpiler generates a human-readable code, which simplifies debugging of the generated program.
PerformanceHere is the results for
pqmarkup to HTML converter(as an input data the source of
this articleis taken):
(Shed Skin is not listed here because it does not support nested functions.)
This is the results for a Prime number problem (with K = 1000000):
import math k = int(input()) n = k * 17 primes = [True] * n primes[0] = primes[1] = False for i in range(2, int(math.sqrt(n)) + 1): if not primes[i]: continue for j in range(i * i, n, i): primes[j] = False for i in range(n): if primes[i]: if k == 1: print(i) break k -= 1
And this code
{…def is_right_triangle(x1, y1, x2, y2): a = x1**2 + y1**2 b = x2**2 + y2**2 c = (x2 - x1)**2 + (y2 - y1)**2 return (a + b == c) or (b + c == a) or (c + a == b) LIMIT = 51 ans = 0 for x1 in range(LIMIT): for y1 in range(LIMIT): for x2 in range(LIMIT): for y2 in range(LIMIT): if y2 * x1 < y1 * x2 and is_right_triangle(x1, y1, x2, y2): ans += 1 print(ans)
for solving
problem #91 of the Project Euleris ~500 times faster (the Python → 11l → C++ transpiler vs CPython):
Here is the latest version of the Python → 11l → C++ transpiler:
11l.tar.xz [source code repos].
Usage:
<path_to_unpacked_archive_files>\11l <source_python_or_11l_file>on Windows, or
<path_to_unpacked_archive_files>/11l <source_python_or_11l_file>on Linux.
Having problems with
transpiling your Python
program? Please read
this guide.
And if you haven't found a solution there, then
write at the forum.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4