4 ms·
The future of this approach is Java 9 Truffle + Graal language compiler. Already a substantial amount of work has gone into making Ruby, R, node and Python to
by sandGorgon 9y ago
The future of this approach is Java 9 Truffle + Graal language compiler.
Already a substantial amount of work has gone into making Ruby, R, node and Python to work.
This is the Python implementation -
https://github.com/securesystemslab/zippy https://github.com/securesystemslab/zippy
http://chrisseaton.com/rubytruffle/jokerconf17/ http://chrisseaton.com/rubytruffle/jokerconf17/
- csl 9y agoTruffle + Graal looks awesome. I looked at some old ZipPy slides (JIT compiler for Python) here: http://socalpls.github.io/archive/2013nov/slides/zippy.pdf http://socalpls.github.io/archive/2013nov/slides/zippy.pdf They have an example where this code is compiled: def sumitup(n): total = 0 for i in range(n): total = total + i return total It was optimized quite well, but still had loops. I know this is a lot to ask, but I would have expected it to be possible to specialize it to a loopless variant: def sumitup(n): if n < 0: return 0 else: return n*(n-1) // 2 Clang 4+ actually finds this optimization, but gcc and icc doesn't seem to: https://godbolt.org/g/v4zhrm https://godbolt.org/g/v4zhrm That is, the assembly generated by clang seems to be equivalent to if n <= 0: return 0 else: return ((n-1)*(n-2) >> 1) + (n-1) which might even run faster on the CPU, due to the speficic code emitted.
- sandGorgon 9y agoyou should file this bug on the graal vm directly. https://github.com/graalvm/graal https://github.com/graalvm/graal
- wiz21c 9y agoAbout zippy. Licence says : Copyright (c) Regents of the University of California and individual contributors. On the wiki home page, we have : Author Wei Zhang, Facebook, Inc. Mohaned Qunaibit, University of California Irvine So basically, this is half owned by FaceBook... Right ?