Install smλ

The recommended way to use smoλ is through vscode, a popular and rather lightweight code editor. But the steps below apply to any setup:

1. Install vscode (recommended)

Get vscode from its official site. You can also use your editor of choice, or visit the language's own web playground for tinkering with and running one file in your browser.

➔ Get vscode➔ Web playground

2. Syntax highlighting

If you use an editor other than vscode, a Python syntax highlighter covers many language aspects. However, a vscode extension is provided. This offers:
 • syntax and error highlighting
 • mouse hover tooltips about types and functions
 • visiting definitions with ctrl+click
Either install the smoll extension by searching for the extension within vscode, or visit its page in the vscode marketplace by following the next link.

➔ Get the extension

3. Create a new project

Create a new folder. Place within it the executable matching your platform without changing its name. Then, open vscode or your editor of choice in that folder.

➔ Windows (smoll.exe) ➔ Linux (smoll)

In linux, also run chmod +x smoll to grant the download permission to run.
More instructions soon for other platforms, including cross-compilation using gcc.
 

4. Get a C compiler or interpret

Smoλ requires an assisting C compiler to produce a final executable, It is recommended to install the GCC compiler in your system, which the language tries to use by default. Otherwise smoλ can act as an interpreter for its own intermediate C code by adding --back vm. This is how the language runs in the web playground too.

In windows install GCC by installing msys2 first and then running:
pacman -S mingw-w64-ucrt-x86_64-gcc
 
➔ msys2 for Windows

In linux install GCC per:
sudo apt update
sudo apt install build-essential
Expand this to look at other supported compiler backends. You can use the exemplary antcc compiler (and add a star to it) for WSL or linux. This is faster than GCC with roughly comparable optimization speeds for smoλ code. A fork of that has been tailored to work well for us. Download the precompiled executable (or compile it from scratch), and place it in your project directory. Then add --back antcc to smoll runs.

➔ antcc binary


 

You are now ready! Create a main.s file like the one below. To compile and run the outcome, open a terminal in that folder (or use your editor’s integrated one) and run ./smoll main.s, where main.s is the name of your main file. The following will be printed in the console. Add –build to the command for only producing the executable.

repo "https://raw.githubusercontent.com/maniospas/smoll/refs/heads/main/std/" as "std/"
import "std/core.s"

def main()
    print "hello world!"
[+] process tests/test.s [+] transpile tests/test.c [+] compile gcc -O3 tests/test.c -o tests/test -I. [+] run ./tests/test hello world!

Note: a .cache folder caches web downloads; only downloads permitted by the main file are allowed.