On Sun, Oct 16, 2011 at 11:50 AM, Maciej Fijalkowski <fij...@gmail.com>wrote:
> On Sun, Oct 16, 2011 at 2:29 PM, Stefan Behnel <stefan...@behnel.de> wrote > > Samuel Vaiter, 14.10.2011 17:59: > >> > >> The main > >> reason why Numpy is my main interest is that as Ph.D student in > >> Applied Mathematics, I really hope one day we will be able to perform > >> numerical computation without using heavy binding in C/Fortran or > >> intermediate solution like Cython. > > > > I guess you didn't mean it that way, but "intermediate solution" makes it > > sound like you expect any of these to go away one day. They sure won't. > > Manually optimised C and Fortran code will always beat JIT compilers, > > especially in numerics. It's a game they can't win - whenever JIT > compilers > > get too close to hand optimised code, someone will come along and write > > better code. > > > > Stefan > > I guess what you say is at best [citation needed]. We have proven > already that we can perform several optimizations that are very hard > to perform at the C level. And indeed, while you can always argue > "well, you can just write a better compiler", it's true also for JITs. > And we're only at the beginning of what we can do. > > One example that I have in mind is array expressions that depend on > runtime - we can optimize them fairly well in the JIT (which means SSE > and whatnot), but you just can't get the same thing in C, because > you're unable to compile native code per a set of array operations. > > Cheers, > fijal > _______________________________________________ > pypy-dev mailing list > pypy-dev@python.org > http://mail.python.org/mailman/listinfo/pypy-dev > Another example, which no fortran compiler will ever be able to do, is if you create a ufunc from a Python function, you can still inline it into assembler that's emitted for an operation so: a + b * sin(my_ufunc(c)) still generates a single loop in assembler. Alex -- "I disapprove of what you say, but I will defend to the death your right to say it." -- Evelyn Beatrice Hall (summarizing Voltaire) "The people's good is the highest law." -- Cicero
_______________________________________________ pypy-dev mailing list pypy-dev@python.org http://mail.python.org/mailman/listinfo/pypy-dev