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

dc.contributor.authorCAMPBELL, TOBIAS
dc.contributor.authorSTRÅLMAN, KARL
dc.contributor.departmentChalmers tekniska högskola / Institutionen för data och informationstekniksv
dc.contributor.examinerLundin, Peter
dc.contributor.supervisorAbel, Andreas
dc.contributor.supervisorBergholm, Björn
dc.date.accessioned2020-10-20T08:40:04Z
dc.date.available2020-10-20T08:40:04Z
dc.date.issued2020sv
dc.date.submitted2020
dc.description.abstractVirtualization 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.sv
dc.identifier.coursecodeLMTX38sv
dc.identifier.urihttps://hdl.handle.net/20.500.12380/301926
dc.language.isoengsv
dc.setspec.uppsokTechnology
dc.subjectPythonsv
dc.subjectJavasv
dc.subjectC++sv
dc.subjectANTLRsv
dc.subjectLanguage virtualizationsv
dc.subjectVirtual Machinesv
dc.subjectCompilation chainsv
dc.subjectEmbedded Systemssv
dc.subjectArduinosv
dc.subjectProgramming Language Technologysv
dc.titleNanoPython - Researching the Feasibility of Running Python Scripts on Arduino Using a Virtual Machinesv
dc.type.degreeExamensarbete på kandidatnivåsv
dc.type.uppsokM2
Ladda ner
Original bundle
Visar 1 - 1 av 1
Hämtar...
Bild (thumbnail)
Namn:
20-05 Campbell Strålman ODR.pdf
Storlek:
1.17 MB
Format:
Adobe Portable Document Format
Beskrivning:
License bundle
Visar 1 - 1 av 1
Hämtar...
Bild (thumbnail)
Namn:
license.txt
Storlek:
1.14 KB
Format:
Item-specific license agreed upon to submission
Beskrivning: