-
Notifications
You must be signed in to change notification settings - Fork 0
Cargo Integration
Krait edited this page May 28, 2026
·
1 revision
KOSL can be utilized as a cleaner alternative for configuring Rust workspace manifests. Instead of writing standard Cargo.toml, you can maintain a Cargo.kosl file and compile/transpile it automatically.
| Cargo.toml Structure | Cargo.kosl Syntax |
|---|---|
| Standard Section | Object mapping package=(...)
|
| Nested Objects | Nested parentheses dependencies=(...)
|
| Arrays of Tables | List of objects bin=[(...), (...)]
|
package=(
name=my_project,
version=0.1.0,
edition=2021
)
dependencies=(
rand=0.8.5,
serde=(
version=1.0,
features=[derive]
)
)
bin=[
(
name=cli,
path=src/main.rs
)
]
[package]
name = "my_project"
version = "0.1.0"
edition = "2021"
[dependencies]
rand = "0.8.5"
[dependencies.serde]
version = "1.0"
features = ["derive"]
[[bin]]
name = "cli"
path = "src/main.rs"To keep your files updated automatically during local development builds, you can add a pre-build step to your shell alias or continuous integration script:
kosl transpile Cargo.kosl && cargo build