This is a re-write of an older version of PeachPy (you will find it at https://bitbucket.org/MDukhan/peachpy), which supported x86-64 and ARM, but didn't generate object files directly. The new PeachPy currently only supports x86-64, albeit there are remnants of old code for ARM.
I didn't get the example in section "PeachPy as Instruction Encoder" to work for arm on the linked github version, the version currently on pypi, or the older bitbucket version. If the module loads at all, it seems to always complain about lacking function context.
- The old version of PeachPy (on BitBucket and PyPI) supports ARM, but can't directly generate machine code.
- The new version of PeachPy (on GitHub) can directly encode instructions into machine code, but currently only supports x86-64. The files in peachpy.arm module are merely non-working remnants of the old code.
I failed to get numba installed on a Raspberry Pi 2, and I'd been wanting to try Nim, which turned out to be easy to compile on the RPi running Ubuntu.
nim -r -d:release c rw_fibn.nim
...
Hint: operation successful (12152 lines compiled; 2.632 sec total; 8.870MB; Release Build) [SuccessX]
/home/rw/git/Nim/examples/rw_fibn
Result = 8944394323791464
elapsed time: 5.376946926116943
My first try at translating Python to Nim:
$ cat rw_fibn.nim
import times
proc fibn(reps: int64, num: int): int64 =
var z: int64
for r in 1..reps:
var
p1, p2: int64 = 1
rnum: int = num - 2
for i in 1..rnum:
z = p1 + p2
p2 = p1
p1 = z
return z
var start: float = times.epochTime()
var res = fibn(10_000_000, 78)
var finish: float = times.epochTime()
echo("Result = ", res)
echo("elapsed time: ", finish - start)
This is a cool paper. I'm saddened that there is not much discussion on it. It may be too jargon-laced. The above WaPo article takes away too much, and in my opinion, makes the topic less interesting.
If there is interest, I can take a stab at writing an explanation of this result for the technical person, such as those here on HN, who is uninitiated to the field.
That would be fantastic - and admittedly people like yourself or some other folks I can think of (Paul Whiteley of "Questioning Answers" fame comes to mind) are doing really great job on explaining the complex subjects in lay terms.