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:

  • name is required and may contain letters, numbers, _, and -.
  • version defaults to 0.1.0.
  • entry defaults to src/main.walk.
  • build.output defaults to build/<name>.
  • project paths must be relative and stay inside the project root.
  • [dependencies] pins package dependencies by exact MAJOR.MINOR.PATCH version.

Package dependency example:

[dependencies]
geometry = "0.1.0"

Commands

Inside a project:

walk check
walk build
walk test
walk fmt
walk clean

Behavior:

  • walk check checks the entry file and tests/*_test.walk.
  • walk build compiles the configured entry and writes the native executable plus generated C next to build.output.
  • walk test runs every tests/*_test.walk.
  • walk fmt formats .walk files under the entry directory and tests/.
  • walk clean removes build/ 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.

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 publish requires non-empty README.md.
  • Publish runs walk check --warnings=error and walk test --warnings=error.
  • Published packages are copied to <registry>/<name>/<version>/.
  • walk package resolve copies packages into .walk/packages/ and writes walk.lock.
  • walk check, walk test, and walk build verify package cache checksums before using dependencies.
  • Build commands do not download packages automatically.