AML (AI Machine Language) is a modern programming language designed to bridge the gap between natural language and high-performance C++ code. It leverages large language models to translate human-readable instructions into optimized C++, which is then compiled to native binaries using industry-standard tools.
The AML project aims to democratize systems programming by allowing developers to express their intent in plain English, while still producing code that runs as fast as hand-optimized C++. This approach combines the productivity of high-level languages with the performance of low-level systems programming.
Key design principles of AML include:
- Natural Language First: Write code in plain English, let AML handle the translation to efficient C++.
- Performance by Default: Generated code is compiled with G++, ensuring native execution speed.
- Simplicity: No complex syntax to learn—just describe what you want in clear language.
- Extensibility: Use any LLM backend (OpenAI, LM Studio, local models) for code generation.
This tutorial will guide you through installing and using AML to create your first program.
Step 1: Installation
wget https://pixpo.ir/dl/v00/aml-v00.tar.gz
tar -xzf aml-v00.tar.gz
cd aml-v00
./aml
Step 2: Configure LLM Backend
Configure your preferred LLM backend:
aml config set model "gpt-4"
aml config set apikey "your-api-key-here"
aml config set posturl "https://api.openai.com/v1/chat/completions"
For local development with LM Studio:
aml config set model "local-model"
aml config set apikey "not-needed"
aml config set posturl "http://localhost:1234/v1/chat/completions"
Step 3: Write Your First Program
Create a file called hello.aml:
# hello.aml
Please write a C++ program that prints "Hello, World!" to the console
Step 4: Compile and Run
aml compile hello.aml hello
./hello
Output:
Hello, World!
Q: Do I need an API key?
A: Yes for cloud LLMs, no for local setups like LM Studio.
Q: What compilers are supported?
A: G++ are officially supported.
Q: Where can I download old versions?
A: Link.
Q: Is AML free?
A: Yes.