Skip to content

Getting Started

Andrew Johnson edited this page Oct 12, 2024 · 16 revisions

Requirements

A Linux x86-64 computer or virtual machine is required to compile with LM.

Installation

Download the source. Compile and install it.

git clone https://github.com/andrew-johnson-4/lambda-mountain.git
cd lambda-mountain
sudo make install

Hello World

In a file hello_world.lm put a main function

import LIB/default.lm;

main := λ.(
   print 'hello_world_s
);

Compile hello_world from a shell

lm -o hello_world.s hello_world.lm
as -o hello_world.o hello_world.s
ld -o hello_world   hello_world.o

Run the result

./hello_world
[stdout] hello_world