4. Cài đặt Aether
4.1. Yêu cầu
| Thành phần | Bắt buộc? | Dùng cho |
|---|---|---|
| Python 3.9 trở lên | Bắt buộc | Chạy trình biên dịch aetherc |
curl hoặc wget, tar,
sha256sum hoặc shasum |
Bắt buộc với cài một dòng lệnh | Tải và kiểm tra gói |
Trình biên dịch C (cc, clang, gcc; MinGW-w64 trên
Windows) |
Nên có | Backend c, c-aggregate,
c-simd và FFI |
| Go 1.23+ | Tùy chọn | Backend go và biên dịch chéo qua Go |
GNU as/ld (Linux), Xcode CLT (macOS),
MinGW-w64 (Windows) |
Tùy chọn | Backend native |
| clang + ld.lld, QEMU | Tùy chọn | Target linux-arm64, linux-riscv64,
build-bare |
Không cần quyền sudo hay quyền quản trị: Aether cài vào
thư mục người dùng.
4.2. Cài bằng một dòng lệnh
macOS, Linux, FreeBSD
curl -fsSL https://aether.presenceorbit.com/install.sh | sh
Hoặc với wget:
wget -qO- https://aether.presenceorbit.com/install.sh | sh
Script sẽ:
- Tải
aether-lang-v0.0.1-stable.tar.gzvàSHA256SUMStừhttps://aether.presenceorbit.com/releases/v0.0.1-stable/. - Kiểm tra SHA-256; sai thì dừng, không thay đổi gì trên máy.
- Cài vào
~/.local/share/aether-lang(hoặc$XDG_DATA_HOME/aether-lang) và tạo lệnhaetherc. - In ra dòng
export PATH=...để bạn thêm vào~/.zshrchoặc~/.bashrc.
Tùy chọn (truyền sau sh -s --):
# Cài một phiên bản cụ thể
curl -fsSL https://aether.presenceorbit.com/install.sh | sh -s -- --version 0.0.1-stable
# Cài vào thư mục khác
curl -fsSL https://aether.presenceorbit.com/install.sh | sh -s -- --prefix "$HOME/tools/aether"
# Gỡ cài đặt
curl -fsSL https://aether.presenceorbit.com/install.sh | sh -s -- --uninstall
Biến môi trường AETHER_DOWNLOAD_BASE cho phép trỏ tới
máy chủ gương (mirror) chứa cùng cấu trúc thư mục
releases/v<phiên bản>/.
Windows (PowerShell)
irm https://aether.presenceorbit.com/install.ps1 | iex
Phiên bản cụ thể hoặc gỡ cài đặt:
& ([scriptblock]::Create((irm https://aether.presenceorbit.com/install.ps1))) -Version 0.0.1-stable
& ([scriptblock]::Create((irm https://aether.presenceorbit.com/install.ps1))) -Uninstall
Script cài vào %LOCALAPPDATA%\aether-lang, tạo
aetherc.cmd và thêm thư mục bin vào PATH của
người dùng. Mở cửa sổ terminal mới sau khi cài.
Kiểm tra sau khi cài
aetherc --version # 0.0.1-stable
aetherc targets # danh sách target
printf 'fn main() -> i32 { return 42 }\n' > hello.ae
aetherc eval hello.ae # 42
4.3. Cài thủ công (khi không muốn chạy script qua mạng)
Tải hai tệp từ trang phát hành rồi tự kiểm tra:
V=0.0.1-stable
curl -fLO https://aether.presenceorbit.com/releases/v$V/aether-lang-v$V.tar.gz
curl -fLO https://aether.presenceorbit.com/releases/v$V/SHA256SUMS
grep "aether-lang-v$V.tar.gz" SHA256SUMS | shasum -a 256 -c - # hoặc sha256sum -c
tar -xzf aether-lang-v$V.tar.gz
sh aether-lang/install/install.sh aether-lang-v$V.tar.gz --sha256 SHA256SUMS
export PATH="$HOME/.local/share/aether-lang/bin:$PATH"
Windows:
$V = '0.0.1-stable'
Invoke-WebRequest "https://aether.presenceorbit.com/releases/v$V/aether-lang-v$V.zip" -OutFile "aether-lang-v$V.zip"
Invoke-WebRequest "https://aether.presenceorbit.com/releases/v$V/SHA256SUMS" -OutFile SHA256SUMS
Expand-Archive "aether-lang-v$V.zip" -DestinationPath .
.\aether-lang\install\install.ps1 -Archive "aether-lang-v$V.zip" -Sha256 SHA256SUMS
4.4. Chạy trực tiếp từ mã nguồn
Không cần cài: tải mã nguồn và gọi
python3 aetherc.py.
git clone https://github.com/porbit/aether.git
cd aether
python3 aetherc.py --version
python3 aetherc.py eval examples/control.ae
4.5. Gỡ cài đặt
curl -fsSL https://aether.presenceorbit.com/install.sh | sh -s -- --uninstall
# hoặc, không cần mạng:
sh ~/.local/share/aether-lang/share/aether-lang/uninstall.sh \
--manifest ~/.local/share/aether-lang/share/aether-lang/manifest.txt
Trình gỡ chỉ xóa đúng các tệp ghi trong manifest.txt;
mọi mục trỏ ra ngoài thư mục cài đặt (kể cả symlink) bị từ chối và báo
lỗi.
4.6. Cài công cụ phụ theo hệ điều hành
| Hệ điều hành | Lệnh gợi ý |
|---|---|
| macOS | xcode-select --install; tùy chọn
brew install go llvm qemu |
| Ubuntu/Debian | sudo apt install python3 gcc binutils; tùy chọn
clang lld qemu-user qemu-system-misc golang |
| Fedora | sudo dnf install python3 gcc binutils; tùy chọn
clang lld qemu-user golang |
| FreeBSD | pkg install python311; clang có sẵn trong hệ thống |
| Windows | Python từ python.org; MinGW-w64 (ví dụ qua MSYS2 hoặc Strawberry Perl); tùy chọn Go |
4.7. Xử lý sự cố
| Triệu chứng | Nguyên nhân thường gặp | Cách xử lý |
|---|---|---|
aetherc: command not found |
Chưa thêm bin vào PATH |
Chạy dòng export PATH=... mà script in ra, rồi mở
terminal mới |
python3: not found |
Thiếu Python | Cài Python 3.9+; hoặc đặt
AETHER_PYTHON=/đường/dẫn/python |
checksum mismatch |
Tải hỏng hoặc bị can thiệp | Tải lại; không dùng gói sai mã băm |
requires clang and ld.lld |
Thiếu công cụ cho target chéo | Cài clang và lld |
| Windows báo không chạy script | Chính sách thực thi PowerShell | Set-ExecutionPolicy -Scope CurrentUser RemoteSigned |