[Cython] gsoc: array expressions

mark florisson markflorisson88 at gmail.com
Wed May 30 00:32:15 CEST 2012


On 29 May 2012 23:29, Robert Bradshaw <robertwb at gmail.com> wrote:
> On Tue, May 29, 2012 at 3:22 PM, mark florisson
> <markflorisson88 at gmail.com> wrote:
>>>>>> I started a new project, https://github.com/markflorisson88/minivect ,
>>>>>> which currently features a simple C code generator. The specializer
>>>>>> and astbuilder do most of the work of creating the right AST, so the
>>>>>> code generator only has to implement code generation functions for
>>>>>> simple expressions. Depending on how it progresses I will look at
>>>>>> incorporating Theano's optimizations into it and having Theano use it
>>>>>> as a C backend for compatible expressions.
>>>>>
>>>>> I forgot to mention, it's still pretty basic, but it works for simple
>>>>> arithmetic expressions with non-overlapping (shifted) memory from
>>>>> Cython: https://github.com/markflorisson88/cython/commit/2c316abdbc1228597bbdf480f737a59213ee9532#L4R1
>>>>
>>>> So basically, this project is to be used as a git submodule in Cython,
>>>> and to be shipped directly in the source distribution. Is there any
>>>> objection to that?
>>>
>>> I'm not sure this is the best long-term solution (the alternative
>>> would be making it part of Cython or adding a dependency) but I think
>>> that's fine for now. I'm assuming there that the end user doesn't
>>> explicitly reference it, right? It's just an optimization if present.
>>>
>>> - Robert
>>
>> The only gotcha is that when you checkout Cython from github you will
>> need to update the submodule.
>
> Manually, right? How badly do things go wrong if you forget to?

Unfortunately, yes, I don't think there's an automatic way with git.
The compiler could display an error message, like "did you forget to
do ...".

>> It's not really an optimization, it's an
>> implementation, that is the Cython AST needs to be mapped onto the new
>> AST, and then it generates the C code from that.
>
> I meant in the sense that the user never refers to this code
> explicitly, so we have the flexibility of merging it in/splitting it
> off/moving it around internally without breaking users, right?

Definitely, we can do that if we wish. I don't know how easy merging
in new code is if we also modify the Cython version though.

> - Robert
> _______________________________________________
> cython-devel mailing list
> cython-devel at python.org
> http://mail.python.org/mailman/listinfo/cython-devel


More information about the cython-devel mailing list