Skip to content

Releases: TranscryptOrg/Transcrypt

Function decorators, class decorators, complex numbers, complex math

19 Aug 17:09
Compare
Choose a tag to compare

What release 7 is about

Decorator syntax is considered handy by many, that is why parameterless and parametrized function- and class decorators (as opposed to method decorators, with the exception of @ classmethod) were added.

A more subtle addition is the introduction of complex numbers and the cmath library. While not well known to many web developers, these facilities enable realization of many scientific and technical applications in a notationally elegant way.

The introduction of complex mathematics enables future implementation of the FFT, IFFT and frequency domain filtering and convolution in NumScrypt with an equally elegant notation, although under the hood the computations will probably be optimized using separate arrays for real and imaginary parts.

Purpose is to make Transcrypt suitable as a demonstration c.q. educational platform for the mathematics involved e.g. in simulating and solving linear electrical networks and, in general, modelling physical processes governed by linear differential equations.

While commercial web development remains the main target area of Transcrypt, it is hoped that expanding its scope to educational institutions, from schools to universities, will make it an attractive choice for novice programmers interested in the web as well.

In addition to the above, several bugs and omissions were fixed, e.g. an 'else' clause has been added to exception handling.

Thanks to anyone who contributed to this release, be it with code, ideas, bugreports or feedback!

Jacques de Hooge

Local classes, time module

04 Aug 12:13
Compare
Choose a tag to compare

Local classes were added to the core of Transcrypt.
A time module that closely mimics CPythons one has been contributed.
An itertools module was added as well.
Many small improvements and fixes have been made.

Everything was tested on Windows and Linux.
Should you find bugs, let us know.

It's safe to say Transcrypt isn't a one man effort anymore.
Many thanks to all involved!

Jacques de Hooge

Iterators and generators

03 Jul 07:58
Compare
Choose a tag to compare

Thanks to everyone that has contributed ideas, bug reports and code examples. Without your cooperation this release would not be have been possible. Your work is much appreciated.

This release features iterators, generators and JavaScript 6 code generation for some crucial facilities, e.g. iterator-controlled for-loops and yield. Even if JavaScript 6 code is generated, the minifier will turn it into JavaScript 5 code, so it will run on most browsers.

The Python exception mechanism now blends with the JavaScript exception mechanism.
Almost all of the 'math' module and a small but essential path of the 'random' module have been added.

Also in this release is a simple example of how to make an iPhone/iPad web app. This is a full screen app that is freely distributed via the Internet and available off-line, represented by an icon on the home screen. It also runs in any PC browser.

Some simple facilities have been added to emulate blocking I/O in the browser using 'print' and 'input', obtaining input via JavaScript's 'prompt' dialog. This makes it possible to use Transcrypt for textbook examples in a learning environment, in combination with use of the the 'turtle' module already present.

Transcrypt is primarily a tool for professional production of web applications, retaining a clear structure and, by that, maintainability and flexibility. To that end, blending seamlessly with any JavaScript library, but also with node.js, remains a primary goal. It is possible to write large applications in Transcrypt that are every bit as fast as their JavaScript counterparts.

Still, explicitly drawing educational institutions into the game is not without reason. While suitable for large, professional projects, Python is also currently the nr. 1 language used in teaching kids and students to program. Being able to program for the browser in Python is very attractive for a generation where the Internet is a basic fact of life. The fact that Transcrypt also has excellent space and time efficiency makes it possible to 'grow' from education into professional application.

I am very curious about even the most modest uses of Transcrypt in this area. You can always mail me your experiences or ask questions, request features etc. I teach programming myself at the Hogeschool Rotterdam but also to kids, and I consider this an important inroad to future innovative power.

C-preprocessor-like conditional compilation was added using pragma ('ifdef', ) and pragma ('endif'). This facilitates optionally including autotestcode for JavaScript 6 but can also be used for production code.

The -s switch makes it possible to define symbols that can be used for conditional compilation but also for other purposes. The symbols are available at runtime in main.symbols.

Many bug fixes were applied as suggested by the issues contributed by several people.

Jacques de Hooge
Rotterdam
Netherlands

Transcrypt 3.5.161, div. fixes and new libs, multilevel sourcemaps

28 May 14:34
Compare
Choose a tag to compare

Almost all of math, and the most important functions of random have been ported.
Several bugs have been fixed.
Operator overloading has been expanded with == , !=, <, <=, >, >=
The largest part of the Python 3.5. turtle module has been ported as well. It now runs in the browser,(High resolution, SVG based, try online at http://www.transcrypt.org/live/turtle_site/turtle_site.html).

Pre-release: Multilevel sourcemaps and annotated target code

10 May 16:19
Compare
Choose a tag to compare

Reasonably well tested, feedback welcome.

Sourcemaps and several fixes

23 Apr 15:21
Compare
Choose a tag to compare

This release supports single level sourcemaps on Chrome.
You can now lay the connection between your Python source code and your non-minified JavaScript target code.
Together with the readability of the generated JavaScript this enables easy debugging.
This release also contains several fixes for issues that were filed.

Note that Transcrypt can also be pip-installed.
The version corresponding to this release is 3.5.145.

Transcrypt 3.5.142: First release for production use

06 Apr 09:58
Compare
Choose a tag to compare

After quite some testing under Windows and Linux, Transcrypt is ready for production programming now. Many features and optimizations have recently been added. Examples are included for use with jQuery, node.js, D3.js and fabric.js.

The generated code has been optimized in many ways. For-loops over a closed range of integers are now as tight as the JS ones, call memoizing prevents searching the prototype chain, making calls to inherited functions faster than native JS in many cases, especially in inner loops, i += 1 is translated to i++ etc.

While you can install from a zip file, Trancrypt is pip-installable under Linux (python3.5 -m pip install transcrypt) and Windows (python35 -m pip install transcrypt).

If you like Python for creating readable, maintainable, fast and compact applications, you can make the switch right now.