@greenpandastudios/aug-cli 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -6
- package/THIRD_PARTY_NOTICES.md +4 -0
- package/bin/aug.mjs +12 -2
- package/docs/about.md +27 -0
- package/docs/api/crypto.md +103 -69
- package/docs/api/io.md +35 -33
- package/docs/api/json.md +3 -3
- package/docs/api/memory.md +23 -19
- package/docs/api/time.md +10 -9
- package/docs/api/web.md +33 -38
- package/docs/assets/benchmarks/execution.svg +774 -637
- package/docs/assets/benchmarks/http.svg +278 -249
- package/docs/assets/benchmarks/improvements.svg +66 -66
- package/docs/assets/benchmarks/kernels-mobile.svg +1 -0
- package/docs/assets/benchmarks/kernels.svg +1 -0
- package/docs/assets/benchmarks/memory.svg +153 -153
- package/docs/benchmark-results.json +227089 -90363
- package/docs/compatibility.md +8 -8
- package/docs/contributing-benchmarks.md +68 -0
- package/docs/dev-containers.md +88 -0
- package/docs/dgx-consumers.json +122 -0
- package/docs/dgx-gyms.json +784 -0
- package/docs/dgx-kernels.json +1170 -0
- package/docs/dgx-performance.json +227849 -0
- package/docs/dgx-spark.md +64 -0
- package/docs/diagnostics.md +15 -5
- package/docs/docker.md +173 -12
- package/docs/editor.md +35 -0
- package/docs/example-projects.json +238 -24
- package/docs/examples/approved-design/counters.md +34 -126
- package/docs/examples/approved-design/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/approved-design/domain/app.md +13 -77
- package/docs/examples/approved-design/domain/export.md +5 -19
- package/docs/examples/approved-design/domain/models.md +4 -23
- package/docs/examples/approved-design/domain/numbers.md +24 -114
- package/docs/examples/approved-design/index.md +16 -7
- package/docs/examples/approved-design/main.md +19 -96
- package/docs/examples/benchmark/index.md +6 -5
- package/docs/examples/benchmark/main.md +7 -35
- package/docs/examples/calls-benchmark/index.md +36 -0
- package/docs/examples/calls-benchmark/main.md +78 -0
- package/docs/examples/calls-benchmark/operations.md +60 -0
- package/docs/examples/cli-args/index.md +6 -5
- package/docs/examples/cli-args/main.md +6 -31
- package/docs/examples/collections/index.md +6 -5
- package/docs/examples/collections/main.md +7 -35
- package/docs/examples/collections-benchmark/index.md +6 -5
- package/docs/examples/collections-benchmark/main.md +7 -35
- package/docs/examples/cpu-benchmark/index.md +6 -5
- package/docs/examples/cpu-benchmark/main.md +5 -24
- package/docs/examples/developer-workflow/calculator.md +39 -186
- package/docs/examples/developer-workflow/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/developer-workflow/index.md +16 -7
- package/docs/examples/developer-workflow/logging/console.md +10 -56
- package/docs/examples/developer-workflow/logging/export.md +4 -14
- package/docs/examples/developer-workflow/logging/logger.md +7 -43
- package/docs/examples/developer-workflow/main.md +17 -69
- package/docs/examples/drop/index.md +6 -5
- package/docs/examples/drop/main.md +7 -27
- package/docs/examples/drop/resource.md +7 -30
- package/docs/examples/errors/errors.md +7 -27
- package/docs/examples/errors/index.md +6 -5
- package/docs/examples/errors/main.md +7 -28
- package/docs/examples/errors-benchmark/index.md +36 -0
- package/docs/examples/errors-benchmark/main.md +92 -0
- package/docs/examples/errors-benchmark/operations.md +65 -0
- package/docs/examples/ffi/index.md +6 -5
- package/docs/examples/ffi/main.md +6 -20
- package/docs/examples/ffi/native.md +8 -34
- package/docs/examples/float-benchmark/index.md +35 -0
- package/docs/examples/float-benchmark/main.md +75 -0
- package/docs/examples/generic-di/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/generic-di/index.md +6 -5
- package/docs/examples/generic-di/main.md +9 -39
- package/docs/examples/generic-di/types.md +23 -92
- package/docs/examples/generics/index.md +6 -5
- package/docs/examples/generics/main.md +10 -47
- package/docs/examples/generics/types.md +25 -100
- package/docs/examples/hello/app/export.md +4 -12
- package/docs/examples/hello/app/greeter.md +13 -91
- package/docs/examples/hello/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/hello/index.md +17 -6
- package/docs/examples/hello/logging/console.md +10 -54
- package/docs/examples/hello/logging/export.md +4 -14
- package/docs/examples/hello/logging/logger.md +7 -45
- package/docs/examples/hello/main.md +9 -39
- package/docs/examples/http-benchmark/index.md +6 -5
- package/docs/examples/http-benchmark/main.md +6 -20
- package/docs/examples/http-benchmark/routes.md +9 -31
- package/docs/examples/index.md +63 -29
- package/docs/examples/interceptors/app.md +20 -139
- package/docs/examples/interceptors/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/interceptors/index.md +6 -5
- package/docs/examples/interceptors/interceptors.md +24 -148
- package/docs/examples/interceptors/logging.md +13 -76
- package/docs/examples/interceptors/main.md +10 -65
- package/docs/examples/json-benchmark/data.md +4 -20
- package/docs/examples/json-benchmark/dependencies/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +67 -0
- package/docs/examples/json-benchmark/index.md +7 -5
- package/docs/examples/json-benchmark/main-yaml.md +20 -0
- package/docs/examples/json-benchmark/main.md +10 -49
- package/docs/examples/list-benchmark/index.md +35 -0
- package/docs/examples/list-benchmark/main.md +78 -0
- package/docs/examples/map-churn-benchmark/index.md +35 -0
- package/docs/examples/map-churn-benchmark/main.md +106 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/api.md +104 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.md +54 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi-json.md +48 -0
- package/docs/examples/native-blake3/hashing.md +93 -0
- package/docs/examples/native-blake3/index.md +38 -0
- package/docs/examples/native-blake3/main.md +73 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/api.md +406 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.md +51 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.md +63 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi-json.md +161 -0
- package/docs/examples/native-pytorch/index.md +38 -0
- package/docs/examples/native-pytorch/main.md +73 -0
- package/docs/examples/native-pytorch/tensors.md +123 -0
- package/docs/examples/native-sqlite/database.md +116 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/api.md +284 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.md +51 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.md +75 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi-json.md +119 -0
- package/docs/examples/native-sqlite/index.md +38 -0
- package/docs/examples/native-sqlite/main.md +73 -0
- package/docs/examples/native-zlib/compression.md +99 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/api.md +153 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.md +54 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi-json.md +76 -0
- package/docs/examples/native-zlib/index.md +38 -0
- package/docs/examples/native-zlib/main.md +78 -0
- package/docs/examples/new-syntax/console.md +10 -52
- package/docs/examples/new-syntax/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/new-syntax/greeter.md +13 -71
- package/docs/examples/new-syntax/index.md +6 -5
- package/docs/examples/new-syntax/logger.md +7 -43
- package/docs/examples/new-syntax/main.md +10 -53
- package/docs/examples/new-syntax/math.md +6 -24
- package/docs/examples/oidc-login/client/contracts.md +10 -61
- package/docs/examples/oidc-login/client/endpoints.md +32 -154
- package/docs/examples/oidc-login/client/export.md +5 -23
- package/docs/examples/oidc-login/client/login.md +234 -344
- package/docs/examples/oidc-login/client/logout.md +38 -143
- package/docs/examples/oidc-login/client/protocol.md +183 -304
- package/docs/examples/oidc-login/client/session.md +41 -149
- package/docs/examples/oidc-login/client/views.md +13 -58
- package/docs/examples/oidc-login/common/export.md +6 -26
- package/docs/examples/oidc-login/common/headers.md +42 -72
- package/docs/examples/oidc-login/common/keys.md +40 -164
- package/docs/examples/oidc-login/common/settings.md +24 -40
- package/docs/examples/oidc-login/common/views.md +7 -28
- package/docs/examples/oidc-login/dependencies/packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.md +205 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +67 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +267 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.md +415 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/jose.md +271 -0
- package/docs/examples/oidc-login/dependencies/packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.md +89 -0
- package/docs/examples/oidc-login/index.md +8 -7
- package/docs/examples/oidc-login/main-yaml.md +7 -0
- package/docs/examples/oidc-login/main.md +26 -153
- package/docs/examples/oidc-login/provider/authorization.md +232 -275
- package/docs/examples/oidc-login/provider/contracts.md +24 -146
- package/docs/examples/oidc-login/provider/credentials.md +24 -57
- package/docs/examples/oidc-login/provider/discovery.md +48 -122
- package/docs/examples/oidc-login/provider/export.md +11 -37
- package/docs/examples/oidc-login/provider/token.md +159 -237
- package/docs/examples/oidc-login/provider/userinfo.md +47 -102
- package/docs/examples/oidc-login/provider/views.md +13 -53
- package/docs/examples/ownership/counter.md +17 -63
- package/docs/examples/ownership/index.md +6 -5
- package/docs/examples/ownership/main.md +7 -30
- package/docs/examples/ownership-transfer/dependencies/august/0.21.0/io/contracts.md +178 -0
- package/docs/examples/ownership-transfer/index.md +6 -5
- package/docs/examples/ownership-transfer/main.md +10 -52
- package/docs/examples/ownership-transfer/resource.md +15 -67
- package/docs/examples/packages-app/dependencies/packages/@example/aug-math/0.1.0/arithmetic.md +12 -50
- package/docs/examples/packages-app/index.md +7 -6
- package/docs/examples/packages-app/main.md +7 -25
- package/docs/examples/packages-math/aug-package-json.md +1 -1
- package/docs/examples/packages-math/index.md +7 -6
- package/docs/examples/packages-math/src/arithmetic.md +12 -50
- package/docs/examples/packages-math/src/export.md +4 -12
- package/docs/examples/records-benchmark/data.md +55 -0
- package/docs/examples/records-benchmark/index.md +36 -0
- package/docs/examples/records-benchmark/main.md +85 -0
- package/docs/examples/startup-benchmark/index.md +6 -5
- package/docs/examples/startup-benchmark/main.md +5 -17
- package/docs/examples/strings-benchmark/index.md +35 -0
- package/docs/examples/strings-benchmark/main.md +76 -0
- package/docs/examples/tasks-benchmark/index.md +36 -0
- package/docs/examples/tasks-benchmark/main.md +89 -0
- package/docs/examples/tasks-benchmark/operations.md +58 -0
- package/docs/examples/visibility/counter.md +19 -67
- package/docs/examples/visibility/index.md +6 -5
- package/docs/examples/visibility/main.md +7 -31
- package/docs/examples/weather-api/forecasts.md +168 -0
- package/docs/examples/weather-api/index.md +42 -0
- package/docs/examples/weather-api/main-yaml.md +21 -0
- package/docs/examples/weather-api/main.md +65 -0
- package/docs/examples.json +10 -0
- package/docs/getting-started.md +105 -2
- package/docs/grammar.md +7 -5
- package/docs/guides/change-a-module.md +64 -0
- package/docs/guides/index.md +27 -0
- package/docs/gym-results.json +784 -0
- package/docs/implementation-map.md +6 -0
- package/docs/index.md +51 -29
- package/docs/kernel-results.json +1170 -0
- package/docs/language-conformance.md +7 -1
- package/docs/language-constructs.md +30 -22
- package/docs/language-design-audit.md +1 -1
- package/docs/learn/data-and-errors.md +77 -0
- package/docs/learn/index.md +30 -0
- package/docs/learn/modules-and-dependencies.md +73 -0
- package/docs/learn/state-and-tests.md +71 -0
- package/docs/learn/values-and-functions.md +62 -0
- package/docs/lesson-failures.json +8 -0
- package/docs/maintaining-docs.md +16 -4
- package/docs/native-implementation.md +276 -0
- package/docs/native-interop-llvm-plan.md +342 -0
- package/docs/native-package-examples.md +684 -0
- package/docs/native-packages.md +179 -0
- package/docs/packages.md +72 -126
- package/docs/performance.md +61 -68
- package/docs/production-readiness.md +16 -5
- package/docs/public/downloads/approved-design.zip +0 -0
- package/docs/public/downloads/benchmark.zip +0 -0
- package/docs/public/downloads/calls-benchmark.zip +0 -0
- package/docs/public/downloads/cli-args.zip +0 -0
- package/docs/public/downloads/collections-benchmark.zip +0 -0
- package/docs/public/downloads/collections.zip +0 -0
- package/docs/public/downloads/cpu-benchmark.zip +0 -0
- package/docs/public/downloads/developer-workflow.zip +0 -0
- package/docs/public/downloads/drop.zip +0 -0
- package/docs/public/downloads/errors-benchmark.zip +0 -0
- package/docs/public/downloads/errors.zip +0 -0
- package/docs/public/downloads/ffi.zip +0 -0
- package/docs/public/downloads/float-benchmark.zip +0 -0
- package/docs/public/downloads/generic-di.zip +0 -0
- package/docs/public/downloads/generics.zip +0 -0
- package/docs/public/downloads/hello.zip +0 -0
- package/docs/public/downloads/http-benchmark.zip +0 -0
- package/docs/public/downloads/interceptors.zip +0 -0
- package/docs/public/downloads/json-benchmark.zip +0 -0
- package/docs/public/downloads/list-benchmark.zip +0 -0
- package/docs/public/downloads/map-churn-benchmark.zip +0 -0
- package/docs/public/downloads/native-blake3.zip +0 -0
- package/docs/public/downloads/native-pytorch.zip +0 -0
- package/docs/public/downloads/native-sqlite.zip +0 -0
- package/docs/public/downloads/native-zlib.zip +0 -0
- package/docs/public/downloads/new-syntax.zip +0 -0
- package/docs/public/downloads/oidc-login.zip +0 -0
- package/docs/public/downloads/ownership-transfer.zip +0 -0
- package/docs/public/downloads/ownership.zip +0 -0
- package/docs/public/downloads/packages-app.zip +0 -0
- package/docs/public/downloads/packages-math.zip +0 -0
- package/docs/public/downloads/records-benchmark.zip +0 -0
- package/docs/public/downloads/startup-benchmark.zip +0 -0
- package/docs/public/downloads/strings-benchmark.zip +0 -0
- package/docs/public/downloads/tasks-benchmark.zip +0 -0
- package/docs/public/downloads/visibility.zip +0 -0
- package/docs/public/downloads/weather-api.zip +0 -0
- package/docs/qualification-results.md +66 -0
- package/docs/reference.md +47 -17
- package/docs/releasing.md +105 -16
- package/docs/research/code-to-natural-language.md +108 -0
- package/docs/research/ecosystem-workflow.md +41 -0
- package/docs/research/libtorch-native-qualification.md +115 -0
- package/docs/research/native-interop-llvm.md +197 -0
- package/docs/research/qualification-methods.md +15 -0
- package/docs/research/wiki-editorial-design.md +71 -0
- package/docs/roadmap.md +2 -1
- package/docs/safety-gyms.md +41 -0
- package/docs/specifications.md +27 -11
- package/docs/testing.md +19 -5
- package/docs/tooling.md +36 -22
- package/docs/weather-api.md +65 -0
- package/docs/web-library-gaps.md +1 -1
- package/docs/web.md +54 -18
- package/docs/writing-docs.md +49 -0
- package/examples/{hello/.aug-spec/august/0.19.0 → approved-design/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/approved-design/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/approved-design/.aug-spec/manifest.json +3 -3
- package/examples/approved-design/counters.aug +5 -4
- package/examples/approved-design/counters.aug.md +25 -132
- package/examples/approved-design/domain/app.aug +2 -1
- package/examples/approved-design/domain/app.aug.md +10 -80
- package/examples/approved-design/domain/export.aug +1 -0
- package/examples/approved-design/domain/export.aug.md +4 -20
- package/examples/approved-design/domain/models.aug +1 -0
- package/examples/approved-design/domain/models.aug.md +3 -25
- package/examples/approved-design/domain/numbers.aug +3 -2
- package/examples/approved-design/domain/numbers.aug.md +19 -116
- package/examples/approved-design/main.aug +1 -0
- package/examples/approved-design/main.aug.md +12 -95
- package/examples/benchmark/.aug-spec/manifest.json +1 -1
- package/examples/benchmark/main.aug +1 -0
- package/examples/benchmark/main.aug.md +6 -36
- package/examples/cli-args/.aug-spec/manifest.json +1 -1
- package/examples/cli-args/main.aug +1 -0
- package/examples/cli-args/main.aug.md +5 -32
- package/examples/collections/.aug-spec/manifest.json +1 -1
- package/examples/collections/main.aug +1 -0
- package/examples/collections/main.aug.md +6 -36
- package/examples/{generic-di/.aug-spec/august/0.19.0 → developer-workflow/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/developer-workflow/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/developer-workflow/.aug-spec/manifest.json +3 -3
- package/examples/developer-workflow/calculator.aug +3 -2
- package/examples/developer-workflow/calculator.aug.md +28 -189
- package/examples/developer-workflow/logging/console.aug +2 -1
- package/examples/developer-workflow/logging/console.aug.md +7 -57
- package/examples/developer-workflow/logging/export.aug +1 -0
- package/examples/developer-workflow/logging/export.aug.md +3 -15
- package/examples/developer-workflow/logging/logger.aug +1 -0
- package/examples/developer-workflow/logging/logger.aug.md +6 -46
- package/examples/developer-workflow/main.aug +1 -0
- package/examples/developer-workflow/main.aug.md +10 -68
- package/examples/drop/.aug-spec/manifest.json +1 -1
- package/examples/drop/main.aug +1 -0
- package/examples/drop/main.aug.md +6 -28
- package/examples/drop/resource.aug +1 -0
- package/examples/drop/resource.aug.md +6 -34
- package/examples/errors/.aug-spec/manifest.json +1 -1
- package/examples/errors/errors.aug +2 -1
- package/examples/errors/errors.aug.md +4 -27
- package/examples/errors/main.aug +1 -0
- package/examples/errors/main.aug.md +6 -29
- package/examples/ffi/.aug-spec/manifest.json +1 -1
- package/examples/ffi/main.aug +1 -0
- package/examples/ffi/main.aug.md +5 -21
- package/examples/ffi/native.aug +2 -1
- package/examples/ffi/native.aug.md +5 -35
- package/examples/{approved-design/.aug-spec/august/0.19.0 → generic-di/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/generic-di/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/generic-di/.aug-spec/manifest.json +3 -3
- package/examples/generic-di/main.aug +1 -0
- package/examples/generic-di/main.aug.md +8 -40
- package/examples/generic-di/types.aug +3 -2
- package/examples/generic-di/types.aug.md +18 -97
- package/examples/generics/.aug-spec/manifest.json +1 -1
- package/examples/generics/main.aug +1 -0
- package/examples/generics/main.aug.md +9 -48
- package/examples/generics/types.aug +4 -3
- package/examples/generics/types.aug.md +18 -104
- package/examples/{developer-workflow/.aug-spec/august/0.19.0 → hello/.aug-spec/august/0.21.0}/io/contracts.aug +4 -3
- package/examples/hello/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/hello/.aug-spec/manifest.json +3 -3
- package/examples/hello/app/export.aug +1 -0
- package/examples/hello/app/export.aug.md +3 -13
- package/examples/hello/app/greeter.aug +2 -1
- package/examples/hello/app/greeter.aug.md +10 -94
- package/examples/hello/logging/console.aug +2 -1
- package/examples/hello/logging/console.aug.md +7 -55
- package/examples/hello/logging/export.aug +1 -0
- package/examples/hello/logging/export.aug.md +3 -15
- package/examples/hello/logging/logger.aug +1 -0
- package/examples/hello/logging/logger.aug.md +6 -48
- package/examples/hello/main.aug +1 -0
- package/examples/hello/main.aug.md +8 -40
- package/examples/interceptors/.aug-spec/august/0.21.0/io/contracts.aug +37 -0
- package/examples/interceptors/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/interceptors/.aug-spec/manifest.json +3 -3
- package/examples/interceptors/app.aug +3 -2
- package/examples/interceptors/app.aug.md +15 -141
- package/examples/interceptors/interceptors.aug +3 -2
- package/examples/interceptors/interceptors.aug.md +19 -152
- package/examples/interceptors/logging.aug +2 -1
- package/examples/interceptors/logging.aug.md +10 -79
- package/examples/interceptors/main.aug +1 -0
- package/examples/interceptors/main.aug.md +9 -66
- package/examples/native-blake3/.aug-spec/manifest.json +16 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.1/native.abi.json +29 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug +14 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug.md +34 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug +4 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug.md +8 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi.json +29 -0
- package/examples/native-blake3/AGENTS.md +5 -0
- package/examples/native-blake3/aug.lock.json +253 -0
- package/examples/native-blake3/hashing.aug +11 -0
- package/examples/native-blake3/hashing.aug.md +25 -0
- package/examples/native-blake3/main.aug +8 -0
- package/examples/native-blake3/main.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/manifest.json +18 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.1/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.3/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug +101 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug.md +160 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug +3 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md +8 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug +6 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi.json +142 -0
- package/examples/native-pytorch/AGENTS.md +5 -0
- package/examples/native-pytorch/aug.lock.json +309 -0
- package/examples/native-pytorch/main.aug +8 -0
- package/examples/native-pytorch/main.aug.md +13 -0
- package/examples/native-pytorch/tensors.aug +23 -0
- package/examples/native-pytorch/tensors.aug.md +35 -0
- package/examples/native-sqlite/.aug-spec/manifest.json +18 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.2/native.abi.json +100 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug +48 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug.md +91 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug +3 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug.md +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug.md +22 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi.json +100 -0
- package/examples/native-sqlite/AGENTS.md +5 -0
- package/examples/native-sqlite/aug.lock.json +236 -0
- package/examples/native-sqlite/database.aug +15 -0
- package/examples/native-sqlite/database.aug.md +27 -0
- package/examples/native-sqlite/main.aug +8 -0
- package/examples/native-sqlite/main.aug.md +13 -0
- package/examples/native-zlib/.aug-spec/manifest.json +16 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.1/native.abi.json +57 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug +29 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug.md +54 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug +4 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug.md +8 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi.json +57 -0
- package/examples/native-zlib/AGENTS.md +5 -0
- package/examples/native-zlib/aug.lock.json +236 -0
- package/examples/native-zlib/compression.aug +15 -0
- package/examples/native-zlib/compression.aug.md +27 -0
- package/examples/native-zlib/main.aug +10 -0
- package/examples/native-zlib/main.aug.md +13 -0
- package/examples/new-syntax/.aug-spec/august/0.21.0/io/contracts.aug +37 -0
- package/examples/new-syntax/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/new-syntax/.aug-spec/manifest.json +3 -3
- package/examples/new-syntax/console.aug +2 -1
- package/examples/new-syntax/console.aug.md +7 -53
- package/examples/new-syntax/greeter.aug +2 -1
- package/examples/new-syntax/greeter.aug.md +10 -74
- package/examples/new-syntax/logger.aug +1 -0
- package/examples/new-syntax/logger.aug.md +6 -46
- package/examples/new-syntax/main.aug +1 -0
- package/examples/new-syntax/main.aug.md +9 -54
- package/examples/new-syntax/math.aug +2 -1
- package/examples/new-syntax/math.aug.md +3 -24
- package/examples/oidc-login/.aug-spec/manifest.json +13 -13
- package/examples/oidc-login/.aug-spec/packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/store.aug.md +71 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +17 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +125 -0
- package/examples/oidc-login/.aug-spec/{august/0.19.0/crypto → packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40}/contracts.aug +12 -11
- package/examples/oidc-login/.aug-spec/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/contracts.aug.md +244 -0
- package/examples/oidc-login/.aug-spec/{august/0.19.0/crypto → packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40}/jose.aug +6 -5
- package/examples/oidc-login/.aug-spec/packages/@git/url_9ef654c66d34ab8f5527/0.0.0-git.b14a0f9aa41f1ce58bd51133bcdc424033e40d40/jose.aug.md +71 -0
- package/examples/oidc-login/.aug-spec/packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301/contracts.aug.md +30 -0
- package/examples/oidc-login/aug.lock.json +100 -0
- package/examples/oidc-login/client/contracts.aug +1 -0
- package/examples/oidc-login/client/contracts.aug.md +9 -66
- package/examples/oidc-login/client/endpoints.aug +6 -5
- package/examples/oidc-login/client/endpoints.aug.md +13 -145
- package/examples/oidc-login/client/export.aug +1 -0
- package/examples/oidc-login/client/export.aug.md +4 -24
- package/examples/oidc-login/client/login.aug +7 -6
- package/examples/oidc-login/client/login.aug.md +25 -303
- package/examples/oidc-login/client/logout.aug +5 -4
- package/examples/oidc-login/client/logout.aug.md +13 -135
- package/examples/oidc-login/client/protocol.aug +7 -6
- package/examples/oidc-login/client/protocol.aug.md +36 -283
- package/examples/oidc-login/client/session.aug +5 -4
- package/examples/oidc-login/client/session.aug.md +12 -139
- package/examples/oidc-login/client/views.aug +3 -2
- package/examples/oidc-login/client/views.aug.md +8 -57
- package/examples/oidc-login/common/export.aug +1 -0
- package/examples/oidc-login/common/export.aug.md +5 -27
- package/examples/oidc-login/common/headers.aug +4 -3
- package/examples/oidc-login/common/headers.aug.md +9 -67
- package/examples/oidc-login/common/keys.aug +6 -5
- package/examples/oidc-login/common/keys.aug.md +29 -165
- package/examples/oidc-login/common/settings.aug +2 -1
- package/examples/oidc-login/common/settings.aug.md +5 -39
- package/examples/oidc-login/common/views.aug +2 -1
- package/examples/oidc-login/common/views.aug.md +4 -28
- package/examples/oidc-login/main.aug +6 -16
- package/examples/oidc-login/main.aug.md +17 -146
- package/examples/oidc-login/main.yaml +7 -0
- package/examples/oidc-login/provider/authorization.aug +7 -6
- package/examples/oidc-login/provider/authorization.aug.md +23 -238
- package/examples/oidc-login/provider/contracts.aug +1 -0
- package/examples/oidc-login/provider/contracts.aug.md +23 -158
- package/examples/oidc-login/provider/credentials.aug +3 -2
- package/examples/oidc-login/provider/credentials.aug.md +9 -53
- package/examples/oidc-login/provider/discovery.aug +4 -3
- package/examples/oidc-login/provider/discovery.aug.md +11 -118
- package/examples/oidc-login/provider/export.aug +1 -0
- package/examples/oidc-login/provider/export.aug.md +6 -34
- package/examples/oidc-login/provider/token.aug +6 -5
- package/examples/oidc-login/provider/token.aug.md +16 -204
- package/examples/oidc-login/provider/userinfo.aug +4 -3
- package/examples/oidc-login/provider/userinfo.aug.md +10 -92
- package/examples/oidc-login/provider/views.aug +3 -2
- package/examples/oidc-login/provider/views.aug.md +8 -52
- package/examples/ownership/.aug-spec/manifest.json +1 -1
- package/examples/ownership/counter.aug +3 -2
- package/examples/ownership/counter.aug.md +12 -66
- package/examples/ownership/main.aug +1 -0
- package/examples/ownership/main.aug.md +6 -31
- package/examples/ownership-transfer/.aug-spec/august/0.21.0/io/contracts.aug +37 -0
- package/examples/ownership-transfer/.aug-spec/august/0.21.0/io/contracts.aug.md +82 -0
- package/examples/ownership-transfer/.aug-spec/manifest.json +3 -3
- package/examples/ownership-transfer/main.aug +1 -0
- package/examples/ownership-transfer/main.aug.md +9 -53
- package/examples/ownership-transfer/resource.aug +2 -1
- package/examples/ownership-transfer/resource.aug.md +12 -71
- package/examples/packages/app/.aug-spec/manifest.json +1 -1
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug +2 -1
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug.md +9 -51
- package/examples/packages/app/main.aug +1 -0
- package/examples/packages/app/main.aug.md +6 -26
- package/examples/packages/math/.aug-spec/manifest.json +1 -1
- package/examples/packages/math/aug-package.json +1 -1
- package/examples/packages/math/src/arithmetic.aug +2 -1
- package/examples/packages/math/src/arithmetic.aug.md +9 -51
- package/examples/packages/math/src/export.aug +1 -0
- package/examples/packages/math/src/export.aug.md +3 -13
- package/examples/visibility/.aug-spec/manifest.json +1 -1
- package/examples/visibility/counter.aug +4 -3
- package/examples/visibility/counter.aug.md +12 -68
- package/examples/visibility/main.aug +1 -0
- package/examples/visibility/main.aug.md +6 -32
- package/examples/weather-api/.aug-spec/manifest.json +8 -0
- package/examples/weather-api/AGENTS.md +17 -0
- package/examples/weather-api/README.md +19 -0
- package/examples/weather-api/forecasts.aug +47 -0
- package/examples/weather-api/forecasts.aug.md +32 -0
- package/examples/weather-api/main.aug +4 -0
- package/examples/weather-api/main.aug.md +15 -0
- package/examples/weather-api/main.yaml +5 -0
- package/examples/weather-api/weather.http +5 -0
- package/native/compiler-packs.json +43 -0
- package/package.json +4 -4
- package/runtime/aug_http.c +48 -21
- package/runtime/aug_http_ir.c +30 -0
- package/runtime/aug_http_ir.h +18 -0
- package/runtime/aug_ir.c +209 -0
- package/runtime/aug_ir.h +89 -0
- package/runtime/aug_json.c +6 -1
- package/runtime/aug_runtime.c +82 -16
- package/runtime/aug_runtime.h +16 -2
- package/runtime/aug_tasks.c +38 -7
- package/runtime/aug_values.c +12 -6
- package/scripts/bootstrap-native.mjs +184 -106
- package/scripts/native-setup.mjs +98 -0
- package/scripts/native-toolchain.mjs +28 -0
- package/src/ast.js +1 -1
- package/src/builtins.js +1 -1
- package/src/checker.js +369 -100
- package/src/cli.js +198 -26
- package/src/codegen.js +32 -7
- package/src/compiler-packs.js +66 -0
- package/src/config.js +3 -3
- package/src/contracts.js +10 -0
- package/src/editor.js +86 -22
- package/src/fixes.js +90 -2
- package/src/formatter.js +23 -10
- package/src/git-http.js +137 -0
- package/src/git-packages.js +118 -0
- package/src/help.js +33 -24
- package/src/http-contracts.js +14 -0
- package/src/http-policies.js +5 -5
- package/src/ir-types.js +5 -0
- package/src/ir-verify.js +277 -0
- package/src/ir.js +962 -0
- package/src/libraries.js +1 -1
- package/src/llvm-debug.js +101 -0
- package/src/llvm-native.js +152 -0
- package/src/llvm-platform.js +20 -0
- package/src/llvm.js +781 -0
- package/src/lsp.js +14 -5
- package/src/native-artifacts.js +207 -0
- package/src/native-bindings.js +189 -0
- package/src/native-contracts.js +295 -0
- package/src/native-declarations.js +68 -0
- package/src/native-facts.js +63 -0
- package/src/native.js +19 -13
- package/src/navigation.js +4 -2
- package/src/openapi.js +5 -4
- package/src/package-locking.js +88 -0
- package/src/package-manager.js +267 -68
- package/src/parser.js +32 -6
- package/src/policies.js +3 -3
- package/src/project-init.js +78 -4
- package/src/project.js +11 -9
- package/src/runtime-abi.js +23 -0
- package/src/runtime-adapters.js +18 -0
- package/src/schemas.js +24 -17
- package/src/semantic.js +54 -5
- package/src/snippets.js +60 -0
- package/src/spec-hints.js +56 -0
- package/src/spec-tree.js +241 -0
- package/src/spec.js +669 -305
- package/docs/examples/approved-design/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/developer-workflow/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/generic-di/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/hello/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/interceptors/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/json-benchmark/dependencies/august/0.19.0/json/contracts.md +0 -103
- package/docs/examples/new-syntax/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/contracts.md +0 -925
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/jose.md +0 -434
- package/docs/examples/oidc-login/dependencies/august/0.19.0/json/contracts.md +0 -103
- package/docs/examples/oidc-login/dependencies/august/0.19.0/memory/store.md +0 -374
- package/docs/examples/oidc-login/dependencies/august/0.19.0/time/contracts.md +0 -150
- package/docs/examples/oidc-login/dependencies/august/0.19.0/web/contracts.md +0 -532
- package/docs/examples/ownership-transfer/dependencies/august/0.19.0/io/contracts.md +0 -395
- package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug.md +0 -791
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug.md +0 -266
- package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug.md +0 -55
- package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug.md +0 -250
- package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug.md +0 -96
- package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug.md +0 -420
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug +0 -36
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug.md +0 -316
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/memory → packages/@git/url_0eb7c89453c87681ed15/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/store.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/json → packages/@git/url_2d3c37c690c0fa115be1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/web → packages/@git/url_897efafd565158fc4908/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
- /package/examples/oidc-login/.aug-spec/{august/0.19.0/time → packages/@git/url_c092cd151499c4e1d8a1/0.0.0-git.a39fc582565d4fca40be4f75fa304d71adc69301}/contracts.aug +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Ownership and task conformance
|
|
2
2
|
|
|
3
|
-
August 0.
|
|
3
|
+
August 0.20 checks ownership before compiling and joins every child before its `scope` ends. This page records the behavior exercised by the [language conformance suite](../tests/language-conformance.test.mjs). It is a candidate 1.0 contract; the [compatibility policy](compatibility.md) takes effect only with a 1.0 release.
|
|
4
4
|
|
|
5
5
|
## What the compiler guarantees
|
|
6
6
|
|
|
@@ -27,4 +27,10 @@ The compiler tracks object origins through aliases and fields. It can reject cod
|
|
|
27
27
|
|
|
28
28
|
Tasks currently run cooperatively on one OS thread. A long loop reaches cancellation at compiler-inserted checkpoints. `Shared<T>` is the explicit path for synchronized mutable state. The runtime does not yet promise parallel CPU execution.
|
|
29
29
|
|
|
30
|
+
Scheduling an owned input transfers its cleanup responsibility immediately. If
|
|
31
|
+
a sibling cancels the child before entry, the scheduler releases that input.
|
|
32
|
+
The checker rejects owned task results, including inferred `Task<T>` results,
|
|
33
|
+
until the public task type has an owned-result transfer contract. Both backends
|
|
34
|
+
exercise these cases in the concurrency suite.
|
|
35
|
+
|
|
30
36
|
Run the focused suite with `node --test tests/language-conformance.test.mjs`. The full repository test command also runs existing [concurrency](../tests/concurrency.test.mjs), ownership, errors, formatter, and generated-spec tests. This suite is growing through adversarial review; a green run does not establish complete ownership safety. The [roadmap](roadmap.md) keeps the language semantics gate open until that review and native CI finish.
|
|
@@ -342,7 +342,7 @@ Checked failure for division by zero. int arithmetic otherwise wraps in the sign
|
|
|
342
342
|
around(Type input) returns Type { return next(); }
|
|
343
343
|
```
|
|
344
344
|
|
|
345
|
-
The required entry point of an interceptor. Its parameters select target arguments, and its result must fit the target return type.
|
|
345
|
+
The required entry point of an interceptor. Its parameters select target arguments, and its result must fit the target return type. A forwarding body can omit returns and inherit the target result. It may validate, override mapped arguments, inspect the result, throw a checked error, or return early. Declare generic parameters on the interceptor header. Helper methods can be declared alongside around.
|
|
346
346
|
|
|
347
347
|
## as
|
|
348
348
|
|
|
@@ -426,7 +426,7 @@ Signed 32-bit C int. Convert explicitly with c_int(value=number), which raises C
|
|
|
426
426
|
capability Console { write(string value) uses Console.write }
|
|
427
427
|
```
|
|
428
428
|
|
|
429
|
-
Declare an interface for an external effect. Import the standard Console, FileReader, FileWriter and Arguments contracts from august.io, select adapters in main, and receive them through resolve parameters. Operations
|
|
429
|
+
Declare an interface for an external effect. Import the standard Console, FileReader, FileWriter and Arguments contracts from august.io, select adapters in main, and receive them through resolve parameters. Operations stay visible in inferred hints, hover and specs and can be replaced in tests.
|
|
430
430
|
|
|
431
431
|
## catch
|
|
432
432
|
|
|
@@ -442,7 +442,7 @@ Handle a thrown error from the preceding `try` block. The caught value is availa
|
|
|
442
442
|
increment() changes self
|
|
443
443
|
```
|
|
444
444
|
|
|
445
|
-
|
|
445
|
+
Describe observable mutation of self or a borrowed input. Bodies infer changes when omitted; callers still need mutable access. Bodyless interface contracts declare permitted mutation. Local variables and fresh local objects do not change caller-owned state. An explicit clause limits the body.
|
|
446
446
|
|
|
447
447
|
## class
|
|
448
448
|
|
|
@@ -474,7 +474,7 @@ Negotiate gzip from Accept-Encoding, respecting q=0. Buffered output and each bo
|
|
|
474
474
|
ConversionError implements Error
|
|
475
475
|
```
|
|
476
476
|
|
|
477
|
-
Checked failure when c_int(value=number) cannot fit the signed 32-bit C int range. Catch it or
|
|
477
|
+
Checked failure when c_int(value=number) cannot fit the signed 32-bit C int range. Catch it or let it propagate.
|
|
478
478
|
|
|
479
479
|
## cookie
|
|
480
480
|
|
|
@@ -566,7 +566,7 @@ Inherit methods from one or more interfaces. Class inheritance is not supported.
|
|
|
566
566
|
extern C name(Type arg) returns Type
|
|
567
567
|
```
|
|
568
568
|
|
|
569
|
-
Declare a C function. Calls require unsafe and
|
|
569
|
+
Declare a C function. Calls require unsafe and executable callers infer uses C.name. int maps to int64_t, c_int to signed 32-bit int, float to double, bool to C bool, and string to a temporary UTF-8 const char pointer. Foreign code must respect the declared ABI and cannot retain managed pointers.
|
|
570
570
|
|
|
571
571
|
## false
|
|
572
572
|
|
|
@@ -582,7 +582,7 @@ Boolean false. and and or evaluate the right side only when needed. Conditions r
|
|
|
582
582
|
FileError
|
|
583
583
|
```
|
|
584
584
|
|
|
585
|
-
|
|
585
|
+
Checked failure from text file operations. Catch it or let it propagate.
|
|
586
586
|
|
|
587
587
|
## fixture
|
|
588
588
|
|
|
@@ -654,7 +654,7 @@ Names the source of an import or export. Dotted paths cross folders; each crosse
|
|
|
654
654
|
No function keyword
|
|
655
655
|
```
|
|
656
656
|
|
|
657
|
-
Functions and methods start with their name:
|
|
657
|
+
Functions and methods start with their name: greet(string name) { ... }. Remove the old function prefix. Parameters use Type name order and callers use labels. Bodies infer omitted returns, changes, uses and unless clauses; declarations without a body keep explicit contracts.
|
|
658
658
|
|
|
659
659
|
## handle
|
|
660
660
|
|
|
@@ -750,7 +750,7 @@ Marks a declaration as a class and lists the interfaces it satisfies. Every clas
|
|
|
750
750
|
import Logger and ConsoleLogger from logging
|
|
751
751
|
```
|
|
752
752
|
|
|
753
|
-
Bring public declarations into this file. Use `and` for several names, or `import everything from logging` for all public sibling declarations or folder exports. Imported dependencies are never re-exported implicitly. Names or modules starting with `_` stay private. A sibling module uses its filename without `.aug`; a folder exposes only names listed in `export.aug`.
|
|
753
|
+
Bring public declarations into this file. Use `and` for several names, or `import everything from logging` for all public sibling declarations or folder exports. Imported dependencies are never re-exported implicitly. Names or modules starting with `_` stay private. A sibling module uses its filename without `.aug`; a folder exposes only names listed in `export.aug`. A quoted public repository URL declares a source dependency; `aug run` installs it and locks its commit. Use `aug add URL --as NAME` for a shorter import alias.
|
|
754
754
|
|
|
755
755
|
## in
|
|
756
756
|
|
|
@@ -774,7 +774,7 @@ Expand an explicitly imported composition into the application root. Duplicate b
|
|
|
774
774
|
IndexError implements Error
|
|
775
775
|
```
|
|
776
776
|
|
|
777
|
-
Checked failure for an invalid List.get position. Catch it
|
|
777
|
+
Checked failure for an invalid List.get position. Catch it or let it propagate. List.at returns a value or null instead.
|
|
778
778
|
|
|
779
779
|
## initialize
|
|
780
780
|
|
|
@@ -782,7 +782,7 @@ Checked failure for an invalid List.get position. Catch it, declare unless Index
|
|
|
782
782
|
initialize: ...
|
|
783
783
|
```
|
|
784
784
|
|
|
785
|
-
Run constructor work once after header inputs and local fields are initialized, before returning the class or record. Put this block inside the declaration, before class methods. Construction stays pure.
|
|
785
|
+
Run constructor work once after header inputs and local fields are initialized, before returning the class or record. Put this block inside the declaration, before class methods. Construction stays pure. Classes declare checked constructor failures with unless before implements; failed construction releases transferred owned fields. Records can infer validation failures but cannot replace immutable fields.
|
|
786
786
|
|
|
787
787
|
## input
|
|
788
788
|
|
|
@@ -830,7 +830,7 @@ Define a test case within a when group. Names may be identifiers or quoted descr
|
|
|
830
830
|
Json
|
|
831
831
|
```
|
|
832
832
|
|
|
833
|
-
Immutable JSON data.
|
|
833
|
+
Immutable JSON data. Import parse from the JSON source package, decode concrete records with decode<T>(), and stringify with lossless integer handling.
|
|
834
834
|
|
|
835
835
|
## List
|
|
836
836
|
|
|
@@ -854,7 +854,7 @@ Grant exclusive mutation of Shared<T> for a short block. Waiting, starting tasks
|
|
|
854
854
|
[LogRequest(logger=logger)]
|
|
855
855
|
```
|
|
856
856
|
|
|
857
|
-
Map a resolve RequestLogger parameter and
|
|
857
|
+
Map a resolve RequestLogger parameter and infer its complete operation. Observe the final status and monotonic duration after output finishes, or status 499 on disconnect. Layers complete in reverse written order.
|
|
858
858
|
|
|
859
859
|
## Map
|
|
860
860
|
|
|
@@ -886,7 +886,7 @@ The missing keyword is rejected. Use null. An omitted optional value and an expl
|
|
|
886
886
|
Counter(mutable int initial to _count)
|
|
887
887
|
```
|
|
888
888
|
|
|
889
|
-
Declare mutable class storage. Header fields are otherwise read-only after construction. An explicit public argument label can initialize private storage with Type label to _field.
|
|
889
|
+
Declare mutable class storage. Header fields are otherwise read-only after construction. An explicit public argument label can initialize private storage with Type label to _field. Bodies infer changes self; callers provide mutable access.
|
|
890
890
|
|
|
891
891
|
## next
|
|
892
892
|
|
|
@@ -970,7 +970,7 @@ Bind a required path placeholder by name. A label after the source can select a
|
|
|
970
970
|
print(value=any) returns void
|
|
971
971
|
```
|
|
972
972
|
|
|
973
|
-
|
|
973
|
+
Write application startup or test output. Other callables receive a Console dependency and call console.write; their bodies infer that capability use.
|
|
974
974
|
|
|
975
975
|
## pure
|
|
976
976
|
|
|
@@ -1010,7 +1010,7 @@ Root-only UTF-8 text input. Other callables receive FileReader. Invalid Unicode
|
|
|
1010
1010
|
record Point(int x, int y)
|
|
1011
1011
|
```
|
|
1012
1012
|
|
|
1013
|
-
Declare deeply immutable data with labeled construction and structural equality/hashing. Records contain primitives, tuples and other records. An initialize block validates inputs;
|
|
1013
|
+
Declare deeply immutable data with labeled construction and structural equality/hashing. Records contain primitives, tuples and other records. An initialize block validates inputs; validation infers rejected inputs; an explicit unless ErrorType limits permitted failures.
|
|
1014
1014
|
|
|
1015
1015
|
## request
|
|
1016
1016
|
|
|
@@ -1026,7 +1026,7 @@ Receive the immutable raw request when a protocol requires its own binding and e
|
|
|
1026
1026
|
[RequireLogin(authentication=auth)]
|
|
1027
1027
|
```
|
|
1028
1028
|
|
|
1029
|
-
Verify credentials before typed body decoding. Map auth to an explicit resolve Authentication parameter and
|
|
1029
|
+
Verify credentials before typed body decoding. Map auth to an explicit resolve Authentication parameter and infer its authenticate operation. null produces 401; the adapter validates the credential. HTTP policies precede custom parameter interceptors.
|
|
1030
1030
|
|
|
1031
1031
|
## RequirePermission
|
|
1032
1032
|
|
|
@@ -1044,6 +1044,14 @@ resolve Logger logger; resolve app to program
|
|
|
1044
1044
|
|
|
1045
1045
|
Declare a dependency in a class or callable header. Callers omit its argument and forward the matching header dependency. Only main and test setup retrieve bindings directly with resolve app to program. Assignment-form resolve is rejected. Scoped dependencies require a scope block.
|
|
1046
1046
|
|
|
1047
|
+
## resource
|
|
1048
|
+
|
|
1049
|
+
```text
|
|
1050
|
+
extern C resource Tensor
|
|
1051
|
+
```
|
|
1052
|
+
|
|
1053
|
+
Declare an opaque native object with a descriptor-checked release operation. Store acquired objects in own bindings; their scope releases them exactly once. Resource declarations belong to native packages, outside main.aug.
|
|
1054
|
+
|
|
1047
1055
|
## return
|
|
1048
1056
|
|
|
1049
1057
|
```text
|
|
@@ -1058,7 +1066,7 @@ Finish the current function or method and give its result to the caller. A `void
|
|
|
1058
1066
|
name() returns Type
|
|
1059
1067
|
```
|
|
1060
1068
|
|
|
1061
|
-
|
|
1069
|
+
Bodies infer their result from return expressions or their implemented interface when this clause is omitted. No returned value means void. Bodyless signatures still need non-void result types. Explicit result types are checked assertions; returns own Type explicitly transfers ownership. Recursive or ambiguous results may require a type anchor.
|
|
1062
1070
|
|
|
1063
1071
|
## scope
|
|
1064
1072
|
|
|
@@ -1170,7 +1178,7 @@ Declare tests beside the class, function, or endpoint. Class suites initialize t
|
|
|
1170
1178
|
throw error;
|
|
1171
1179
|
```
|
|
1172
1180
|
|
|
1173
|
-
Raise a value whose class implements `Error`.
|
|
1181
|
+
Raise a value whose class implements `Error`. An executable body infers uncaught errors; main must handle them with a matching catch.
|
|
1174
1182
|
|
|
1175
1183
|
## throws
|
|
1176
1184
|
|
|
@@ -1223,10 +1231,10 @@ Fixed immutable positions: `(1, 2)` infers Tuple<int, int>, `(1, "apple")` infer
|
|
|
1223
1231
|
## unless
|
|
1224
1232
|
|
|
1225
1233
|
```text
|
|
1226
|
-
load(bool fail)
|
|
1234
|
+
load(bool fail) unless FileError
|
|
1227
1235
|
```
|
|
1228
1236
|
|
|
1229
|
-
|
|
1237
|
+
Describe checked failures that escape a call. Bodies infer uncaught errors when unless is omitted; catch blocks remove handled errors. Main must handle escaping errors. Bodyless interfaces declare permitted failures. Explicit unless remains an upper bound; unless Error accepts any error type. Record validation can infer its failures too.
|
|
1230
1238
|
|
|
1231
1239
|
## unsafe
|
|
1232
1240
|
|
|
@@ -1239,10 +1247,10 @@ Permit calls to declared `extern C` functions within this block. The compiler do
|
|
|
1239
1247
|
## uses
|
|
1240
1248
|
|
|
1241
1249
|
```text
|
|
1242
|
-
save(resolve FileWriter files, string path)
|
|
1250
|
+
save(resolve FileWriter files, string path)
|
|
1243
1251
|
```
|
|
1244
1252
|
|
|
1245
|
-
|
|
1253
|
+
Bodies infer external capability operations when uses is omitted, including public functions, default methods and interceptor around methods. The editor shows non-editable inline hints; hover, explain, API docs and compiled specs expose checked contracts. Bodyless interfaces and extern declarations keep explicit contracts. An explicit uses clause remains an upper bound. Implementations cannot exceed their interface contract; construction and cleanup stay pure.
|
|
1246
1254
|
|
|
1247
1255
|
## void
|
|
1248
1256
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Readability audit, September 29, 2026
|
|
4
4
|
|
|
5
|
-
August 0.
|
|
5
|
+
August 0.20 uses ASD-STE100 as guidance for plain technical explanations. The language keeps local behavior and neighboring contracts in view. The deterministic [spec compiler](specifications.md) extends that context to readers who do not read code.
|
|
6
6
|
|
|
7
7
|
| Finding | Change |
|
|
8
8
|
| --- | --- |
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
prev:
|
|
3
|
+
text: Values and functions
|
|
4
|
+
link: /learn/values-and-functions
|
|
5
|
+
next:
|
|
6
|
+
text: Modules and dependencies
|
|
7
|
+
link: /learn/modules-and-dependencies
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Data and failures
|
|
11
|
+
|
|
12
|
+
A number alone does not explain every result. An order summary has named data, and an invalid order may need a failure rather than a zero total. This project introduces both.
|
|
13
|
+
|
|
14
|
+
Create a new folder and save these two files in it:
|
|
15
|
+
|
|
16
|
+
**main.aug**
|
|
17
|
+
|
|
18
|
+
```aug project=book-data file=main.aug
|
|
19
|
+
import Order and InvalidQuantity and summarize from orders
|
|
20
|
+
|
|
21
|
+
try:
|
|
22
|
+
order = summarize(price=7, quantity=3)
|
|
23
|
+
print(value=order.total)
|
|
24
|
+
summarize(price=7, quantity=-1)
|
|
25
|
+
catch InvalidQuantity error:
|
|
26
|
+
print(value="Quantity must be positive")
|
|
27
|
+
|
|
28
|
+
Map<int, string> names = {1: "Ada"}
|
|
29
|
+
match names.get(key=2):
|
|
30
|
+
when null:
|
|
31
|
+
print(value="No name for this identifier")
|
|
32
|
+
when some name:
|
|
33
|
+
print(value=name)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
**orders.aug**
|
|
37
|
+
|
|
38
|
+
```aug project=book-data file=orders.aug
|
|
39
|
+
/** An immutable order summary. */
|
|
40
|
+
record Order(int quantity, int total)
|
|
41
|
+
|
|
42
|
+
/** Raised when an order quantity is not positive. */
|
|
43
|
+
InvalidQuantity(int value) implements Error:
|
|
44
|
+
pass
|
|
45
|
+
|
|
46
|
+
/** Reject nonpositive quantities and return the calculated summary. */
|
|
47
|
+
summarize(int price, int quantity):
|
|
48
|
+
if quantity <= 0:
|
|
49
|
+
throw InvalidQuantity(value=quantity)
|
|
50
|
+
return Order(quantity, total=price * quantity)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`aug run .` prints:
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
21
|
|
57
|
+
Quantity must be positive
|
|
58
|
+
No name for this identifier
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
## Keep data immutable
|
|
62
|
+
|
|
63
|
+
`record Order(int quantity, int total)` declares data with two named fields. Its constructor uses labels just like a function. After construction those fields are immutable. Reading `order.total` does not copy the whole object.
|
|
64
|
+
|
|
65
|
+
Use a record for a value whose meaning is its data. A class implements an interface and provides behavior; [the next chapter](modules-and-dependencies.md) uses one to supply a service. Records have limits on the types they can store; the [reference](../reference.md#classes-records-and-local-state) gives the complete rule.
|
|
66
|
+
|
|
67
|
+
## Make failure part of the contract
|
|
68
|
+
|
|
69
|
+
The throw tells the compiler that `summarize` can fail with `InvalidQuantity`. Its return expression supplies the `Order` result type. Hints, hover, and the compiled spec show this contract without repeating it in the header. `InvalidQuantity` is a class that implements `Error` and carries the rejected value. The caller must catch the failure or propagate it through an inferred or explicit contract. Main must handle it. In this application, `try` contains the calls and `catch` prints a message when the second call fails. Operations after a throw in that block do not run.
|
|
70
|
+
|
|
71
|
+
Try removing the catch while keeping a bare call to `summarize` in `main.aug`. `aug check .` should report the unhandled error. Restore the example afterward. A checked failure tells you what a call can raise; it does not decide how your application should recover.
|
|
72
|
+
|
|
73
|
+
## Distinguish a value from null
|
|
74
|
+
|
|
75
|
+
A map lookup may find nothing. `names.get(key=2)` returns `optional string`, which means a string or null. `match` handles those alternatives explicitly. The `some name` branch supplies a non-null string named `name`.
|
|
76
|
+
|
|
77
|
+
There is no separate missing state. Omitted optional inputs also become null. Use null when absence is an ordinary outcome; use a checked failure when the operation cannot meet its contract. [Matching and failures](../reference.md#null-matching-and-checked-failures) covers the detailed rules.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
next:
|
|
3
|
+
text: Your first project
|
|
4
|
+
link: /getting-started
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# The August book
|
|
8
|
+
|
|
9
|
+
This book teaches you to read, write, and change August programs. It assumes you have written code in another language. August builds a native executable when you run a program; the pending 0.21.0 release downloads its own LLVM tools on [supported platforms](../getting-started.md).
|
|
10
|
+
|
|
11
|
+
Start with a working application. Then add one idea at a time: labeled inputs, data and failures, module boundaries, dependencies, and controlled mutation. Each chapter contains a complete small project. Save its files together, run the commands, and compare your result with the output shown.
|
|
12
|
+
|
|
13
|
+
## Read in order
|
|
14
|
+
|
|
15
|
+
| Chapter | What you will do |
|
|
16
|
+
| --- | --- |
|
|
17
|
+
| [Your first project](../getting-started.md) | Install the toolchain, run a greeting, test it, and generate its specification. |
|
|
18
|
+
| [Values and functions](values-and-functions.md) | Write a calculation and read labeled calls and conditions. |
|
|
19
|
+
| [Data and failures](data-and-errors.md) | Return an immutable record, distinguish null from a value, and recover from a checked failure. |
|
|
20
|
+
| [Modules and dependencies](modules-and-dependencies.md) | Export a folder's public surface and supply an implementation at startup. |
|
|
21
|
+
| [State and tests](state-and-tests.md) | Change an object through a borrow and verify that test setup is fresh for each case. |
|
|
22
|
+
| [Change an unfamiliar module](../guides/change-a-module.md) | Trace a dependency, make a bounded change, and review its tests and updated spec. |
|
|
23
|
+
|
|
24
|
+
Chapters use indentation to keep the first examples compact. [Indentation and braces](../reference.md#blocks-and-statement-boundaries) have the same meaning, and the [gallery](../examples/index.md) displays both. Semicolons are optional. These are syntax choices; they do not change an application's contracts.
|
|
25
|
+
|
|
26
|
+
## Use the rest of the documentation
|
|
27
|
+
|
|
28
|
+
The [task guides](../guides/index.md) cover testing, services, packages, specifications, and measurement. The [language reference](../reference.md) states detailed rules, including cases these lessons leave for later. Library API pages describe exported operations. You can use those pages without reading the book from beginning to end.
|
|
29
|
+
|
|
30
|
+
August is still experimental. The lessons teach the implemented language; [readiness](../production-readiness.md) describes the limits of deploying it. The lessons' complete source examples are checked and run by the repository's documentation tests.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
---
|
|
2
|
+
prev:
|
|
3
|
+
text: Data and failures
|
|
4
|
+
link: /learn/data-and-errors
|
|
5
|
+
next:
|
|
6
|
+
text: State and tests
|
|
7
|
+
link: /learn/state-and-tests
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Modules and dependencies
|
|
11
|
+
|
|
12
|
+
An import should lead a reader to a small public contract. This project moves the greeting into its own folder and selects its implementation in the application entry point.
|
|
13
|
+
|
|
14
|
+
Create a `greeting` folder beside `main.aug`:
|
|
15
|
+
|
|
16
|
+
```text
|
|
17
|
+
hello/
|
|
18
|
+
main.aug
|
|
19
|
+
greeting/
|
|
20
|
+
export.aug
|
|
21
|
+
greeter.aug
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
**main.aug**
|
|
25
|
+
|
|
26
|
+
```aug project=book-modules file=main.aug
|
|
27
|
+
import Greeter and FriendlyGreeter from greeting
|
|
28
|
+
|
|
29
|
+
implement Greeter with FriendlyGreeter
|
|
30
|
+
resolve Greeter to greeter
|
|
31
|
+
print(value=greeter.greet(name="August"))
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**greeting/export.aug**
|
|
35
|
+
|
|
36
|
+
```aug project=book-modules file=greeting/export.aug
|
|
37
|
+
export Greeter from greeter
|
|
38
|
+
export FriendlyGreeter from greeter
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**greeting/greeter.aug**
|
|
42
|
+
|
|
43
|
+
```aug project=book-modules file=greeting/greeter.aug
|
|
44
|
+
/** Provide a greeting for a named person. */
|
|
45
|
+
interface Greeter:
|
|
46
|
+
greet(string name) returns string
|
|
47
|
+
|
|
48
|
+
FriendlyGreeter() implements Greeter:
|
|
49
|
+
greet(string name):
|
|
50
|
+
return "Hello, " + name + "!"
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Run `aug check .` and `aug run .`. The output is `Hello, August!`.
|
|
54
|
+
|
|
55
|
+
## Choose what the folder exposes
|
|
56
|
+
|
|
57
|
+
`export.aug` is the folder's public boundary. A file outside `greeting` can import the names listed there. It cannot reach other declarations in that folder merely by knowing their paths. Within a folder, sibling files also need explicit imports. A folder without `export.aug` exposes no names across its boundary.
|
|
58
|
+
|
|
59
|
+
Try removing the export line for `FriendlyGreeter`. The import in `main.aug` should fail. Restore it after running `aug check .`. This is a boundary check; a private name beginning with `_` cannot be exported at all.
|
|
60
|
+
|
|
61
|
+
## Select behavior at startup
|
|
62
|
+
|
|
63
|
+
The interface describes the operation available to the caller. `FriendlyGreeter` implements that contract. `implement Greeter with FriendlyGreeter` selects the provider, and `resolve Greeter to greeter` obtains it for startup work.
|
|
64
|
+
|
|
65
|
+
Elsewhere in an application, injected dependencies appear as `resolve` inputs in a class or function header. For example, `Worker(resolve Logger logger)` receives the configured logger without a caller supplying that argument. An ordinary `Logger logger` input must be passed by label. See [a complete constructor-injection example](../examples/new-syntax/index.md).
|
|
66
|
+
|
|
67
|
+
Reading the entry point tells you the application's dependency choices. Reading a callable's header tells you its required dependencies. The compiler checks the binding graph before execution; a missing or cyclic dependency fails checking.
|
|
68
|
+
|
|
69
|
+
## Follow a dependency
|
|
70
|
+
|
|
71
|
+
Run `aug spec .` and read `main.aug.md`. Follow its links to the greeting's explanation, then read `greeting/export.aug.md` to see the public surface. In VS Code, Ctrl-click `from` or the module path to open the source or export file. This is the workflow you can use in a larger unfamiliar project too.
|
|
72
|
+
|
|
73
|
+
Keep exports narrow as a folder grows. Add an implementation to the public surface when its caller needs to compose it. Keep helpers private and explain design intent beside the declaration. [The next chapter](state-and-tests.md) adds state and tests while preserving that local view.
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
prev:
|
|
3
|
+
text: Modules and dependencies
|
|
4
|
+
link: /learn/modules-and-dependencies
|
|
5
|
+
next:
|
|
6
|
+
text: Change an unfamiliar module
|
|
7
|
+
link: /guides/change-a-module
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# State and tests
|
|
11
|
+
|
|
12
|
+
Some objects need to change. A counter is a small example: callers can read its value, and one operation advances it. This project makes that change visible both in the contract and at the call site.
|
|
13
|
+
|
|
14
|
+
Create a new folder and save these two files in it:
|
|
15
|
+
|
|
16
|
+
**main.aug**
|
|
17
|
+
|
|
18
|
+
```aug project=book-state file=main.aug
|
|
19
|
+
import Counter from counter
|
|
20
|
+
|
|
21
|
+
counter = Counter(initial=3)
|
|
22
|
+
borrow counter:
|
|
23
|
+
counter.increment()
|
|
24
|
+
print(value=counter.value())
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**counter.aug**
|
|
28
|
+
|
|
29
|
+
```aug project=book-state file=counter.aug
|
|
30
|
+
interface Count:
|
|
31
|
+
increment() changes self
|
|
32
|
+
value() returns int
|
|
33
|
+
|
|
34
|
+
Counter(mutable int initial to _count) implements Count:
|
|
35
|
+
increment():
|
|
36
|
+
_count = _count + 1
|
|
37
|
+
|
|
38
|
+
value():
|
|
39
|
+
return _count
|
|
40
|
+
|
|
41
|
+
test Counter counter:
|
|
42
|
+
when incrementing:
|
|
43
|
+
counter = Counter(initial=3)
|
|
44
|
+
it advances:
|
|
45
|
+
borrow counter:
|
|
46
|
+
counter.increment()
|
|
47
|
+
assert(counter.value() == 4)
|
|
48
|
+
|
|
49
|
+
it starts_fresh:
|
|
50
|
+
assert(counter.value() == 3)
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
`aug run .` prints `4`. `aug test .` runs two cases. Both should pass.
|
|
54
|
+
|
|
55
|
+
## Read before you borrow
|
|
56
|
+
|
|
57
|
+
`mutable int initial to _count` gives the constructor a public input named `initial` and stores it in a private mutable field named `_count`. The interface's `changes self` permits `increment` to change the receiving object. The implementation infers that mutation from its assignment and inherits the read method's result type, so neither clause needs to be repeated.
|
|
58
|
+
|
|
59
|
+
`borrow counter` grants mutable access for that block. The following call to `value()` only reads, so it needs no borrow. Read access shares a reference; it does not require copying the counter. Try moving `counter.increment()` outside the borrow block. `aug check .` should reject the mutation without permission. Restore the borrow before running again.
|
|
60
|
+
|
|
61
|
+
This lesson uses a managed object. August also has ownership transfer and scoped cleanup. Learn those when your program needs them from [the ownership reference](../reference.md#ownership-and-read-access) and [complete lifetime examples](../examples/ownership-transfer/index.md).
|
|
62
|
+
|
|
63
|
+
## Keep the behavior test nearby
|
|
64
|
+
|
|
65
|
+
`test Counter counter` identifies the class and the subject variable. The setup inside `when incrementing` constructs the subject. Each `it` case gets fresh setup; the second case still sees `3` even though the first case incremented its own counter.
|
|
66
|
+
|
|
67
|
+
Tests follow normal privacy rules. They verify behavior through `increment` and `value`, rather than reaching into `_count`. A case must execute an assertion. Test bodies are checked with the program, but are excluded from production executables.
|
|
68
|
+
|
|
69
|
+
Change the first expected result to `5`, run `aug test .`, and inspect the failure's file and line. Restore `4`, rerun the tests, and generate the spec. You now have three views of the same behavior: the contract, executable cases, and a readable explanation.
|
|
70
|
+
|
|
71
|
+
Use [the testing guide](../testing.md) when you need rows, fixtures, test adapters, filtering, or coverage. Continue with [a guided module change](../guides/change-a-module.md) to apply these tools in a larger project.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
---
|
|
2
|
+
prev:
|
|
3
|
+
text: Your first project
|
|
4
|
+
link: /getting-started
|
|
5
|
+
next:
|
|
6
|
+
text: Data and failures
|
|
7
|
+
link: /learn/data-and-errors
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Values and functions
|
|
11
|
+
|
|
12
|
+
In the first project, an interface and its implementation produced a greeting. A calculation that needs no dependency can be an ordinary function. This chapter calculates an order total.
|
|
13
|
+
|
|
14
|
+
Create a new folder with these two files. Continue using the published CLI from the first chapter.
|
|
15
|
+
|
|
16
|
+
**main.aug**
|
|
17
|
+
|
|
18
|
+
```aug project=book-functions file=main.aug
|
|
19
|
+
import total from prices
|
|
20
|
+
|
|
21
|
+
int price = 7
|
|
22
|
+
int quantity = 3
|
|
23
|
+
print(value=total(price, quantity))
|
|
24
|
+
print(value=total(quantity=0, price))
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**prices.aug**
|
|
28
|
+
|
|
29
|
+
```aug project=book-functions file=prices.aug
|
|
30
|
+
/** Calculate the price for a positive quantity; otherwise return zero. */
|
|
31
|
+
total(int price, int quantity):
|
|
32
|
+
if quantity > 0:
|
|
33
|
+
return price * quantity
|
|
34
|
+
return 0
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Run `aug check .`, then `aug run .`. The output is:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
21
|
|
41
|
+
0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Read the call
|
|
45
|
+
|
|
46
|
+
`int price = 7` gives the value a type and a name. `int price to 7` means the same thing. You can omit the type when it can be inferred, as in `price = 7`.
|
|
47
|
+
|
|
48
|
+
Every call input has a label. `total(price, quantity)` is shorthand for `total(price=price, quantity=quantity)`: the local names match the labels. The second call supplies a different quantity. Labels let you reorder inputs without making the reader guess which argument is which.
|
|
49
|
+
|
|
50
|
+
The declaration begins with the function's name; it needs no `function` keyword. The compiler infers an integer result from its return expressions. VS Code shows `returns int` beside the header as a hint; it is absent from saved source. You can write a return type to require a particular result. This function reads its inputs and calculates a value. It has no dependency or mutable state.
|
|
51
|
+
|
|
52
|
+
## Read the decision
|
|
53
|
+
|
|
54
|
+
`if quantity > 0` chooses the first return when the quantity is positive. That return ends the call. Otherwise execution reaches `return 0`. Every path in a function with a non-void result must return or throw.
|
|
55
|
+
|
|
56
|
+
Boolean conditions use `and`, `or`, and `not`. For example, `price > 0 and quantity > 0` requires both comparisons to hold. `and` and `or` short-circuit: the second operand runs only when the first operand makes it necessary.
|
|
57
|
+
|
|
58
|
+
## Try a change
|
|
59
|
+
|
|
60
|
+
Change the first quantity to `4`. Run the program and check that the first result is `28`. Then change the second call's `quantity` label to `amount` and run `aug check .`. That call should fail checking because `total` has no input named `amount`. Restore the label before continuing.
|
|
61
|
+
|
|
62
|
+
Run `aug spec .` and read `prices.aug.md`. It should explain the two return paths. The generated text describes the code; your comment explains why a nonpositive quantity produces zero. [The next chapter](data-and-errors.md) makes an invalid input an explicit failure instead.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
[
|
|
2
|
+
{"project":"getting-started","file":"main.aug","before":"greet(name=\"August\")","after":"greet(person=\"August\")","diagnostic":"has no parameter person"},
|
|
3
|
+
{"project":"book-functions","file":"main.aug","before":"quantity=0","after":"amount=0","diagnostic":"has no parameter amount"},
|
|
4
|
+
{"project":"book-data","file":"main.aug","source":"import summarize from orders\nsummarize(price=7, quantity=3)\n","diagnostic":"Unhandled InvalidQuantity"},
|
|
5
|
+
{"project":"book-modules","file":"greeting/export.aug","before":"export FriendlyGreeter from greeter\n","after":"","diagnostic":"does not export FriendlyGreeter"},
|
|
6
|
+
{"project":"book-state","file":"main.aug","before":"borrow counter:\n counter.increment()","after":"counter.increment()","diagnostic":"requires borrow counter"},
|
|
7
|
+
{"project":"book-state","file":"counter.aug","before":"assert(counter.value() == 4)","after":"assert(counter.value() == 5)","command":"test","diagnostic":"advances"}
|
|
8
|
+
]
|
package/docs/maintaining-docs.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Documentation is part of a language change. The canonical wiki is this repository's `docs` directory, reviewed and versioned with the compiler. GitHub Pages renders these same files; an independently edited GitHub Wiki would create a second source of truth.
|
|
4
4
|
|
|
5
|
+
For writing and navigation, use [the editorial guide](writing-docs.md). The repository's `.agents/skills/maintain-august-wiki/SKILL.md` routes agents through that guide and this workflow. `AGENTS.md` requires it for documentation and behavior changes. The [research note](research/wiki-editorial-design.md) explains the source material and the decisions applied here.
|
|
6
|
+
|
|
5
7
|
## Where to make a change
|
|
6
8
|
|
|
7
9
|
| Change | Update in the same commit |
|
|
@@ -9,13 +11,21 @@ Documentation is part of a language change. The canonical wiki is this repositor
|
|
|
9
11
|
| Syntax, type/effect/ownership/DI rules | `docs/reference.md`, relevant grammar/testing/web guide and `src/help.ts` |
|
|
10
12
|
| Public library signature or behavior | Javadoc beside its declaration in `src/stdlib`, the relevant guide and gap ledger |
|
|
11
13
|
| Diagnostic or editor behavior | `src/help.ts`, diagnostics/tooling guide and VS Code changelog |
|
|
12
|
-
| CLI, packages, configuration or supported platform | Tooling/packages/releasing guide and package metadata |
|
|
14
|
+
| CLI, packages, configuration or supported platform | Tooling/packages/releasing guide, Docker and Dev Container recipes, and package metadata |
|
|
13
15
|
| Completed or deferred feature | Implementation map, gap ledger and changelog |
|
|
14
16
|
|
|
15
17
|
Public comments should explain observable behavior, named inputs, errors, side effects, and limits. Keep dependencies explicit in examples. Record incomplete capabilities in the gap ledger; do not imply that an unimplemented proposal is usable.
|
|
16
18
|
|
|
19
|
+
Container guides install the published CLI and obtain its pinned LLVM/runtime and package artifacts. Keep the CLI version, supported targets, writable cache paths and complete deployment bundle aligned with the release. Maintainer build images have a separate explicit toolchain. Verify the HTTP application image and run the starter's check/run/test/spec workflow as the Dev Container's non-root user. State any verification mount substitutions: a Docker engine that cannot share local folders can test execution in an isolated volume, but that does not verify the default VS Code bind mount or editor port forwarding.
|
|
20
|
+
|
|
21
|
+
For dependency-setup changes, run `npm run test:setup-cold` after preparing the pinned downloads. It builds crypto and HTTP through an aliased empty cache, runs a digest, and serves a real HTTP response. The fast first-run suite covers JSON/tasks, downloads, offline reuse, packages, and cache concurrency. Verify the installed package too; source execution alone does not prove that setup helpers ship in the npm archive.
|
|
22
|
+
|
|
23
|
+
The installed-package gate uses an isolated npm cache. Its first installation fetches production dependencies; its later global installation runs offline from that cache. This checks both first use and reuse without relying on packages cached by the contributor's machine.
|
|
24
|
+
|
|
17
25
|
## Generated reference
|
|
18
26
|
|
|
27
|
+
The gallery generator also creates deterministic project archives in `docs/public/downloads`. Each archive includes source, configuration, and generated specs, with neighboring source packages when required. It excludes build state, installed dependencies, locks with temporary host paths, and credentials. Gallery tests extract every archive and check it as an independent project. Public guides use these downloads and the npm CLI; source-workspace commands belong in contributor documentation.
|
|
28
|
+
|
|
19
29
|
```sh
|
|
20
30
|
npm run docs:generate
|
|
21
31
|
npm run docs:check
|
|
@@ -24,17 +34,19 @@ npm run docs:build
|
|
|
24
34
|
|
|
25
35
|
The API generator reads each `export.aug`, resolves the actual public declaration, and uses the same Javadoc/inherited documentation path as hover. It includes public methods and excludes private native helpers. The language constructs page comes from editor help and collection operation contracts. Commit generated Markdown so GitHub readers and package users can read it without building a site. CI rejects stale generated pages.
|
|
26
36
|
|
|
27
|
-
The generator also runs the deterministic spec compiler for every standard-library source file. Commit these adjacent `src/stdlib/**/*.aug.md` files. Unlike public API pages, full source specs include private helpers and all local behavior. For application or third-party package source changes, run `aug spec PROJECT` and verify `aug spec PROJECT --check`. See [the user workflow](specifications.md).
|
|
37
|
+
The generator also runs the deterministic spec compiler for every standard-library source file. Commit these adjacent `src/stdlib/**/*.aug.md` files and their managed `// aug-spec:` source pointers. Unlike public API pages, full source specs include private helpers and all local behavior. The generator builds explicit behavioral relations, plans sentences within their scopes, checks statement provenance, and lays out connected paragraphs. Keep author comments and dependency links concise instead of repeating signatures or Javadoc sections. For application or third-party package source changes, run `aug spec PROJECT` and verify `aug spec PROJECT --check`. See [the user workflow](specifications.md) and [the research rationale](research/code-to-natural-language.md).
|
|
28
38
|
|
|
29
39
|
## Repository example gallery
|
|
30
40
|
|
|
31
|
-
`docs/example-projects.json` lists the complete projects shown in [the example gallery](examples/index.md), including the measured benchmark programs. `docs:generate` checks each application and its same-file tests, formats each file in indentation and braces styles, and runs the spec compiler. It publishes code and specs side by side under `docs/examples`, with dependency links that stay in the wiki. Long code lines wrap visually without changing copied source. It also refreshes adjacent example specs and
|
|
41
|
+
`docs/example-projects.json` lists the complete projects shown in [the example gallery](examples/index.md), including the measured benchmark programs. `docs:generate` checks each application and its same-file tests, formats each file in indentation and braces styles, and runs the spec compiler. It publishes code and specs side by side under `docs/examples`, with dependency links that stay in the wiki. Long code lines wrap visually without changing copied source. It also refreshes adjacent example specs, managed source pointers, and offline dependency copies. Generation uses temporary project copies. It installs dependencies declared by imports and configuration, preserving committed revision locks. Git sources must be cached or reachable during preparation; spec generation itself stays offline. It preserves the source program and handwritten comments, and does not create package locks in the source workspace.
|
|
32
42
|
|
|
33
43
|
Keep titles and descriptions in the catalog current when adding or changing an example. `docs:check` rejects source/spec drift. Gallery tests require every repository example and benchmark source to be represented, check both displayed syntax styles, and follow the wiki's generated links and declaration anchors. Readers can switch code style with a mouse or keyboard; their choice is kept between pages on the same browser.
|
|
34
44
|
|
|
35
45
|
## Executable examples
|
|
36
46
|
|
|
37
|
-
Each runnable `aug` fence declares `project=NAME file=PATH`. A guide may spread one project across several fences. Add expected output/test counts to `docs/examples.json`. The documentation test assembles, checks, runs or builds, tests, formats, and checks those projects again. API signatures use `text` fences because a declaration header is not a complete application.
|
|
47
|
+
A neighboring configuration fence can use `yaml project=NAME file=main.yaml`. Each runnable `aug` fence declares `project=NAME file=PATH`. A guide may spread one project across several fences. Add expected output/test counts to `docs/examples.json`. The documentation test assembles, checks, runs or builds, tests, formats, and checks those projects again. API signatures use `text` fences because a declaration header is not a complete application.
|
|
48
|
+
|
|
49
|
+
The test discovers handwritten Markdown recursively, including the book and task guides. Generated API/gallery pages and hidden build folders have separate generation checks. Complete examples need expected output; identify fragments and intended failures in the prose. Maintain the chapter links and the public navigation when adding a lesson.
|
|
38
50
|
|
|
39
51
|
```sh
|
|
40
52
|
node --test tests/documentation.test.mjs
|