Go compiler based on LLVM for better C/Python ecosystem integration
Top 60.6% on sourcepulse
LLGo is a Go compiler that leverages LLVM to enable seamless integration with the C ecosystem, including Python. It targets developers looking to expand Go's capabilities into areas like game development, AI, data science, WebAssembly, and embedded systems by providing a unified environment for Go, C, and Python.
How It Works
LLGo achieves C and Python interoperability through their respective Application Binary Interfaces (ABIs). It allows direct import and usage of C/C++ standard libraries and Python libraries by translating Go code into LLVM Intermediate Representation (IR). This approach facilitates calling C functions with callbacks and interacting with Python objects and functions directly within Go code.
Quick Start & Requirements
curl https://raw.githubusercontent.com/goplus/llgo/refs/heads/main/install.sh | bash ./install.sh
after meeting prerequisites._demo/hello
) and run llgo run .
.Highlighted Details
raylib
, sqlite
, llama2-c
, and openssl
.numpy
, pandas
, and torch
.bdwgc
by default, with an option to disable it (-tags nogc
).Maintenance & Community
The project is part of the Go+ project. Development tools like pydump
, pysigfetch
, and llpyg
are available for library integration.
Licensing & Compatibility
The repository does not explicitly state a license in the README. Compatibility for commercial use or closed-source linking is not specified.
Limitations & Caveats
The README notes that LLGo defer statements do not support usage within loops, which is described as a feature rather than a bug. Some Go standard library packages (math/big
, sync
, syscall
, runtime
, os
, fmt
, reflect
, time
, hash/crc32
, crypto/sha512
, crypto/hmac
, crypto/rand
, crypto/subtle
) are only partially supported. Manual import of C libraries is currently required, though automation is planned.
1 day ago
1 day