Re: [Python-ideas] Bytecode JIT

2017-07-03 Thread Victor Stinner
2017-07-02 14:13 GMT+02:00 Steven D'Aprano : > That only solves the problem of mysum being modified, not whether the > arguments are ints. You still need to know whether it is safe to call > some low-level (fast) integer addition routine, or whether you have to > go through

Re: [Python-ideas] Bytecode JIT

2017-07-02 Thread Soni L.
On 2017-07-02 02:41 AM, Steven D'Aprano wrote: On Sat, Jul 01, 2017 at 07:52:55PM -0300, Soni L. wrote: On 2017-07-01 07:34 PM, Victor Stinner wrote: Let's say that you have a function "def mysum (x; y): return x+y", do you always want to use your new IADD instruction here? What if I call

Re: [Python-ideas] Bytecode JIT

2017-07-02 Thread Chris Angelico
On Sun, Jul 2, 2017 at 10:13 PM, Steven D'Aprano wrote: >> But that's still a hard problem. Or at very least, it's decidedly >> non-trivial, and the costs are significant, so the net benefits aren't >> proven. > > In fairness, they are proven for other languages, and they

Re: [Python-ideas] Bytecode JIT

2017-07-02 Thread Steven D'Aprano
On Sun, Jul 02, 2017 at 03:52:34PM +1000, Chris Angelico wrote: > On Sun, Jul 2, 2017 at 3:41 PM, Steven D'Aprano wrote: > >> Let's say that you do. Given how short it is, it would just get inlined. > >> Your call of mysum ("a", "b") would indeed not use IADD, nor would it be

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Chris Angelico
On Sun, Jul 2, 2017 at 3:41 PM, Steven D'Aprano wrote: >> Let's say that you do. Given how short it is, it would just get inlined. >> Your call of mysum ("a", "b") would indeed not use IADD, nor would it be >> a call. It would potentially not invoke any operators, but instead

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Steven D'Aprano
On Sat, Jul 01, 2017 at 07:52:55PM -0300, Soni L. wrote: > > > On 2017-07-01 07:34 PM, Victor Stinner wrote: > >Let's say that you have a function "def mysum (x; y): return x+y", do > >you always want to use your new IADD instruction here? What if I call > >mysum ("a", "b")? > > > >Victor > >

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Soni L.
On 2017-07-01 11:57 PM, rym...@gmail.com wrote: This is literally PyPy. There's little reason for something like this to end up in official CPython, at least for now. It's literally not PyPy. PyPy's internal bytecode, for one, does have typechecks. And PyPy emits machine code, which is not

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread rym...@gmail.com
This is literally PyPy. There's little reason for something like this to end up in official CPython, at least for now. -- Ryan (ライアン) Yoko Shimomura, ryo (supercell/EGOIST), Hiroyuki Sawano >> everyone elsehttp://refi64.com On Jul 1, 2017 at 5:53 PM, > wrote: On 2017-07-01 07:34 PM, Victor

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Chris Angelico
On Sun, Jul 2, 2017 at 8:52 AM, Soni L. wrote: > On 2017-07-01 07:34 PM, Victor Stinner wrote: >> >> Let's say that you have a function "def mysum (x; y): return x+y", do you >> always want to use your new IADD instruction here? What if I call mysum >> ("a", "b")? >> >>

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Soni L.
On 2017-07-01 07:34 PM, Victor Stinner wrote: Let's say that you have a function "def mysum (x; y): return x+y", do you always want to use your new IADD instruction here? What if I call mysum ("a", "b")? Victor Let's say that you do. Given how short it is, it would just get inlined. Your

Re: [Python-ideas] Bytecode JIT

2017-07-01 Thread Victor Stinner
Let's say that you have a function "def mysum (x; y): return x+y", do you always want to use your new IADD instruction here? What if I call mysum ("a", "b")? Victor ___ Python-ideas mailing list Python-ideas@python.org

Re: [Python-ideas] Bytecode JIT

2017-06-30 Thread Soni L.
On 2017-06-30 07:17 PM, Victor Stinner wrote: 2017-06-30 17:09 GMT+02:00 Soni L. : CPython should get a tracing JIT that turns slow bytecode into fast bytecode. A JIT doesn't have to produce machine code. bytecode-to-bytecode compilation is still compilation.

Re: [Python-ideas] Bytecode JIT

2017-06-30 Thread Victor Stinner
2017-06-30 17:09 GMT+02:00 Soni L. : > CPython should get a tracing JIT that turns slow bytecode into fast > bytecode. > > A JIT doesn't have to produce machine code. bytecode-to-bytecode compilation > is still compilation. bytecode-to-bytecode compilation works on iOS, and >

Re: [Python-ideas] Bytecode JIT

2017-06-30 Thread Mark Lawrence via Python-ideas
On 30/06/2017 16:09, Soni L. wrote: CPython should get a tracing JIT that turns slow bytecode into fast bytecode. A JIT doesn't have to produce machine code. bytecode-to-bytecode compilation is still compilation. bytecode-to-bytecode compilation works on iOS, and doesn't require deviating

Re: [Python-ideas] Bytecode JIT

2017-06-30 Thread David Mertz
PyPy does basically this. So does the tentative project Pyjion. Also Numba, but on a pre-function basis. It's not a bad ideas, and one that currently exists with varying degrees of refinement in several projects. I may have forgotten a few others. I suppose Brython in a sense. This is very

Re: [Python-ideas] Bytecode JIT

2017-06-30 Thread Steven D'Aprano
On Fri, Jun 30, 2017 at 12:09:52PM -0300, Soni L. wrote: > CPython should get a tracing JIT that turns slow bytecode into fast > bytecode. Are you volunteering to do the work? -- Steve ___ Python-ideas mailing list Python-ideas@python.org

[Python-ideas] Bytecode JIT

2017-06-30 Thread Soni L.
CPython should get a tracing JIT that turns slow bytecode into fast bytecode. A JIT doesn't have to produce machine code. bytecode-to-bytecode compilation is still compilation. bytecode-to-bytecode compilation works on iOS, and doesn't require deviating from C. (This "internal bytecode"