https://github.com/andygeiss/esp32-transpiler
Transpile Golang into Arduino code to use fully automated testing at your IoT projects.
https://github.com/andygeiss/esp32-transpiler
arduino esp32 go golang transpiler
Last synced: 14 days ago
JSON representation
Transpile Golang into Arduino code to use fully automated testing at your IoT projects.
- Host: GitHub
- URL: https://github.com/andygeiss/esp32-transpiler
- Owner: andygeiss
- License: mit
- Created: 2018-03-14T14:22:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T05:28:07.000Z (7 months ago)
- Last Synced: 2025-01-31T18:19:04.251Z (21 days ago)
- Topics: arduino, esp32, go, golang, transpiler
- Language: Go
- Homepage:
- Size: 66.4 KB
- Stars: 88
- Watchers: 4
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-go - esp32 - Transpile Go into Arduino code. (Go Compilers / Search and Analytic Databases)
- awesome-go-extra - esp32-transpiler - 03-14T14:22:55Z|2022-08-23T19:40:45Z| (Go Compilers / Advanced Console UIs)
README
# ESP32 Transpiler
[](https://github.com/andygeiss/esp32-transpiler/blob/master/LICENSE)
[](https://github.com/andygeiss/esp32-transpiler/releases)
[](https://goreportcard.com/report/github.com/andygeiss/esp32)
[](https://codeclimate.com/github/andygeiss/esp32-transpiler/maintainability)## Purpose
The [Arduino IDE](https://www.arduino.cc/en/Main/Software) is easy to use.
But I faced problems like maintainability and testability at more complicated IoT projects.
I needed to compile and flash the ESP32 before testing my code functionality by doing it 100% manually.This solution transpiles Golang into Arduino code, which can be compiled to an image by using the ESP32 toolchain.
Now I am able to use a fully automated testing approach instead of doing it 100% manually.**Important**:
The Transpiler only supports a small subset of the [Golang Language Specification](https://golang.org/ref/spec).
Look at the [mapping](https://github.com/andygeiss/esp32-transpiler/blob/master/transpile/handlers/mapping.go) and the [tests](https://github.com/andygeiss/esp32-transpiler/blob/master/transpile/service_test.go) to get the current functionality.
It is also not possible to trigger the C/C++ Garbage Collection, because Golang handles it automatically "under the hood".
Go strings will be transpiled to C constant char arrays, which could be handled on the stack.## Installation
go get -u github.com/andygeiss/esp32-transpiler
## Usage
Usage of esp32-transpiler:
-source string
Golang source file
-target string
Arduino sketch file