Examples
The repository ships a set of runnable examples under examples/, one folder
per topic. Each is a complete .scr program you can run directly with the
interpreter:
./build/interpreter/scrii_repl examples/01_hello_world/hello.scr
Topic tour
Language fundamentals
| Folder | Topic | What it shows |
|---|---|---|
01_hello_world | Hello world | Minimal program, print, basic script |
02_types | Types | Every value type and literals |
03_control_flow | Control flow | if/elif, while, for, foreach, switch |
04_functions | Functions | Named/anonymous functions, arguments, returns |
05_arrays | Arrays | Construction, indexing, nesting |
06_objects | Objects | Key/value maps, nesting, access |
07_operators | Operators | Arithmetic, comparison, logical, ternary, pipes |
08_strings | Strings | Concatenation, methods, std.string |
Standard library
| Folder | Topic | What it shows |
|---|---|---|
09_math | Math | std.math functions and constants |
10_file_io | File I/O | std.file read/write basics |
11_json | JSON | std.json parse/stringify |
12_sorting | Sorting | std.sort algorithms |
15_time | Time | std.time and timers |
16_hashing | Hashing | std.hash md5/sha256/crc32 |
17_system | System | std.system, std.env, process basics |
18_conversions | Conversions | std.convert number/base/string conversion |
23_paths | Paths | std.path resolution and decomposition |
27_compression | Compression | std.compression zstd/lz4 |
28_images | Images | std.image load/info/save with sample files |
Concurrency & networking
| Folder | Topic | What it shows |
|---|---|---|
14_async | Concurrency | std.async spawn/await/defer |
24_sockets | Sockets | std.net TCP/UDP |
25_http | HTTP | std.net HTTP client/server |
26_crypto_files | Crypto files | std.crypto encrypted file I/O |
Integration & advanced
| Folder | Topic | What it shows |
|---|---|---|
13_imports | Imports | import() and multi-file projects (libs/) |
19_advanced_patterns | Patterns | Idiomatic/advanced Scrii patterns |
20_text_adventure | Game | A small text-adventure program |
21_plugins | Plugins | load_plugin against a built shared library |
50_torture | Stress | Aggressive use of the interpreter |
Some examples need build-time prerequisites to run fully:
21_pluginsrequires the plugin shared library built first (see Native Plugins).26_crypto_files,25_http(TLS), and28_imagesneed the optional OpenSSL / image backends to be present at build time (see Backends).
Suggested reading order
Start at 01_hello_world and work up roughly by folder number — the later
examples (14_async, 20_text_adventure, 24_sockets, 25_http) assume
the language and stdlib topics from the earlier ones. The 50_torture suite
is a stress test more than a tutorial and is a good thing to run after
installing a new build.