02-环境搭建

Wan Yutong Lv2

Alum目前不具备跨平台性,仅支持x86_64 Linux平台

安装Rust

Alum不提供预编译的二进制文件,仅支持从源码编译安装,但Alum语言并不复杂,所以这不会花费很长时间。
为了安装Alum,需要先安装Rust,首先,执行以下命令安装rustup程序:

1
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

为了提高下载速度,使用以下命令使用国内镜像源

1
2
$ echo 'export RUSTUP_UPDATE_ROOT=https://mirrors.tuna.tsinghua.edu.cn/rustup/rustup' >> ~/.bashrc
$ echo 'export RUSTUP_DIST_SERVER=https://mirrors.tuna.tsinghua.edu.cn/rustup' >> ~/.bashrc

并切换到Bash以进行安装

1
2
$ bash
$ rustup default nightly # Alum依赖Rust Nightly

安装Alum

首先从GitHub克隆Alum的源码:

1
$ git clone https://github.com/wayuto/Alum.git --depth 1 ~/Alum

克隆完毕后,进入目录内运行安装脚本,这会安装alc编译器,almk构建工具,以及Alum的标准库:

1
2
$ cd ~/Alum
$ sh ./install.sh

然后,重新启动Shell, 就能使用alc, almk等程序了。

为了更好的开发体验,使用VSCode时,可以从本地安装~/Alum/alum-vscode/alum-vscode/alum-vscode-0.9.2.vsix ,注意:这并不包含LSP,仅提供Alum语法高亮。

  • Title: 02-环境搭建
  • Author: Wan Yutong
  • Created at : 2026-02-27 12:13:25
  • Updated at : 2026-03-03 11:38:47
  • Link: https://cr0.dpdns.org/2026/02/27/02-Installation/
  • License: This work is licensed under CC BY-NC-SA 4.0.
Comments
On this page
02-环境搭建