Dag Sverre Seljebotn
d.s.seljebotn at astro.uio.no
Mon Apr 23 20:55:35 CEST 2012
On 04/23/2012 08:17 PM, Nathaniel Smith wrote:
> On Mon, Apr 23, 2012 at 6:09 PM, Dimitri Tcaciuc<dtcaciuc at gmail.com> wrote:
>> I may be misuderstanding the intent here, but here it goes.
>> If the main idea is to be able to call functions that are written in
>> Julia or other languages, I think an effort to create an LLVM backend
>> for Cython would go a long way towards inter-language connections as
>> the one discussed here. It should be possible to take Cython- and
>> Julia- produced LLVM bytecode and assemble it all together, applying
>> whatever bytecode optimizers that are available (eg. SSE
>> vectorization). A big advantage of that approach is that there's no
>> need for one language to know syntax conventions of the other one (or
>> at least not to full extent). Continuing the effort, it should be
>> possible to eliminate the need for writing an intermediate .c/.cpp
>> file if Clang compiler is used, which is also LLVM based.
> You'd still need some way to translate between the Cython and Julia
> calling conventions, runtimes, error handling, garbage collection
> regimes, etc. IIUC, LLVM IR isn't like the CLR -- it doesn't force
> languages into a common system for these things.
> Which might be great and worth the effort, I don't know, and don't
> want to discourage anyone. But there are literally hundreds of new
> languages designed every year, and a new *successful* language comes
> along maybe twice in a decade? And one of those recent ones was PHP,
> which shows you how important pure technical quality is in determining
> which ones survive (i.e., not much). Building a self-sustaining
> ecosystem requires a ton of work and a ton of luck. And here I'm still
> trying to *reduce* the number of languages I need in each analysis
> pipeline... so even though there are a number of really exciting
> things about Julia, and its author seems to know what he's doing, I'm
> still in wait-and-see mode.
I'm excited about Julia because it's basically what I'd *like* to
program in. My current mode of development for much stuff is Jinja2 or
Tempita used for generating C code; Julia would be a real step forward.
I recently started a thread on julia-dev, primarily to encourage them to
focus on binding to Python and use Python libraries rather than focusing
on creating their own libraries (though I wasn't that blunt). The
response is positive and I'm hopeful.
The thing is, I really hope we've moved beyond CPython in 10 years -- in
fact I'd go as far as saying that the reliance on CPython (specifically
the lack of a decent JIT) is a real danger for the survival of the
scientific Python ecosystem long-term! And I have my doubts about PyPy
too (though I'm really happy for Stefan's efforts to bring some sanity
with fixing cpyext).
If Julia gets into a mode where they bootstrap by piggy-backing on
Python's libraries, and gets that working transparently and builds a
userbase around that, the next natural step is to implement Python in
Julia, with CPython C-API compatability. Which would be great.
A very, very, very long shot of course.
More information about the cython-devel