Thoughts about Fast Python Engine and Python EveryWhere
Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ... First answer is simple, because big companies such as Google, Facebook and so on evolve this language and run-time for it ... But it is only part of story, all this platforms would not be possible without some good architecture that was done by this companies What is this architecture decision ? It is a splitting run-time and infrastructure V8 is JavaScript engine that could very fast execute JavaScript and that is all !! It has a reach API using which you can embed this run-time almost every where ... What if we in Python will accomplish the same solution ? What if Python would have some very fast engine that could be integrate in every environment ? Engine will be able only execute Python code and call some registered callback (hooks) for `import` some module, for calling some registered C-extension and so on If this engine will be very portable then Python would be embedded everywhere !! ;) Engine will not suport all builtin functions and it will not have any library embedded in it To add some buiiltin functionality you will need register the callbacks in engine, the same with libraries Engine will just call callback to import code and callback optionally will return Python script which will be executed To be continue ...
CPython is already very portable thanks to it being implemented in C. I don't see, though, how a lack of stdlib for JavaScript makes it fast? Unless you're saying the Python core team should drop the stdlib so it has more time to focus on the CPython interpreter itself? On Thu, Jul 16, 2020 at 10:00 AM <redradist@gmail.com> wrote:
Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ...
First answer is simple, because big companies such as Google, Facebook and so on evolve this language and run-time for it ...
But it is only part of story, all this platforms would not be possible without some good architecture that was done by this companies
What is this architecture decision ? It is a splitting run-time and infrastructure
V8 is JavaScript engine that could very fast execute JavaScript and that is all !! It has a reach API using which you can embed this run-time almost every where ...
What if we in Python will accomplish the same solution ? What if Python would have some very fast engine that could be integrate in every environment ?
Engine will be able only execute Python code and call some registered callback (hooks) for `import` some module, for calling some registered C-extension and so on If this engine will be very portable then Python would be embedded everywhere !! ;)
Engine will not suport all builtin functions and it will not have any library embedded in it To add some buiiltin functionality you will need register the callbacks in engine, the same with libraries Engine will just call callback to import code and callback optionally will return Python script which will be executed
To be continue ... _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/D7HOOB... Code of Conduct: http://python.org/psf/codeofconduct/
CPython is portable but due to integrated standard library (builtin functionality) it is hard to evolve it, for examle to add JIT, anyway it is just my thoughts
On Thu, Jul 16, 2020 at 11:52 AM <redradist@gmail.com> wrote:
CPython is portable but due to integrated standard library (builtin functionality) it is hard to evolve it,
How so? The stdlib is just a collection of packages we happen to ship with Python. Think of it as if we ship blessed packages from PyPI with Python itself. That's it. The stdlib very much is not a hindrance to performance. Python's design as a language is what makes it tough. We could rip out the stdlib tomorrow and it would not change how we optimize the CPython interpreter.
for examle to add JIT,
As someone who helped create a JIT for Python (Pyjion), I can tell you as a fact that the stdlib in no way hindered our work. It was a lack of time and simply the fact that Python is a very dynamic language.
anyway it is just my thoughts
And that's fine, but what we are all trying to do is help educate you about some statements you made which are not accurate. -Brett
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/TX3XGC... Code of Conduct: http://python.org/psf/codeofconduct/
On 16/07/2020 17:59, redradist@gmail.com wrote:
Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ...
First answer is simple, because big companies such as Google, Facebook and so on evolve this language and run-time for it ...
But it is only part of story, all this platforms would not be possible without some good architecture that was done by this companies
Um. I think you should go and read up a bit more about the history of Javascript. And then the history of PHP.
What is this architecture decision ? It is a splitting run-time and infrastructure
V8 is JavaScript engine that could very fast execute JavaScript and that is all !! It has a reach API using which you can embed this run-time almost every where ...
What if we in Python will accomplish the same solution ?
You can embed Python right now. The API to do it exists, and a number of programs out in the world do exactly that. -- Rhodri James *-* Kynesim Ltd
My main point is that it would be nice to have just very fast execute engine and all library as integration layer
On Thu, Jul 16, 2020 at 12:59 PM <redradist@gmail.com> wrote:
Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ... First answer is simple, because big companies such as Google, Facebook and so on evolve this language and run-time for it ...
Check out PyPy. It is every bit as fast as the fastest Javascript engines like V8. So is Numba, for that matter, but it's not language wide, so it's a slightly different beast. -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.
I know, I know that PyPy is fast as V8 but PyPy implement the whole library inside and it is not easy to embed it somewhere
On Thu, Jul 16, 2020, 2:57 PM <redradist@gmail.com> wrote:
I know, I know that PyPy is fast as V8 but PyPy implement the whole library inside and it is not easy to embed it somewhere
I have no idea what you mean by that. PyPy doesn't need its standard library to run. Just like in CPython, those are just a bunch of external files that you can import or not, as desired.
I remember some years ago I compiled Python 3.4 on Kobo, using an ARM virtual machine with qemu. Since the space on Kobo was little, I removed the standard library. But Python did not work. I had to include some stdlib modules too, like encodings/ascii.py, because I was not able to even print an "Hello world" to test it. It was not something very easy... I had to do some try-except :P https://www.mobileread.com/forums/showthread.php?t=243542 On Thu, 16 Jul 2020 at 21:19, David Mertz <mertz@gnosis.cx> wrote:
On Thu, Jul 16, 2020, 2:57 PM <redradist@gmail.com> wrote:
I know, I know that PyPy is fast as V8 but PyPy implement the whole library inside and it is not easy to embed it somewhere
I have no idea what you mean by that. PyPy doesn't need its standard library to run. Just like in CPython, those are just a bunch of external files that you can import or not, as desired.
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-leave@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/BW55H6... Code of Conduct: http://python.org/psf/codeofconduct/
On Thu, Jul 16, 2020, 1:33 PM David Mertz <mertz@gnosis.cx> wrote:
On Thu, Jul 16, 2020 at 12:59 PM <redradist@gmail.com> wrote:
Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ... First answer is simple, because big companies such as Google, Facebook and so on evolve this language and run-time for it ...
Check out PyPy. It is every bit as fast as the fastest Javascript engines like V8.
Does uvloop (libuv from NodeJS) work with PyPy? https://github.com/MagicStack/uvloop Can't remember where I thought I read that libuv + CPython asyncio is actually faster than node + libuv.
So is Numba, for that matter, but it's not language wide, so it's a slightly different beast.
FWIU, TypeScript (which compiles to ECMAscript (JS)) doesn't do any real compiler optimizations with the optional type annotations either?
On Sun, 19 Jul 2020 05:01:48 -0400 Wes Turner <wes.turner@gmail.com> wrote:
Can't remember where I thought I read that libuv + CPython asyncio is actually faster than node + libuv.
"faster" is pretty much meaningless without specifics. libuv + asyncio will certainly be fast if you're mostly transferring packets around (because most of the time will be spent in custom C code). If you're writing a complex protocol parser around that in pure Python, I'm not sure it will still be "faster". Regards Antoine.
On Fri, Jul 17, 2020 at 2:59 AM <redradist@gmail.com> wrote:
Recently I have been thinking about why `JavaScript` with it's horrible type system and lots of edge cases has supported so many platform and is very fast ...
First answer is simple, because big companies such as Google, Facebook and so on evolve this language and run-time for it ...
But it is only part of story, all this platforms would not be possible without some good architecture that was done by this companies
What is this architecture decision ? It is a splitting run-time and infrastructure
V8 is JavaScript engine that could very fast execute JavaScript and that is all !! It has a reach API using which you can embed this run-time almost every where ...
What if we in Python will accomplish the same solution ? What if Python would have some very fast engine that could be integrate in every environment ?
Engine will be able only execute Python code and call some registered callback (hooks) for `import` some module, for calling some registered C-extension and so on If this engine will be very portable then Python would be embedded everywhere !! ;)
There are lots of ways to embed Python, and there are a number of valid Python interpreters. There's even interpreters (multiple!) that are designed to work in web browsers. Good architecture isn't what made JavaScript so successful. Being successful is what made JavaScript so succesful. https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript ChrisA
participants (8)
-
Antoine Pitrou
-
Brett Cannon
-
Chris Angelico
-
David Mertz
-
Marco Sulla
-
redradist@gmail.com
-
Rhodri James
-
Wes Turner