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
50
votes
2 answers

Does PyPy translate itself?

Am I getting this straight? Does the PyPy interpreter actually interpret itself and then translate itself? So here's my current understanding: RPython's toolchain involves partially executing the program to be translated to get a sort of…
alexgolec
  • 26,898
  • 33
  • 107
  • 159
27
votes
1 answer

Can PyPy/RPython be used to produce a small standalone executable?

(Or, "Can PyPy/RPython be used to compile/translate Python to C/C++ without requiring the Python runtime?") I have tried to comprehend PyPy with its RPython and its Python, its running and its compiling and its translating, and have somewhat…
Chris Morgan
  • 86,207
  • 24
  • 208
  • 215
15
votes
1 answer

Where's the GIL in PyPy?

Is the PyPy GIL part of the PyPy interpreter implementation in RPython, or is it something that translate.py automatically adds? i.e., if I were to write my own new language interpreter in RPython and ran it through translate.py, would it be…
lobsterism
  • 3,469
  • 2
  • 22
  • 36
14
votes
2 answers

what is statically typed in RPython?

It is often stated that RPython (a subset of Python) is statically typed. (E.g. on Wikipedia.) Initially, I wondered how they would add that to Python and thought that they might have added the requirement to add statements such as assert…
Albert
  • 65,406
  • 61
  • 242
  • 386
11
votes
5 answers

Explicitly typed version of Python?

I rather like Python's syntactic sugar; and standard library functions. However the one feature which I dislike; is implicit typing. Is there a distribution of Python with explicit typing; which is still compatible with e.g.: packages on PyPi? [I…
A T
  • 13,008
  • 21
  • 97
  • 158
9
votes
1 answer

are generators supported in RPython?

Are generators supported in RPython, because I just read something in PyPy's documentation that says they are not PyPy Doc - Coding Guide They seem easy to be translated to a statically typed language like C because every generation step is…
costy.petrisor
  • 783
  • 7
  • 17
8
votes
1 answer

RPython sys methods don't work

I have the following code: import sys def entry_point(argv): sys.exit(1) return 0 def target(*args): return entry_point, None However, when I run python ./pypy/pypy/translator/goal/translate.py t.py I get the following…
math4tots
  • 8,540
  • 14
  • 58
  • 95
8
votes
1 answer

Options beyond RPython for writing interpreters w/ JITs?

I'm really interested in the PyPy project, but for the 1st (but less well-known) of its purposes listed below: A set of tools for implementing interpreters for interpreted languages An implementation of Python using this toolchain In the following…
lobsterism
  • 3,469
  • 2
  • 22
  • 36
7
votes
5 answers

rPython using wrong python installation on Mac OSX

I've installed python 2.7.8 alongside the 2.7.5 which comes with OSX 10.9.4. Now how can I point rPython to python 2.7.8? Attempt #1 I've modified the OSX .bash_profile as follows to point everything to the newer python installation. export…
Tommy O'Dell
  • 7,019
  • 13
  • 56
  • 69
5
votes
1 answer

How to run python script in Rstudio

I have a problem on how to run a python script from Rstudio? My initial idea is to grab the python script from a GitHub repository then run it in R, I grabbed python code by using script <- getURL(URL, ssl.verifypeer = FALSE), from RCurl package, I…
twang
  • 109
  • 1
  • 5
4
votes
1 answer

What interpreters have been made using the PyPy Translator Toolchain?

What interpreters have been made using the PyPy Translator Toolchain besides PyPy itself?
None
  • 3,875
  • 7
  • 43
  • 67
4
votes
1 answer

rPython and __future__ imports

My python script starts with from __future__ import division In R I do library(rPython) python.load("myscript.py") I get File "", line 2 SyntaxError: from future imports must occur at the beginning of the file
Diogo Santos
  • 804
  • 2
  • 13
  • 26
4
votes
4 answers

rPython installation fails, libpython not in linker paths

I got an error in R when building the rPython package, specifically the part that links against libpython2.7: gcc -std=gnu99 -I/foo/bar/R-3.1.1/lib64/R/include -DNDEBUG -I/usr/local/include \ -I/foo/bar/Python-2.7.6/include/python2.7…
John Zwinck
  • 239,568
  • 38
  • 324
  • 436
4
votes
1 answer

Would Hindley Milner type inference be useful to PyPy for RPython?

Does PyPy do static type checking at compile time to catch type errors at compile time? And if not would something like HM type inference be useful to catch those errors at compile time?
user782220
  • 10,677
  • 21
  • 72
  • 135
3
votes
1 answer

Connecting to DynamoDB using R

I would like to connect to DynamoDB with R. My ultimate goal is to create a Shiny App to display data that is stored at DynamoDB and updated frequently. So I need an efficient way to retrieve it using R. The following references give an intuition…
OzanStats
  • 2,756
  • 1
  • 13
  • 26
1
2 3 4 5