Instructions
Follow these steps in order. Each one takes a few minutes.
Step 1: Download SaiLang
Open the download page and choose the package for your computer. On Windows and Linux, the v1.1.1 native apps do not need Python. The macOS app still uses the Python edition.
Step 2: Run the setup wizard
- Download SaiLang-Setup-v1.1.1.exe. Optionally check it with the checksum tool first.
- Double-click the file and follow the pages: Welcome, Licence, folder, Install, Finish.
- Leave Start SaiLang IDLE ticked and click Finish. SaiLang IDLE opens.
The v1.1.1 setup installs the native SaiLang IDLE editor, the native sai command and desktop programs. It adds Start Menu and desktop shortcuts and installs for your user account only. Python is not needed for the native Windows apps.
Step 3: Open SaiLang IDLE
Double-click the SaiLang IDLE icon on your desktop, or open it from the Start Menu. The SaiLang editor opens.
- File > Open loads a
.saiprogram. Tryexamples\hello.sai. - Press F5 to run the program. Output appears in the lower pane.
- Press F6 to check a program for mistakes without running it.
- Press Esc to stop a running program.
- If a program asks a question, type the answer in Program input and press Enter.
The setup wizard makes .sai files open in SaiLang IDLE automatically. Double-click any .sai file to open it.
Step 4: Write your first program
- In IDLE choose File > New.
- Type:
make name = ask("What is your name? ") say "Hello,", name - Choose File > Save As and save it as
hello.sai. - Press F5, type your name in the Program input box, and press Enter.
On Linux
- Download SaiLang-Linux-v1.1.1.tar.gz and extract it.
- In a terminal, go to the extracted folder and run
sh install.sh. It needs no administrator password. - Open SaiLang IDLE from your applications menu, or type
sailang-idle. For the command line, typesai examples/hello.sai.
The Linux programs are native and do not need Python. They do need the SDL2, SDL2_ttf and SDL2_image libraries. If they are missing, the installer prints an example command: sudo apt install libsdl2-2.0-0 libsdl2-ttf-2.0-0 libsdl2-image-2.0-0.
On a Mac
- Install Python 3.9 or newer from python.org. The macOS v1.1.1 app still uses the Python edition.
- Download SaiLang-macOS-v1.1.1.dmg and open it. Drag SaiLang-IDLE into the Applications folder.
- The first time, right-click SaiLang-IDLE and choose Open, then Open again. macOS asks this because the app is not yet signed by a registered developer.
Alternative: the Command Prompt
Open Command Prompt in the SaiLang folder and run:
set PYTHONPATH=src
python -m sailang examples\hello.sai
python -m sailang (starts the prompt)
python -m sailang check hello.sai (checks without running)
The set line lasts for one Command Prompt window, so run it again in each new window.
Windows and games
The examples desktop_app.sai, image_viewer.sai and coin_collector_game.sai open windows. Run them with F5 in IDLE. Closing the window ends the program.
Troubleshooting
- "Python was not found" or Windows opens the Microsoft Store
- Install Python from python.org as in Step 1. Then turn off the python "App execution alias" in Settings > Apps > Advanced app settings > App execution aliases.
- Windows or games do not open, and an error mentions Tkinter
- Run the Python installer again, choose Modify, and tick tcl/tk and IDLE.
- Double-clicking a
.saifile does nothing - Run the setup wizard again so that it sets up the file association, or right-click the file, choose Open with, and pick SaiLang IDLE.
- Smart App Control blocks
SaiLang-Setupor the SaiLang programs - SaiLang's Windows programs are not yet digitally signed, so Smart App Control may stop them. Use the source ZIP instead. Extract it, open Command Prompt in the folder, and run
set PYTHONPATH=srcthenpython -m sailang idle. Windows allows Python itself to run. - A file was saved as
hello.sai.txt - In Save As, set "Save as type" to All Files, or rename the file and remove the
.txt. - An error names a line number
- The message shows the file and line. In IDLE that line is highlighted in red. Read the message: it says what SaiLang expected.
- Text shows strange characters
- Save the file as UTF-8 (the IDLE save button does this for you).
