A collection of tools to teach compiler design and implementation.
Project description
LogoVM
LogoVM is an abstract stack machine, loosely inspired by JavaVM, designed to provide a simple runtime environment to teach the design and implementation of compilers.
The initial design of the LogoVM, and where its name came from, was to aid in the implementation of a Logo compiler, during a one semester undergraduate course, so it provides some higher level functions for drawing lines, or controlling a drawing cursor.
To achieve the original goal, all computation is done using a stack, using a small set of low-level instructions. There is also a "high level" heap memory, where data is stored as full objects, and not bytes, meaning that if a huge string is on the first heap slot, the second heap slot may hold and integer, and the third heap slot may have a float value. A runtime environment that allows easy implementation of turtle graphics is also provided.
A specification of the LogoVM can be found on docs/specs.md.
Usage
To run a program simply call logovm <program>
.
Check logovm -h
for available options.
Installation
You may install the logovm
package through pip
:
pip install logovm
Some extra options are available:
graphic
: add support for graphic output (usingpillow
)test
: add dependencies for running automated testslint
: add dependencies to ensure minimum code qualitydev
: an alias that includelint
andtest
For example, when implementing a feature for LogoVM, you would use:
(virt_env) [repo/logovm] $ pip -e install .[dev]
It is strongly suggested that you use a Python virtual environment.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file logovm-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: logovm-0.2.1-py3-none-any.whl
- Upload date:
- Size: 41.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a8e9d194fd362a2a7ced34be78b459ed68504ad5df054b62f728d9e5606101 |
|
MD5 | 30bc2491036ecc2325c013e46aba3c61 |
|
BLAKE2b-256 | bfd5222dcbbb16641dbf4cbb60dc64f32afb9386a90b29661508441d3917ea11 |