Skip to content

Getting Started

It is planned to have a web compiler in the future to automatically generate Javascript that can be evaluated and run, which would allow you to try out Alan with zero steps, but for now, you need to install it from source.

Prerequisites

  • Rust v1.92.0 or higher — required for compilation (recommend rustup to install this)
  • Git — required to clone the repository (Windows users should probably use this, Mac and Linux users ought to know how to install git)
  • Node.js and npm (or yarn) — optional; needed for bundle, to-js, and test --js

Source Installation

Currently, the only way to install alan is to build it from source:

Installation shell commands
git clone https://github.com/alantech/alan
cd alan
cargo install --path .

Usage

Let's make a Hello, World! program:

Hello World shell commands
echo 'export fn main = print("Hello, World!");' > hello_world.ln
alan compile hello_world.ln
./hello_world

This should print something like:

Done! Took 1.13sec
Hello, World!

The first line being the compiler telling you how long it took to build the program and the second line being the actual program output.