Install smoλ

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 and you can rely on a mixture of comprehensive error messages and creating documentation with
smoll main.s --docs
However, a vscode extension is provided. This offers:
 • syntax and error highlighting
 • mouse hover tooltips about types and functions
 • visiting definitions with ctrl+click
 • code completion recommendations for imports, variables, fields, and functions
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. Alternatively, add the executable to your system PATH. 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 run:
pacman -S mingw-w64-ucrt-x86_64-gcc
 
➔ msys2 for Windows

In linux install GCC per:
sudo apt update
sudo apt install build-essential
Compile with other backends, or for the web.
 • --back clang Instead of gcc, use the equally popular clang compiler.
 • --back tcc Incredibly fast but unoptimized compilation, use the *tcc* compiler.
 • --back antcc A trade-off between fast yet reasonably optimized compilation with the exemplary antcc compiler for WSL or linux. This is faster than GCC with roughly comparable optimization speeds for smoλ code. A fork of that compiler has been tailored to work well for us. Download the precompiled executable (or compile it from scratch), and place it in your project directory.
 • --back emcc Compile for the web using emcripten. Since this is typically used for creating visual application, refer to the ➔ Game dev tutorial.


➔ clang download ➔ tcc installation ➔ 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

def main()
    CLI = edit console() # console effects
    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.