Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #73182
| References | <mailman.11006.1402484547.18130.python-list@python.org> <Xh%lv.308109$Ch2.69303@fx13.am4> |
|---|---|
| From | 1989lzhh <1989lzhh@gmail.com> |
| Subject | Re: 基于cython的即时编译器cyjit,欢迎大家提建议 |
| Date | 2014-06-12 00:50 +0800 |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.11016.1402507984.18130.python-list@python.org> (permalink) |
sorry,wrong version post
发自我的 iPhone
> 在 Jun 12, 2014,0:16,mm0fmf <none@mailinator.com> 写道:
>
>> On 11/06/2014 10:37, 1989lzhh wrote:
>> 我正在写一个使用cython code作为后端的即时编译器名为cyjit,将python code
>> 转换为cython code再编译为c extension导入.设计上主要参考numba.jit的思路,
>> 使用decorate来指定要编译的function,例如:
>> from cyjit import jit
>> @jit('int(int,int)')
>> def add(a,b):
>> return a+b
>> add(1,2)#compiled
>>
>> @jit('int(int,int)',
>> locals='''
>> int c
>> ''')
>> def add1(a,b):
>> c=add(a,b)# fast invoked
>> return c
>> add1(1,2)
>>
>> 目前还不支持类型推导,需要手动使用c的语法对局部变量进行定义。
>> 编译过程是在jit函数中完成的,后续计划将编译过程移到函数运行时完成,实现
>> 重载。
>> 目前支持编译cache,第一次运行需要编译,时间稍慢,再次运行直接导入编译好
>> 的extension,速度就很快了。
>>
>> 欢迎大家fork,pull,提建议。
>>
>> https://github.com/liuzhenhai/cyjit
>
> You might say that but I couldn't possibly comment.
>
>
>
> --
> https://mail.python.org/mailman/listinfo/python-list
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
基于cython的即时编译器cyjit,欢迎大家提建议 1989lzhh <1989lzhh@gmail.com> - 2014-06-11 17:37 +0800
Re: 基于cython的即时编译器cyjit,欢迎大家提建议 mm0fmf <none@mailinator.com> - 2014-06-11 17:16 +0100
Re: 基于cython的即时编译器cyjit,欢迎大家提建议 Skip Montanaro <skip@pobox.com> - 2014-06-11 12:16 -0500
Re: 基于cython的即时编译器cyjit,欢迎大家提建议 1989lzhh <1989lzhh@gmail.com> - 2014-06-12 00:50 +0800
Re: 基于cython的即时编译器cyjit,欢迎大家提建议 1989lzhh <1989lzhh@gmail.com> - 2014-06-12 07:50 +0800
csiph-web