NanoPython - Researching the Feasibility of Running Python Scripts on Arduino Using a Virtual Machine
dc.contributor.author | CAMPBELL, TOBIAS | |
dc.contributor.author | STRÅLMAN, KARL | |
dc.contributor.department | Chalmers tekniska högskola / Institutionen för data och informationsteknik | sv |
dc.contributor.examiner | Lundin, Peter | |
dc.contributor.supervisor | Abel, Andreas | |
dc.contributor.supervisor | Bergholm, Björn | |
dc.date.accessioned | 2020-10-20T08:40:04Z | |
dc.date.available | 2020-10-20T08:40:04Z | |
dc.date.issued | 2020 | sv |
dc.date.submitted | 2020 | |
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. | sv |
dc.identifier.coursecode | LMTX38 | sv |
dc.identifier.uri | https://hdl.handle.net/20.500.12380/301926 | |
dc.language.iso | eng | sv |
dc.setspec.uppsok | Technology | |
dc.subject | Python | sv |
dc.subject | Java | sv |
dc.subject | C++ | sv |
dc.subject | ANTLR | sv |
dc.subject | Language virtualization | sv |
dc.subject | Virtual Machine | sv |
dc.subject | Compilation chain | sv |
dc.subject | Embedded Systems | sv |
dc.subject | Arduino | sv |
dc.subject | Programming Language Technology | sv |
dc.title | NanoPython - Researching the Feasibility of Running Python Scripts on Arduino Using a Virtual Machine | sv |
dc.type.degree | Examensarbete på kandidatnivå | sv |
dc.type.uppsok | M2 |