[Cython] Funny idea: interpreted def functions

2013-06-11 Thread Nikita Nemkin

Hi,

Pure Python functions rarely benefit from compilation. I thought it
would be interesting to add an "interpreted" directive (global,
module, class, function level + automatic heuristic) that will
instruct Cython to compile def functions into _bytecode_ and store
that bytecode in the binary.

Together with module bundling and embed/freeze it could make a neat
deployment solution.

(I have no plans to implement this.)

Best regards,
Nikita Nemkin
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Funny idea: interpreted def functions

2013-06-11 Thread Stefan Behnel
Nikita Nemkin, 11.06.2013 13:51:
> Pure Python functions rarely benefit from compilation. I thought it
> would be interesting to add an "interpreted" directive (global,
> module, class, function level + automatic heuristic) that will
> instruct Cython to compile def functions into _bytecode_ and store
> that bytecode in the binary.
> 
> Together with module bundling and embed/freeze it could make a neat
> deployment solution.

Well, it shouldn't be all that hard to implement. Basically, we'd send a
part of the source file through the Python parser after having parsed and
processed it in the compiler.

However, I fail to see the advantage of this feature that would make it
worth providing to users. There usually *is* a visible performance
advantage of compiled code over pure Python code, and the advantages of
interpreted Python code in terms of semantics or compatibility are quite
limited (debugging, maybe, or introspection).

Could you describe how/why you came up with this?


> (I have no plans to implement this.)

I can imagine.

Stefan

___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Funny idea: interpreted def functions

2013-06-11 Thread Nikita Nemkin

On Tue, 11 Jun 2013 20:03:45 +0600, Stefan Behnel 
wrote:


Nikita Nemkin, 11.06.2013 13:51:

Pure Python functions rarely benefit from compilation. I thought it
would be interesting to add an "interpreted" directive (global,
module, class, function level + automatic heuristic) that will
instruct Cython to compile def functions into _bytecode_ and store
that bytecode in the binary.

Together with module bundling and embed/freeze it could make a neat
deployment solution.


Well, it shouldn't be all that hard to implement. Basically, we'd send a
part of the source file through the Python parser after having parsed and
processed it in the compiler.

However, I fail to see the advantage of this feature that would make it
worth providing to users. There usually *is* a visible performance
advantage of compiled code over pure Python code, and the advantages of
interpreted Python code in terms of semantics or compatibility are quite
limited (debugging, maybe, or introspection).


Let's just say there are legitimate reasons to stay interpreted,
binary size and compatibility among them.


Could you describe how/why you came up with this?


Well, I was wondering why isn't CPython written in Cython
(actually I know why) and how awesome it would be to have a
system with CPython runtime and unified Cython/Python compiler
front-end targeting both bytecode and native code.
In such system, per-function compiled/interpreted switch would
feel natural to me...

That's how, if it answers your question.

And from a different angle: many people praise Go(lang) for it's
"single fat binary" deployment approach.
First class bytecode support in Cython colud provide the same
for Python. (Maybe not quite the same, but a step in this direction.)


Best regards,
Nikita Nemkin
___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel


AC�LIO JO�O CARLOS MOREIRA DE CARVALHO AMORIM NETO

2013-06-11 Thread Michael Klein
GOULART JUCIMARA VICENTE DOS SANTOS, DAMIANA PEREIRA DE OLIVERIA, ANA ANGELICA 
PEREIRA ALVES, PAULO DE SIQUEIRA SILVA. PAULO DE SIQUEIRA SILVA. AMAURI CLIFE, 
ELEUTÉRIO LEAL, LEAL CORLETTO, CLIFE ACÍLIO LEAL.

ELEUTÉRIO GOULART, VICTOR DI MELLO, JAVERT MONTEIRO, NELSON DANTAS, DANIEL DE 
OLIVEIRA, RICARDO CORTE REAL, FLÁVIO SILVINO, LUIS GUSTAVO, BABU SANTANA, 
SERAFIM GONZALEZ, HARILDO DEDA, MARCOS FROTA, CARLOS VERGUEIRO, PAULO GIARDINI, 
ELIEZER MOTTA, JULIANO CAZARRÉ, ANDERSON LAU ANTUNES, ACILINO. AFONSO CLÁUDIO, 
INDAIABIRA, FERNANDO PEDROZA IGARATINGA.

AMAURI ANTUNES, ACILINO. AFONSO CLÁUDIO, INDAIABIRA, FERNANDO PEDROZA JOÃO 
CARLOS MOREIRA DE CARVALHO OURO VERDE DE MINAS PAULO DE SIQUEIRA SILVA 
BALDOMERO GOULART, CLIFE LEAL.

___
cython-devel mailing list
cython-devel@python.org
http://mail.python.org/mailman/listinfo/cython-devel