{"id":30878598,"url":"https://github.com/tdh8316/dspython","last_synced_at":"2025-09-08T05:11:59.548Z","repository":{"id":49318782,"uuid":"258231616","full_name":"tdh8316/DSPython","owner":"tdh8316","description":":snake: Damn Small Python compiler designed for use on Arduino for educational purposes. Based on LLVM.","archived":false,"fork":false,"pushed_at":"2023-01-29T06:34:38.000Z","size":412,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-07T22:37:47.937Z","etag":null,"topics":["arduino","llvm","llvm-frontend","python","python-compiler","python3","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tdh8316.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-23T14:26:30.000Z","updated_at":"2024-01-22T12:15:17.000Z","dependencies_parsed_at":"2023-02-15T21:15:31.461Z","dependency_job_id":null,"html_url":"https://github.com/tdh8316/DSPython","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tdh8316/DSPython","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdh8316%2FDSPython","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdh8316%2FDSPython/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdh8316%2FDSPython/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdh8316%2FDSPython/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tdh8316","download_url":"https://codeload.github.com/tdh8316/DSPython/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tdh8316%2FDSPython/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274135710,"owners_count":25228209,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-08T02:00:09.813Z","response_time":121,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","llvm","llvm-frontend","python","python-compiler","python3","rust"],"created_at":"2025-09-08T05:11:48.889Z","updated_at":"2025-09-08T05:11:59.533Z","avatar_url":"https://github.com/tdh8316.png","language":"Rust","readme":"# Notice\n\nThe new version of DSPython is now under the development in [dev branch](https://github.com/tdh8316/dspython/tree/dev)!\n\n# Warning\n\nDSPython is in the very initial stage of a development phase and should not be used in a production environment.\n\nYou can browse the [examples](https://github.com/tdh8316/dspython/tree/master/examples) directory to learn how DSPython interacts with Arduino.\n\n\u003e Are you disappointed? Please consider contributing!\n\n# DSPython - Damn Small Python\n\u003e 🐍 Python compiler intended to use in Arduino.\n\nThe [Micropython](https://github.com/micropython/micropython) project aims to put an implementation of Python 3 on microcontrollers, but it is not for Arduino.\n\nDSPython uses [LLVM](http://llvm.org/) to provide a way to compile programs written in the [Python programming language](https://www.python.org/).\nThe generated LLVM bytecode is intended to be similar to C++'s.\n\nAccordingly, **DSPython is internally not a Python** at all.\n\nHere is an example program that blinks the built-in LED of Arduino Uno:\n```python\n# Blink the built-in LED of Arduino Uno!\nfrom arduino import *\n\ndef setup():\n    pin_mode(13, 1)\n\ndef loop():\n    digital_write(13, 1)\n    delay(1000)\n    digital_write(13, 0)\n    delay(1000)\n```\n\nTo compile and upload this source, you can specify the serial port to upload by providing the `--upload-to` option.\nFor example, this compiles and uploads the [blink example](https://github.com/tdh8316/dsp/tree/master/examples/Blink.py) to the Arduino:\n\n```\ndspython examples/Blink.py --upload-to YOUR_PORT\n```\n\n## Supported boards\nCurrently, All examples have been tested only on Arduino Uno.\n\n- [Arduino Uno](https://store.arduino.cc/usa/arduino-uno-rev3)\n\n## Usage\n\n# Installation\n## Requirements\n- LLVM 10 (include llvm-config)\n\nOn Windows, the official LLVM releases do not contain many important components.\nYou have to use [pre-built LLVM binary](https://ziglang.org/deps/llvm%2bclang%2blld-10.0.0-x86_64-windows-msvc-release-mt.tar.xz) built for [Ziglang](https://github.com/ziglang/zig/wiki/Building-Zig-on-Windows)\n\n- Arduino IDE\n\nYou have to set the environment variable named `ARDUINO_DIR` to your arduino IDE location.\nThis is because DSPython requires Arduino standard headers, avr-gcc compiler, and avrdude.\n\n## Building from source\n## Installer packages\n\n# Contributing\nContributions are more than welcome!\n\nThis is my first project using LLVM and Rust language.\nPlease share your opinions. Any ideas would be highly appreciated!\n\n### Project goals\n - Damn small binary size\n - Support Arduino or microcontrollers\n - Programming Arduino with seemingly Python-like language\n### Neutral\nThese are not impossible, but currently not our goals.\n - Compile to other platforms\n - Garbage collector\n - Class and inheritance\n### Never\n - Complete Python implementation\n - Compile all python standard libraries\n - Support threading or asynchronous functions\n\n## The reason this project exists\nI wanted to program Arduino in other languages as well as C++ and thought the Python language would be a good choice.\nThat's why I decided to make a Python compiler that is available to upload directly to the Arduino.\n\nThe distinctive feature of DSP is that it uses LLVM internally instead of emitting [C++](https://arduino.github.io/arduino-cli/sketch-build-process/).\n\n# License\nLicensed under the MIT License\n\nCopyright 2022 `Donghyeok Tak`\n\n# Credit\n- The python parser is based on [RustPython](https://github.com/RustPython/RustPython)\n- Value handler from [testlang](https://github.com/AcrylicShrimp/testlang-rust/)\n- LLVM binding for rust is [Inkwell](https://github.com/TheDan64/inkwell)\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdh8316%2Fdspython","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftdh8316%2Fdspython","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftdh8316%2Fdspython/lists"}