WalkLang Project Mode
Project mode starts when a directory contains walk.toml.
Create a project:
walk init hello
cd hello
Generated layout:
hello/
walk.toml
src/
main.walk
math_extra.walk
tests/
main_test.walk
build/
Config
walk.toml is intentionally small:
name = "hello"
version = "0.1.0"
entry = "src/main.walk"
[build]
output = "build/hello"
release = false
Rules:
nameis required and may contain letters, numbers,_, and-.versiondefaults to0.1.0.entrydefaults tosrc/main.walk.build.outputdefaults tobuild/<name>.- project paths must be relative and stay inside the project root.
[dependencies]pins package dependencies by exactMAJOR.MINOR.PATCHversion.
Package dependency example:
[dependencies]
geometry = "0.1.0"
Commands
Inside a project:
walk check
walk build
walk test
walk fmt
walk clean
Behavior:
walk checkchecks the entry file andtests/*_test.walk.walk buildcompiles the configured entry and writes the native executable plus generated C next tobuild.output.walk testruns everytests/*_test.walk.walk fmtformats.walkfiles under the entry directory andtests/.walk cleanremovesbuild/when the configured output lives there.
Single-file commands still work:
walk run examples/hello.walk
walk examples/hello.walk
walk build examples/hello.walk -o build/hello
walk test examples/v0_1_tests.walk
walk fmt examples/hello.walk
walk run <source.walk> compiles the file to a temporary native executable, runs it, streams program input and output, and removes the temporary build directory. walk <source.walk> is the shorthand for the same flow.
Module Search
Project tests can import modules from src/.
imp: math_extra
test: 'cube works'
assert: == math_extra.cube(3) 27
The importing file's directory is searched first. The project entry directory is searched next.
Package dependencies add locked package src/ directories after local project search paths. Package imports use dotted module names:
imp: geometry.core
out: geometry.core.double(3)
This import resolves from:
.walk/packages/geometry/0.1.0/src/geometry/core.walk
Packages
Create a package project:
walk package init geometry
Publish a documented package to a local registry:
cd geometry
walk package publish ../registry
Resolve an app's pinned dependencies from that registry:
cd ../shape_app
walk package resolve ../registry
Package behavior:
walk package publishrequires non-emptyREADME.md.- Publish runs
walk check --warnings=errorandwalk test --warnings=error. - Published packages are copied to
<registry>/<name>/<version>/. walk package resolvecopies packages into.walk/packages/and writeswalk.lock.walk check,walk test, andwalk buildverify package cache checksums before using dependencies.- Build commands do not download packages automatically.