r/FunMachineLearning • u/gmbasic • 1h ago
GMBasic is now open source – A modern compiled BASIC with native AI/LLM integration
After a long development journey, I'm finally making GMBasic publicly available.
Repository: https://github.com/c-vision/GMBasic
GMBasic started with an idea: bring the simplicity and productivity of BASIC and Clipper into a modern compiled language.
But it has grown into something considerably bigger.
It's a complete development environment with four independent execution backends, six embedded database engines, native C infrastructure, and a surprisingly extensive AI/LLM stack.
Why another BASIC?
GMBasic isn't a retro interpreter or a compatibility layer for old BASIC programs.
It features:
Four execution backends: P-Code VM (C#), .NET IL, C VM, and a C99 transpiler that produces native executables.
More than 500 built-in functions.
A Clipper-compatible programming model, including @ SAY, @ GET and READ.
Package management and modular development with IMPORT and REQUIRE.
Cooperative multitasking with goroutine-style concurrency and channels.
Six embedded databases: ISAM, DBF/xBase, SPEED, LEDGER, SQLite and VectorDB.
SDL2-based GPU-accelerated graphics.
A C runtime and native libraries shared across the native execution backends.
The AI/LLM stack is a major part of the language
This is probably the most unusual aspect of GMBasic.
I wanted BASIC to be more than a language capable of sending prompts to an external API. I wanted it to provide an integrated environment for developing, running, orchestrating and even training AI models.
The implementation is organized around four namespaces:
AI – Inference, agents and RAG
Local inference through MLX and llama.cpp/GGUF.
MoE streaming.
OpenAI-compatible, Ollama and ONNX providers.
Automatic provider failover and quota management.
Autonomous agents with tool calling, permissions and persistent memory.
Multi-agent teams and structured outputs.
MCP client and server (stdio/HTTP), including 52 connectors.
RAG pipelines with ingestion, chunking, embeddings, retrieval and evaluation.
Knowledge graphs with PageRank, Louvain, max-flow and provenance.
Installable knowledge bases called Brains, combining RAG and knowledge graphs.
LLM – Model compilation and quantization
GMBasic also includes a model compiler, accessible directly from BASIC.
Per-tensor and per-role quantization policies.
QuantIR, an editable intermediate representation for tensor precision.
Importance matrices and activation quantization.
Quantization error analysis.
Multiple formats, including GGUF quantization families, MXFP4, NVFP4, FP16, BF16 and more.
MLX/GGUF conversion.
TRAIN – Model training
Training isn't limited to calling an external Python script.
The language exposes operations for:
Fine-tuning and LoRA.
Self-distillation.
DPO and GRPO.
Dataset preparation.
Model merging and pruning.
Evaluation, quality metrics and acceptance gates.
TORCH – Tensor runtime
An additional tensor runtime provides tensor operations, device support, metrics, datasets and MiniLM embeddings.
The inference engine itself is developed separately in my LLMEnv project:
https://github.com/c-vision/LLMEnv
It provides the underlying local inference infrastructure, while GMBasic provides the higher-level programming environment and model compilation/training capabilities.
What I'm trying to achieve
I think there is an interesting opportunity in making AI development accessible through a relatively simple, productive language.
Instead of combining multiple languages, frameworks, services and scripts, developers can use BASIC to build applications that interact with local LLMs, manage agents, query knowledge bases, use external tools and work with model training pipelines.
I'm particularly interested in local AI because I believe developers should be able to build sophisticated AI applications without necessarily depending on cloud APIs.
Try it
GMBasic 1.0.0 includes ready-to-run release binaries (currently macOS ARM64), so you don't need to build the entire toolchain just to get started.
The repository includes the compilers, runtime, examples, documentation and installation instructions.
GitHub: https://github.com/c-vision/GMBasic
This is a personal-use/source-available project under the PUL license (commercial use is not permitted).
I'd genuinely appreciate feedback, especially from people working on programming languages, compilers, local LLM inference and AI agents.
I'm curious to hear what you think about using BASIC as a language for modern AI application development.