Transcrypt has exactly the same clear, powerful syntax that Python is famous for, without the need for any proprietary extensions.
It supports string slicing with [i:j:k], matrix and vector operations with +, -, *, / and more, out of the box.
Python was designed for large scale programs from the ground up.
Hierarchical modules, local classes and multiple inheritance are all supported by Transcrypt, allowing a flexible, yet stable overall structure.
Transcrypt comes integrated with a static type validator, a linter and a minifier, enabling effective cooperation of large teams on extensive projects.
Python is used everywhere at the back-end, from web servers to scientific computing. Now you can use it at the front-end as well.
Code in hello/hello.html:
Code in hello/hello.py:
If you have trouble installing Transcrypt or compiling this example, you'll find additional information in the getting started chapter of the documentation.
Transcrypt is precompiled for speed, rather than interpreted in the browser. It produces small, fast, yet readable code. The minified downloads are measured in kB's rather than MB's.
Transcrypt stays as close to the Python original as possible without sacrificing performance. Multiple inheritance, recursive tuple assignment, multi-loop nested list comprehensions, LHS and RHS extended slices, assignment of bound functions, lambdas, named, default, *args and **kwargs parameters, properties, optional operator overloading, iterators, generators, async/await, selective exception handling and a hierarchical module system are just a few of its characteristics that make this clear. Transcrypt is parsed by CPython's AST module, so no surprises there.
Many people know Python from internet programming, especially from the Django webserver. But it is also tremendously popular in world of scientific computing and education. Selective operator overloading enables the use of elegant notation for mathematical expressions, making Transcrypt an attractive choice for writing small to medium scale numerical applications that have to run in a browser.
Being able to write matrix multiplication and vector addition as v3 = M3 * (M1 * v1 + M2 * v2) rather than v3 = multiply (M3, add (multiply (M1, v1, multiply (M2, v2)))) is a big advantage if the formulas get complicated.
Being able to write c = (3 + 5j) * (-4 - 2j) + (1 + 1j) rather than c = add (multiply (complex (3, 5), complex (-4, -2)), complex (1, 1) when complex numbers are involved is equally handy.
Transcrypt is licensed under the Apache 2.0 open source license. You can download the source code, modify it, keep it in a locker, cut and paste from it, contribute to it, or make it part of your product.