Implementing Python for DrRacket

Authors Pedro Palma Ramos, António Menezes Leitão



PDF
Thumbnail PDF

File

OASIcs.SLATE.2014.127.pdf
  • Filesize: 474 kB
  • 15 pages

Document Identifiers

Author Details

Pedro Palma Ramos
António Menezes Leitão

Cite As Get BibTex

Pedro Palma Ramos and António Menezes Leitão. Implementing Python for DrRacket. In 3rd Symposium on Languages, Applications and Technologies. Open Access Series in Informatics (OASIcs), Volume 38, pp. 127-141, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2014) https://doi.org/10.4230/OASIcs.SLATE.2014.127

Abstract

The Python programming language is becoming increasingly popular in a variety of areas, most notably among novice programmers. On the other hand, Racket and other Scheme dialects are considered excellent vehicles for introducing Computer Science concepts. This paper presents an implementation of Python for Racket and the DrRacket IDE. This allows Python programmers to use Racket libraries and vice versa, as well as using DrRacket's pedagogic features. In particular, it allows architects and designers to use Python as a front-end programming language for Rosetta, an IDE for computer-aided design, whose modelling primitives are defined in Racket.

Our proposed solution involves compiling Python code into equivalent Racket source code. For the runtime implementation, we present two different strategies: (1) using a foreign function interface to borrow the data types and primitives from Python's virtual machine or (2) implementing Python's data model over Racket data types.

While the first strategy is easily implemented and provides immediate support for Python's standard library and existing third-party libraries, it suffers from performance issues: it runs, at least, one order of magnitude slower when compared to Python’s reference implementation.

The second strategy requires us to implement Python's data model in Racket and port all of Python's standard library, but it succeeds in solving the former's performance issues. Furthermore, it makes interoperability between Python and Racket code easier to implement and simpler to use.

Subject Classification

Keywords
  • Python
  • Racket
  • language implementations
  • compilers

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail