The recommended way to use smoλ is through vscode, a popular and rather lightweight code editor. But the steps below apply to any setup:
smoll main.s --docsHowever, a vscode extension is provided. This offers:
smoll extension
by searching for the extension within vscode, or visit its page in the vscode marketplace by following the next link.
chmod +x smoll to grant the download permission to run.
--back vm. This is how the language runs in the web playground too.
pacman -S mingw-w64-ucrt-x86_64-gcc
sudo apt update sudo apt install build-essential
--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.
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.