Project Scaffolding with SPM

SP includes a modern package and project manager named spm. It creates standardized project directories, manages dependencies with Semantic Versioning, and produces deterministic lockfiles.

1. Initialize a New Project

bash
1spm init my_app

This generates the following directory layout:

my_app/
├── sp.toml            # Project configuration and dependency manifest
├── src/
│   └── main.sp        # Application entrypoint
└── tests/
    └── app_test.sp    # Embedded test blocks

2. The `sp.toml` Manifest

Dependencies are declared in standard TOML syntax:

sp.toml
1[package]
2name = "my_app"
3version = "0.1.0"
4authors = ["Your Name <you@example.com>"]
5license = "MIT"
6
7[dependencies]
8json = "^1.2.0"
9http = "^1.1.0"

3. Building and Running

bash
1cd my_app
2spm build
3spm run
Lockfile Generation
When you run spm build or spm install, spm automatically generates sp.lock containing cryptographic SHA-256 digests of all resolved packages for reproducible team builds.