Questions tagged [rpython]

RPython (Restricted Python) is a restricted subset of the Python programming language

RPython (Restricted Python) is a restricted subset of the programming language used to write the PyPy Python interpreter. Unlike standard Python, RPython is statically typed, to allow efficient compilation.

More information about RPython can be found in the Pypy coding guide, especially regarding the restrictions when using RPython compared to Python.

63 questions
2
votes
1 answer

Making PyPy toolchain input-language-independent

What would be the steps involved in updating the PyPy toolchain, to allow one to substitute RPython with any well-defined statically-typed language (e.g "RRuby", "RJavaScript", or any subsets of Haskell or ML or C that map to RPython's…
lobsterism
  • 3,469
  • 2
  • 22
  • 36
2
votes
1 answer

fitdistr in rpy2

I've a 1D list of data, that I want to fit into a distribution using either least squares or maximum likelihood, as presented here, but I want to do it from python instead of the R interactive shell. I got rpy2 installed, and would like to use the…
Sidd
  • 1,168
  • 2
  • 10
  • 27
1
vote
1 answer

Specifying installed native library paths during pypy translate

I am trying to build the latest pypy repo on a Mac machine. One of the needed libraries, libintl, is installed in $HOME/opt/local/lib. I run (using a previously built pypy-c), pypy-c translate.py -Ojit --ldflags=-L~/opt/local/lib…
highBandWidth
  • 16,751
  • 20
  • 84
  • 131
1
vote
1 answer

using R's rPython to run python's rpy2

I'm trying to use R to run a function I've written in python. That function uses some methods from R. So when I import the function from rPython, it crashes, probably due to circular import. Essentially, my R code may be reduced…
1
vote
1 answer

Error installing rPython (scrdir)

I am trying to install rPython but I get the following error about the scrdir installation. The scr file (makevars.win), as well as the configure.win file have the same path. The path I am using is: #!/bin/sh echo…
Biocrazy
  • 403
  • 2
  • 15
1
vote
0 answers

Running Tensor flow from R using rPython

I'm trying to use the Tensor flow Python module in RStudio using the package rPython. I am able to use the tensor flow module directly from Python. I have a Python file called "run.py" which imports tensor flow, and I can successfully call it in the…
JJTsai
  • 51
  • 5
1
vote
1 answer

Change version of python in rPython?

I'm trying to run tensor flow with rPython in RStudio and rPython uses a different version of python than the one in my terminal. How do you change which version rPython uses?
1
vote
0 answers

rPython and Tensorflow error when running session

i am currently trying to use tensorflow with R and rPython but i get a strange error when running a session. here an example: library(rPython) python.exec(" import sys from ctypes import * sys.argv = [''] import…
1
vote
1 answer

rPython method python.get returns weird encoding

I m trying to use rPython package to pass some arguments into python code and get results back. But for some reason I m getting weird encoding from my python code. Maybe someone has some hints to point me out. Here is my simple code to…
Alex
  • 533
  • 4
  • 12
1
vote
1 answer

PyPy translate 64bit

I can't seem to find the answer to this question anywhere. I'd just like to know, does the PyPy translate.py script produce 64bit or 32bit binary files? Is there an option to choose between the two that I'm missing or can PyPy only produce 32bit…
user3318845
  • 301
  • 4
  • 15
1
vote
2 answers

Game Library with Support for RPython

Are there any Python game libraries (Pygame, Pyglet, etc.) with support for RPython? Or game libraries specifically made for RPython? Or bindings for a game library for RPython?
Hophat Abc
  • 5,203
  • 3
  • 18
  • 18
1
vote
1 answer

Catching signals in RPython

How does one catch signals (specifically/especially SIGINT) in a translated RPython program? I've grepped through the PyPy source tree, I found the CPython signal module, and attempting to use this in the translated program gives the expected error…
huon
  • 94,605
  • 21
  • 231
  • 225
0
votes
1 answer

using rpy in a django app throws RPy_Exception: R Function "get" not found

Here's the traceback(copy pasted): Traceback Switch to copy-and-paste view /usr/local/lib/python2.6/dist-packages/django/core/handlers/base.py in get_response response = middleware_method(request) ... ▶ Local…
prongs
  • 9,422
  • 21
  • 67
  • 105
0
votes
1 answer

PyPy, RPython and Python versions compatibility when translation process

I'm trying to translate my RPython program using the PyPy 3.* packages as it appears on the download page. I can translate my simple RPython program only using the 2.7 PyPy version but not using any further versions. My RPython program: import…
Pavel Durov
  • 1,287
  • 2
  • 13
  • 28
0
votes
1 answer

RPython jit logs

I've being working on a simple VM in RPython, translating it using Pypy to inspect JIT traces: python ./.pypy/rpython/translator/goal/translate.py --opt=jit ${PWD}/src/awk_vm/awk_vm.py Makefile But when I run my translated program, I don't get…
Pavel Durov
  • 1,287
  • 2
  • 13
  • 28