Back to results

Chalmers University of Technology

NanoPython - Researching the Feasibility of Running Python Scripts on Arduino Using a Virtual Machine

Abstract

dc:description.abstract

Virtualization today is a prominent method of both deploying and maintaining applications at a low cost. Various types of virtual machines exist and are used in different fields of computer science. Searching for new innovative ways to deploy tests, Swedish consultancy firm Broccoli wants to research the feasibility of running Python on an embedded system. This thesis primarily focuses on language virtual machines, the compilation involved and researching the feasibility of developing a Python virtual machine for a particular embedded system development board, an Arduino Uno. Starting with a subset of the Python grammar, a bytecode compiler written in Java was developed with the ANTLR tool. Meanwhile, a virtual machine running the compiler-generated bytecode was developed using C++. By adding small fragments to the grammar and accordingly writing additional code to account for this, more functionality was added to both the compiler and the virtual machine. By utilizing tests, functionality of the project could be preserved. The compiler runs the whole process of language processing, including lexing, parsing and code generation. It then generates code in a specific binary file format. A binary file can then be interpreted by the virtual machine. This enables the execution of simple Python scripts on both PC and the chosen system, without regard to optimization for neither compilation nor execution. Although not perfect, the current implementation does run on both systems. Some problems include the limited memory space of the Arduino and the lack of support for important language-defining constructs. Despite the drawbacks, with further improvements the current implementation may be used in the future as a means to rapidly deploy tests, which is of interest to Broccoli.

Degree

thesis:*
Level thesis:degree_level
M2
Department dc:contributor.department
Chalmers tekniska högskola / Institutionen för data och informationsteknik
Year dc:date.issued
2020

Author and committee

dc:creator, dc:contributor.*
Authors dc:creator
  • CAMPBELL, TOBIAS
  • STRÅLMAN, KARL
Advisors dc:contributor.supervisor
  • Abel, Andreas
  • Bergholm, Björn
Committee member dc:contributor.committeemember
  • Lundin, Peter

Subjects

dc:subject × 10

Rights

Language dc:language.iso
eng

Identifiers

dc:identifier.*
Dc Identifier Coursecode
LMTX38

Chain of custody

source
Harvested from
Chalmers University of Technology
Base URL
odr.chalmers.se/oai/request
Last updated
2026-11-19
Source record
OAI-PMH GetRecord
related terms
citation

CAMPBELL, TOBIAS; STRÅLMAN, KARL. NanoPython - Researching the Feasibility of Running Python Scripts on Arduino Using a Virtual Machine. M2 thesis, 2020. https://hdl.handle.net/20.500.12380/301926