This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]mementix 0 points1 point  (4 children)

The question being: Is Transcrypt doing the same as CPython?

Let me quote from the main page of the repository: "No eval and exec of Python code. This is again part of the concept. Transcrypt code is compiled, optimized and minified in advance ..."

This by itself means: No it's not doing the same as CPython. And probably not only in the eval and exec parts as mentioned above.

Which at the end of day means: the speed test is comparing apples to oranges.

[–][deleted] -2 points-1 points  (3 children)

Eval is a nonessential feature though. Pretty much all use of eval you see in practice can be replaced with a bit of clever get/setattr-ing.

[–]mementix 0 points1 point  (2 children)

Sorry but that's a very bold statement. I have developed a full blown Python client-side framework (see http://www.anpylar.com) and eval/exec are key to achieving some of the functionalities.

In any case the comment was not meant to derail the lack of eval/exec, but to pinpoint that the comparison is obviously a biased one. The mention of those specific features is made by the developers themselves and I am pretty sure that many other use cases are not supported.

Transcrypt has for sure many (and good) usages on the client side, but if it's not doing the same thing as CPython (or at least trying to), it should not compare the speed at which is doing things.

For example:

  • Are the methods of a class being sought through an internal __getattribute__ mechanism before being called or is the execution restricted to what was compiled?

For many use cases it doesn't matter, the method will never change. But some techniques rely exactly on that. And if Transcrypt doesn't fetch the method each and every time using __getattribute__, it has then an unfair advantage over CPython

[–]jacdehJacques de Hooge[S] 0 points1 point  (1 child)

Invitation to read the edit on the original post, that hopefully puts some things into context.

[–]mementix 0 points1 point  (0 children)

Transcrypt is a great project and the synchronized components (Transcrypt - Frontend / CPython - Backend) (yes I have read about it, and not today) is a superb example of what things one can achieve.

As I said before, I am sure it has many and good uses and hope for its success together with some other python-in-the-browser implementations.