@greenpandastudios/aug-cli 0.19.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/LICENSE +21 -0
- package/README.md +13 -0
- package/THIRD_PARTY_NOTICES.md +18 -0
- package/bin/aug.mjs +3 -0
- package/docs/api/crypto.md +351 -0
- package/docs/api/io.md +207 -0
- package/docs/api/json.md +21 -0
- package/docs/api/memory.md +109 -0
- package/docs/api/time.md +54 -0
- package/docs/api/web.md +184 -0
- package/docs/assets/benchmarks/execution.svg +2978 -0
- package/docs/assets/benchmarks/http.svg +1674 -0
- package/docs/assets/benchmarks/improvements.svg +2315 -0
- package/docs/assets/benchmarks/memory.svg +1891 -0
- package/docs/benchmark-baseline.json +1087 -0
- package/docs/benchmark-results.json +91123 -0
- package/docs/benchmarks.json +38 -0
- package/docs/compatibility.md +42 -0
- package/docs/concurrency-implementation.md +18 -0
- package/docs/diagnostics.md +97 -0
- package/docs/docker.md +35 -0
- package/docs/example-projects.json +26 -0
- package/docs/examples/approved-design/counters.md +253 -0
- package/docs/examples/approved-design/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/approved-design/domain/app.md +165 -0
- package/docs/examples/approved-design/domain/export.md +83 -0
- package/docs/examples/approved-design/domain/models.md +80 -0
- package/docs/examples/approved-design/domain/numbers.md +248 -0
- package/docs/examples/approved-design/index.md +39 -0
- package/docs/examples/approved-design/main-yaml.md +24 -0
- package/docs/examples/approved-design/main.md +215 -0
- package/docs/examples/benchmark/index.md +33 -0
- package/docs/examples/benchmark/main-yaml.md +17 -0
- package/docs/examples/benchmark/main.md +117 -0
- package/docs/examples/cli-args/index.md +32 -0
- package/docs/examples/cli-args/main.md +107 -0
- package/docs/examples/collections/index.md +32 -0
- package/docs/examples/collections/main.md +118 -0
- package/docs/examples/collections-benchmark/index.md +34 -0
- package/docs/examples/collections-benchmark/main.md +115 -0
- package/docs/examples/cpu-benchmark/index.md +34 -0
- package/docs/examples/cpu-benchmark/main.md +90 -0
- package/docs/examples/developer-workflow/calculator.md +357 -0
- package/docs/examples/developer-workflow/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/developer-workflow/index.md +37 -0
- package/docs/examples/developer-workflow/logging/console.md +124 -0
- package/docs/examples/developer-workflow/logging/export.md +70 -0
- package/docs/examples/developer-workflow/logging/logger.md +111 -0
- package/docs/examples/developer-workflow/main.md +172 -0
- package/docs/examples/drop/index.md +33 -0
- package/docs/examples/drop/main.md +85 -0
- package/docs/examples/drop/resource.md +95 -0
- package/docs/examples/errors/errors.md +85 -0
- package/docs/examples/errors/index.md +33 -0
- package/docs/examples/errors/main.md +92 -0
- package/docs/examples/ffi/index.md +33 -0
- package/docs/examples/ffi/main.md +75 -0
- package/docs/examples/ffi/native.md +93 -0
- package/docs/examples/generic-di/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/generic-di/index.md +33 -0
- package/docs/examples/generic-di/main.md +111 -0
- package/docs/examples/generic-di/types.md +180 -0
- package/docs/examples/generics/index.md +33 -0
- package/docs/examples/generics/main.md +120 -0
- package/docs/examples/generics/types.md +189 -0
- package/docs/examples/hello/app/export.md +67 -0
- package/docs/examples/hello/app/greeter.md +190 -0
- package/docs/examples/hello/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/hello/index.md +37 -0
- package/docs/examples/hello/logging/console.md +121 -0
- package/docs/examples/hello/logging/export.md +71 -0
- package/docs/examples/hello/logging/logger.md +120 -0
- package/docs/examples/hello/main.md +115 -0
- package/docs/examples/http-benchmark/index.md +35 -0
- package/docs/examples/http-benchmark/main.md +79 -0
- package/docs/examples/http-benchmark/routes.md +88 -0
- package/docs/examples/index.md +60 -0
- package/docs/examples/interceptors/app.md +250 -0
- package/docs/examples/interceptors/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/interceptors/index.md +35 -0
- package/docs/examples/interceptors/interceptors.md +284 -0
- package/docs/examples/interceptors/logging.md +155 -0
- package/docs/examples/interceptors/main.md +162 -0
- package/docs/examples/json-benchmark/data.md +71 -0
- package/docs/examples/json-benchmark/dependencies/august/0.19.0/json/contracts.md +103 -0
- package/docs/examples/json-benchmark/index.md +35 -0
- package/docs/examples/json-benchmark/main.md +131 -0
- package/docs/examples/new-syntax/console.md +118 -0
- package/docs/examples/new-syntax/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/new-syntax/greeter.md +145 -0
- package/docs/examples/new-syntax/index.md +36 -0
- package/docs/examples/new-syntax/logger.md +111 -0
- package/docs/examples/new-syntax/main.md +135 -0
- package/docs/examples/new-syntax/math.md +79 -0
- package/docs/examples/oidc-login/client/contracts.md +151 -0
- package/docs/examples/oidc-login/client/endpoints.md +263 -0
- package/docs/examples/oidc-login/client/export.md +107 -0
- package/docs/examples/oidc-login/client/login.md +515 -0
- package/docs/examples/oidc-login/client/logout.md +249 -0
- package/docs/examples/oidc-login/client/protocol.md +595 -0
- package/docs/examples/oidc-login/client/session.md +297 -0
- package/docs/examples/oidc-login/client/views.md +144 -0
- package/docs/examples/oidc-login/common/export.md +115 -0
- package/docs/examples/oidc-login/common/headers.md +162 -0
- package/docs/examples/oidc-login/common/keys.md +336 -0
- package/docs/examples/oidc-login/common/settings.md +116 -0
- package/docs/examples/oidc-login/common/views.md +103 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/contracts.md +925 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/crypto/jose.md +434 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/json/contracts.md +103 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/memory/store.md +374 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/time/contracts.md +150 -0
- package/docs/examples/oidc-login/dependencies/august/0.19.0/web/contracts.md +532 -0
- package/docs/examples/oidc-login/index.md +57 -0
- package/docs/examples/oidc-login/main-yaml.md +28 -0
- package/docs/examples/oidc-login/main.md +283 -0
- package/docs/examples/oidc-login/provider/authorization.md +457 -0
- package/docs/examples/oidc-login/provider/contracts.md +267 -0
- package/docs/examples/oidc-login/provider/credentials.md +148 -0
- package/docs/examples/oidc-login/provider/discovery.md +215 -0
- package/docs/examples/oidc-login/provider/export.md +131 -0
- package/docs/examples/oidc-login/provider/token.md +364 -0
- package/docs/examples/oidc-login/provider/userinfo.md +228 -0
- package/docs/examples/oidc-login/provider/views.md +137 -0
- package/docs/examples/ownership/counter.md +140 -0
- package/docs/examples/ownership/index.md +33 -0
- package/docs/examples/ownership/main.md +90 -0
- package/docs/examples/ownership-transfer/dependencies/august/0.19.0/io/contracts.md +395 -0
- package/docs/examples/ownership-transfer/index.md +33 -0
- package/docs/examples/ownership-transfer/main.md +125 -0
- package/docs/examples/ownership-transfer/resource.md +150 -0
- package/docs/examples/packages-app/dependencies/packages/@example/aug-math/0.1.0/arithmetic.md +117 -0
- package/docs/examples/packages-app/index.md +34 -0
- package/docs/examples/packages-app/main-yaml.md +18 -0
- package/docs/examples/packages-app/main.md +80 -0
- package/docs/examples/packages-math/aug-package-json.md +24 -0
- package/docs/examples/packages-math/index.md +36 -0
- package/docs/examples/packages-math/package-json.md +25 -0
- package/docs/examples/packages-math/src/arithmetic.md +121 -0
- package/docs/examples/packages-math/src/export.md +63 -0
- package/docs/examples/startup-benchmark/index.md +34 -0
- package/docs/examples/startup-benchmark/main.md +68 -0
- package/docs/examples/visibility/counter.md +142 -0
- package/docs/examples/visibility/index.md +33 -0
- package/docs/examples/visibility/main.md +96 -0
- package/docs/examples.json +47 -0
- package/docs/getting-started.md +5 -0
- package/docs/grammar.md +136 -0
- package/docs/implementation-map.md +106 -0
- package/docs/index.md +46 -0
- package/docs/language-conformance.md +30 -0
- package/docs/language-constructs.md +1461 -0
- package/docs/language-design-audit.md +147 -0
- package/docs/maintaining-docs.md +43 -0
- package/docs/packages.md +184 -0
- package/docs/performance.md +535 -0
- package/docs/production-readiness.md +39 -0
- package/docs/reference.md +361 -0
- package/docs/release-review.md +23 -0
- package/docs/releasing.md +79 -0
- package/docs/roadmap.md +13 -0
- package/docs/specifications.md +86 -0
- package/docs/testing.md +120 -0
- package/docs/tooling.md +197 -0
- package/docs/web-implementation-plan.md +39 -0
- package/docs/web-library-gaps.md +27 -0
- package/docs/web.md +197 -0
- package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/approved-design/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/approved-design/.aug-spec/manifest.json +14 -0
- package/examples/approved-design/counters.aug +22 -0
- package/examples/approved-design/counters.aug.md +177 -0
- package/examples/approved-design/domain/app.aug +12 -0
- package/examples/approved-design/domain/app.aug.md +97 -0
- package/examples/approved-design/domain/export.aug +5 -0
- package/examples/approved-design/domain/export.aug.md +25 -0
- package/examples/approved-design/domain/models.aug +2 -0
- package/examples/approved-design/domain/models.aug.md +30 -0
- package/examples/approved-design/domain/numbers.aug +29 -0
- package/examples/approved-design/domain/numbers.aug.md +141 -0
- package/examples/approved-design/main.aug +26 -0
- package/examples/approved-design/main.aug.md +108 -0
- package/examples/approved-design/main.yaml +8 -0
- package/examples/benchmark/.aug-spec/manifest.json +7 -0
- package/examples/benchmark/main.aug +17 -0
- package/examples/benchmark/main.aug.md +43 -0
- package/examples/benchmark/main.yaml +1 -0
- package/examples/cli-args/.aug-spec/manifest.json +7 -0
- package/examples/cli-args/main.aug +15 -0
- package/examples/cli-args/main.aug.md +38 -0
- package/examples/collections/.aug-spec/manifest.json +7 -0
- package/examples/collections/main.aug +18 -0
- package/examples/collections/main.aug.md +43 -0
- package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/developer-workflow/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/developer-workflow/.aug-spec/manifest.json +13 -0
- package/examples/developer-workflow/calculator.aug +55 -0
- package/examples/developer-workflow/calculator.aug.md +228 -0
- package/examples/developer-workflow/logging/console.aug +8 -0
- package/examples/developer-workflow/logging/console.aug.md +67 -0
- package/examples/developer-workflow/logging/export.aug +2 -0
- package/examples/developer-workflow/logging/export.aug.md +19 -0
- package/examples/developer-workflow/logging/logger.aug +6 -0
- package/examples/developer-workflow/logging/logger.aug.md +57 -0
- package/examples/developer-workflow/main.aug +25 -0
- package/examples/developer-workflow/main.aug.md +79 -0
- package/examples/drop/.aug-spec/manifest.json +8 -0
- package/examples/drop/main.aug +3 -0
- package/examples/drop/main.aug.md +35 -0
- package/examples/drop/resource.aug +8 -0
- package/examples/drop/resource.aug.md +44 -0
- package/examples/errors/.aug-spec/manifest.json +8 -0
- package/examples/errors/errors.aug +6 -0
- package/examples/errors/errors.aug.md +33 -0
- package/examples/errors/main.aug +7 -0
- package/examples/errors/main.aug.md +36 -0
- package/examples/ffi/.aug-spec/manifest.json +8 -0
- package/examples/ffi/main.aug +2 -0
- package/examples/ffi/main.aug.md +27 -0
- package/examples/ffi/native.aug +6 -0
- package/examples/ffi/native.aug.md +43 -0
- package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/generic-di/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/generic-di/.aug-spec/manifest.json +10 -0
- package/examples/generic-di/main.aug +9 -0
- package/examples/generic-di/main.aug.md +49 -0
- package/examples/generic-di/types.aug +17 -0
- package/examples/generic-di/types.aug.md +124 -0
- package/examples/generics/.aug-spec/manifest.json +8 -0
- package/examples/generics/main.aug +9 -0
- package/examples/generics/main.aug.md +58 -0
- package/examples/generics/types.aug +19 -0
- package/examples/generics/types.aug.md +132 -0
- package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/hello/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/hello/.aug-spec/manifest.json +14 -0
- package/examples/hello/app/export.aug +1 -0
- package/examples/hello/app/export.aug.md +17 -0
- package/examples/hello/app/greeter.aug +22 -0
- package/examples/hello/app/greeter.aug.md +109 -0
- package/examples/hello/logging/console.aug +7 -0
- package/examples/hello/logging/console.aug.md +65 -0
- package/examples/hello/logging/export.aug +2 -0
- package/examples/hello/logging/export.aug.md +19 -0
- package/examples/hello/logging/logger.aug +9 -0
- package/examples/hello/logging/logger.aug.md +59 -0
- package/examples/hello/main.aug +9 -0
- package/examples/hello/main.aug.md +49 -0
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/interceptors/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/interceptors/.aug-spec/manifest.json +12 -0
- package/examples/interceptors/app.aug +28 -0
- package/examples/interceptors/app.aug.md +162 -0
- package/examples/interceptors/interceptors.aug +40 -0
- package/examples/interceptors/interceptors.aug.md +180 -0
- package/examples/interceptors/logging.aug +12 -0
- package/examples/interceptors/logging.aug.md +96 -0
- package/examples/interceptors/main.aug +22 -0
- package/examples/interceptors/main.aug.md +76 -0
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/new-syntax/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/new-syntax/.aug-spec/manifest.json +13 -0
- package/examples/new-syntax/console.aug +7 -0
- package/examples/new-syntax/console.aug.md +63 -0
- package/examples/new-syntax/greeter.aug +10 -0
- package/examples/new-syntax/greeter.aug.md +89 -0
- package/examples/new-syntax/logger.aug +6 -0
- package/examples/new-syntax/logger.aug.md +57 -0
- package/examples/new-syntax/main.aug +12 -0
- package/examples/new-syntax/main.aug.md +64 -0
- package/examples/new-syntax/math.aug +3 -0
- package/examples/new-syntax/math.aug.md +29 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug +73 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/contracts.aug.md +791 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug +68 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/crypto/jose.aug.md +266 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug +6 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/json/contracts.aug.md +55 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug +45 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/memory/store.aug.md +250 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug +11 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/time/contracts.aug.md +96 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug +58 -0
- package/examples/oidc-login/.aug-spec/august/0.19.0/web/contracts.aug.md +420 -0
- package/examples/oidc-login/.aug-spec/manifest.json +40 -0
- package/examples/oidc-login/README.md +29 -0
- package/examples/oidc-login/client/contracts.aug +7 -0
- package/examples/oidc-login/client/contracts.aug.md +80 -0
- package/examples/oidc-login/client/endpoints.aug +21 -0
- package/examples/oidc-login/client/endpoints.aug.md +161 -0
- package/examples/oidc-login/client/export.aug +7 -0
- package/examples/oidc-login/client/export.aug.md +29 -0
- package/examples/oidc-login/client/login.aug +58 -0
- package/examples/oidc-login/client/login.aug.md +331 -0
- package/examples/oidc-login/client/logout.aug +18 -0
- package/examples/oidc-login/client/logout.aug.md +150 -0
- package/examples/oidc-login/client/protocol.aug +106 -0
- package/examples/oidc-login/client/protocol.aug.md +326 -0
- package/examples/oidc-login/client/session.aug +34 -0
- package/examples/oidc-login/client/session.aug.md +155 -0
- package/examples/oidc-login/client/views.aug +21 -0
- package/examples/oidc-login/client/views.aug.md +68 -0
- package/examples/oidc-login/common/export.aug +9 -0
- package/examples/oidc-login/common/export.aug.md +33 -0
- package/examples/oidc-login/common/headers.aug +11 -0
- package/examples/oidc-login/common/headers.aug.md +79 -0
- package/examples/oidc-login/common/keys.aug +37 -0
- package/examples/oidc-login/common/keys.aug.md +207 -0
- package/examples/oidc-login/common/settings.aug +4 -0
- package/examples/oidc-login/common/settings.aug.md +47 -0
- package/examples/oidc-login/common/views.aug +16 -0
- package/examples/oidc-login/common/views.aug.md +34 -0
- package/examples/oidc-login/main.aug +39 -0
- package/examples/oidc-login/main.aug.md +166 -0
- package/examples/oidc-login/main.yaml +12 -0
- package/examples/oidc-login/provider/authorization.aug +59 -0
- package/examples/oidc-login/provider/authorization.aug.md +264 -0
- package/examples/oidc-login/provider/contracts.aug +15 -0
- package/examples/oidc-login/provider/contracts.aug.md +193 -0
- package/examples/oidc-login/provider/credentials.aug +10 -0
- package/examples/oidc-login/provider/credentials.aug.md +64 -0
- package/examples/oidc-login/provider/discovery.aug +13 -0
- package/examples/oidc-login/provider/discovery.aug.md +133 -0
- package/examples/oidc-login/provider/export.aug +13 -0
- package/examples/oidc-login/provider/export.aug.md +41 -0
- package/examples/oidc-login/provider/token.aug +37 -0
- package/examples/oidc-login/provider/token.aug.md +223 -0
- package/examples/oidc-login/provider/userinfo.aug +26 -0
- package/examples/oidc-login/provider/userinfo.aug.md +104 -0
- package/examples/oidc-login/provider/views.aug +18 -0
- package/examples/oidc-login/provider/views.aug.md +63 -0
- package/examples/ownership/.aug-spec/manifest.json +8 -0
- package/examples/ownership/counter.aug +14 -0
- package/examples/ownership/counter.aug.md +85 -0
- package/examples/ownership/main.aug +4 -0
- package/examples/ownership/main.aug.md +38 -0
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug +36 -0
- package/examples/ownership-transfer/.aug-spec/august/0.19.0/io/contracts.aug.md +316 -0
- package/examples/ownership-transfer/.aug-spec/manifest.json +10 -0
- package/examples/ownership-transfer/main.aug +9 -0
- package/examples/ownership-transfer/main.aug.md +63 -0
- package/examples/ownership-transfer/resource.aug +16 -0
- package/examples/ownership-transfer/resource.aug.md +89 -0
- package/examples/packages/README.md +15 -0
- package/examples/packages/app/.aug-spec/manifest.json +9 -0
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug +9 -0
- package/examples/packages/app/.aug-spec/packages/@example/aug-math/0.1.0/arithmetic.aug.md +63 -0
- package/examples/packages/app/main.aug +2 -0
- package/examples/packages/app/main.aug.md +33 -0
- package/examples/packages/app/main.yaml +2 -0
- package/examples/packages/math/.aug-spec/manifest.json +8 -0
- package/examples/packages/math/README.md +3 -0
- package/examples/packages/math/aug-package.json +8 -0
- package/examples/packages/math/package.json +9 -0
- package/examples/packages/math/src/arithmetic.aug +8 -0
- package/examples/packages/math/src/arithmetic.aug.md +63 -0
- package/examples/packages/math/src/export.aug +1 -0
- package/examples/packages/math/src/export.aug.md +17 -0
- package/examples/visibility/.aug-spec/manifest.json +8 -0
- package/examples/visibility/counter.aug +14 -0
- package/examples/visibility/counter.aug.md +87 -0
- package/examples/visibility/main.aug +7 -0
- package/examples/visibility/main.aug.md +39 -0
- package/package.json +50 -0
- package/runtime/aug_crypto.c +121 -0
- package/runtime/aug_html.c +93 -0
- package/runtime/aug_http.c +829 -0
- package/runtime/aug_json.c +165 -0
- package/runtime/aug_runtime.c +792 -0
- package/runtime/aug_runtime.h +245 -0
- package/runtime/aug_tasks.c +172 -0
- package/runtime/aug_time.c +5 -0
- package/runtime/aug_values.c +80 -0
- package/scripts/bootstrap-native.mjs +121 -0
- package/scripts/native-dependencies.lock.json +65 -0
- package/scripts/native-home.mjs +11 -0
- package/src/actions.js +109 -0
- package/src/ast.js +19 -0
- package/src/builtins.js +93 -0
- package/src/checker.js +2896 -0
- package/src/cli.js +344 -0
- package/src/codegen.js +1159 -0
- package/src/config.js +149 -0
- package/src/continuation.js +110 -0
- package/src/di.js +24 -0
- package/src/documentation.js +27 -0
- package/src/editor.js +782 -0
- package/src/effects.js +29 -0
- package/src/fixes.js +222 -0
- package/src/formatter.js +296 -0
- package/src/freshness.js +154 -0
- package/src/help.js +212 -0
- package/src/html.js +27 -0
- package/src/http-policies.js +90 -0
- package/src/inference.js +16 -0
- package/src/interceptors.js +70 -0
- package/src/javadoc.js +67 -0
- package/src/lexer.js +199 -0
- package/src/libraries.js +31 -0
- package/src/lsp.js +180 -0
- package/src/native.js +144 -0
- package/src/navigation.js +162 -0
- package/src/openapi.js +220 -0
- package/src/ownership.js +232 -0
- package/src/package-manager.js +299 -0
- package/src/parser.js +1155 -0
- package/src/policies.js +130 -0
- package/src/project-init.js +19 -0
- package/src/project.js +292 -0
- package/src/schemas.js +62 -0
- package/src/semantic.js +255 -0
- package/src/spec.js +738 -0
- package/src/testing.js +186 -0
- package/src/types.js +10 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"recordedAt": "2026-09-28T16:48:45.210Z",
|
|
3
|
+
"version": "0.15.0",
|
|
4
|
+
"workload": "examples/benchmark/main.aug",
|
|
5
|
+
"entries": 20000,
|
|
6
|
+
"expectedOutput": "599970000\ntrue\n",
|
|
7
|
+
"environment": {
|
|
8
|
+
"platform": "darwin",
|
|
9
|
+
"release": "25.6.0",
|
|
10
|
+
"architecture": "arm64",
|
|
11
|
+
"cpu": "Apple M5",
|
|
12
|
+
"node": "v24.18.0"
|
|
13
|
+
},
|
|
14
|
+
"optimization": "release (-O2)",
|
|
15
|
+
"iterations": 10,
|
|
16
|
+
"warmup": 2,
|
|
17
|
+
"includesProcessStartup": true,
|
|
18
|
+
"units": "milliseconds",
|
|
19
|
+
"samples": [
|
|
20
|
+
6.0544590000000085,
|
|
21
|
+
6.099375000000009,
|
|
22
|
+
5.33745799999997,
|
|
23
|
+
4.996000000000038,
|
|
24
|
+
4.762875000000008,
|
|
25
|
+
4.77962500000001,
|
|
26
|
+
4.676667000000009,
|
|
27
|
+
4.5241249999999695,
|
|
28
|
+
4.297333000000037,
|
|
29
|
+
4.267916999999954
|
|
30
|
+
],
|
|
31
|
+
"median": 4.77962500000001,
|
|
32
|
+
"p95": 6.099375000000009,
|
|
33
|
+
"minimum": 4.267916999999954,
|
|
34
|
+
"compiler": {
|
|
35
|
+
"executable": "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang",
|
|
36
|
+
"version": "Apple clang 21.0.0 (clang-2100.3.34.2)"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Compatibility and supported platforms
|
|
2
|
+
|
|
3
|
+
August 0.19 is a preview. This page states the proposed 1.0 compatibility contract and the evidence still needed before it takes effect. The [roadmap](roadmap.md) tracks that release gate.
|
|
4
|
+
|
|
5
|
+
The [ownership and task conformance page](language-conformance.md) records executable candidate behavior for moves, aliasing, cleanup, cancellation, and delayed errors.
|
|
6
|
+
|
|
7
|
+
## What a 1.0 release will keep stable
|
|
8
|
+
|
|
9
|
+
| Surface | 1.x promise |
|
|
10
|
+
| --- | --- |
|
|
11
|
+
| August source | Accepted syntax, import visibility, labeled calls, types, ownership, effects, checked errors, tasks, and same-file tests keep their documented meaning through 1.x. Minor releases can add syntax or APIs. |
|
|
12
|
+
| CLI and project files | Documented `aug` commands, `main.yaml` keys, `aug-package.json`, and `aug.lock.json` retain compatible reading within 1.x. New fields have defaults; removing or changing a field requires a major release. |
|
|
13
|
+
| First-party packages | CLI, standard, web, and crypto packages use one exact version. A release tests installed tarballs together; mixing versions is unsupported. User packages declare a compatible compiler range and retain their own public `export.aug` surface. |
|
|
14
|
+
| Generated specifications | `aug spec` remains deterministic for a given compiler and project. Text and layout can improve between versions; tools should link to source and declarations rather than parse Markdown prose. |
|
|
15
|
+
| Native boundary | `extern C` uses documented C-width mappings and the target platform's C ABI. The generated C runtime and `AugValue` layout are compiler-private today. Before 1.0, the project must either publish and test a versioned adapter ABI or keep that runtime surface private and verify that public `extern C` adapters need no private structure. |
|
|
16
|
+
|
|
17
|
+
A change that makes valid 1.x source fail to compile, changes its observable behavior, or removes a documented public name is breaking. A safety or correctness repair may require a narrow exception, but its release must explain the affected code, provide a diagnostic, and provide `aug migrate` support when mechanical migration is possible. Security fixes can be released promptly; they still get a compatibility note.
|
|
18
|
+
|
|
19
|
+
## Migration between versions
|
|
20
|
+
|
|
21
|
+
Each release documents source, configuration, package, and native changes in the changelog. When spelling can be changed safely, `aug migrate PROJECT` performs or suggests the edit. For changes requiring a choice, the diagnostic explains the alternatives without rewriting behavior silently. Upgrade the four first-party packages and the extension together, then run:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
aug check PROJECT
|
|
25
|
+
aug test PROJECT
|
|
26
|
+
aug spec PROJECT --check
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Rebuild native executables and private dependencies for the target platform after a compiler upgrade. `aug.lock.json` and the pinned native dependency manifest provide the input versions; a compiled executable is not promised to work with a different runtime image or native dependency set.
|
|
30
|
+
|
|
31
|
+
## Platform evidence
|
|
32
|
+
|
|
33
|
+
| Target | Preview evidence | 1.0 support decision |
|
|
34
|
+
| --- | --- | --- |
|
|
35
|
+
| macOS ARM64 | Local pinned native bootstrap and full suite pass. | Candidate; require repeated CI and packaged CLI tests. |
|
|
36
|
+
| Linux ARM64 | Local Docker full native suite passes; core, crypto, and typed HTTP programs run in the matching runtime image. | Candidate; require repeated CI and package tests. |
|
|
37
|
+
| Linux x86-64 | Docker CI is configured for the same full native suite and runtime smoke programs. | Candidate only after that CI gate passes. |
|
|
38
|
+
| Windows and other targets | No full native verification. | Outside the proposed 1.0 support matrix. |
|
|
39
|
+
|
|
40
|
+
Node.js 24+, a C11 compiler, and the [native prerequisites](tooling.md) are required for source builds. The Docker recipes provide those build tools on Linux. The current runtime schedules tasks on one OS thread. HTTP and OIDC library conformance is tracked separately in the [web and crypto gap ledger](web-library-gaps.md); those application concerns are not language 1.0 gates.
|
|
41
|
+
|
|
42
|
+
The 1.0 support matrix becomes a commitment only after each candidate target has green CI, installed-package and native integration tests, dependency/license review, and a documented update path. See [production readiness](production-readiness.md) for present limits.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Structured execution implementation
|
|
2
|
+
|
|
3
|
+
This is an implementation work note, not a delivery claim.
|
|
4
|
+
|
|
5
|
+
The confirmed model uses lexical scopes, ordered waits, cooperative cancellation, guaranteed cleanup, shared read references, exclusive mutation, bounded multicore workers and nonblocking I/O. An unhandled child failure cancels its siblings; a request failure leaves other requests running.
|
|
6
|
+
|
|
7
|
+
The same-app OIDC flow requires an outbound request to suspend its execution while the native HTTP event loop continues accepting provider requests. Running that request synchronously inside an HTTP callback would deadlock.
|
|
8
|
+
|
|
9
|
+
Implementation seams:
|
|
10
|
+
|
|
11
|
+
- Each execution owns its root-frame chain, error state and scope stack. The collector traces all suspended executions and native retained roots.
|
|
12
|
+
- Scoped DI caches belong to scope instances. Shared bindings remain process values; fresh bindings remain uncached.
|
|
13
|
+
- Managed request values cross the transport seam through retained GC roots. Native buffers have explicit transport ownership.
|
|
14
|
+
- A task captures read references and moves owned arguments. Mutable argument loans stay active until join. Collection waits preserve input order.
|
|
15
|
+
- Native I/O starts on the event loop and resumes a suspended execution on completion or cancellation. No worker waits on a blocking socket.
|
|
16
|
+
- Multicore execution requires collector safepoints and synchronization of explicit Shared values. A single event loop alone must not be presented as the completed multicore requirement.
|
|
17
|
+
|
|
18
|
+
Verification must include two requests in the same process that call each other, bounded fan-out, sibling cancellation, cleanup on errors and disconnects, lock restrictions and mutation alias rejection.
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# AugScript diagnostics and fixes
|
|
2
|
+
|
|
3
|
+
Diagnostics include a code, source location, and expected/actual contract where relevant. VS Code shows them while editing, with hover guidance and lightbulb actions. Fixes are precise edits; they are offered only where the compiler has enough information. Warnings do not prevent a build.
|
|
4
|
+
|
|
5
|
+
## Syntax and data
|
|
6
|
+
|
|
7
|
+
| Code | Meaning and remedy |
|
|
8
|
+
| --- | --- |
|
|
9
|
+
| LEX | Check quotes, escapes, comments, Unicode, and token spelling. Strings cannot contain NUL or invalid Unicode. |
|
|
10
|
+
| PARSE | Check delimiters and Type name order. Declarations omit class/function; error clauses use unless. Migration fixes remove the old keywords. A constructor body needs implements after it. |
|
|
11
|
+
| INDENT | A colon needs a newline and indented body. Keep prefixes consistent; align dedents with an open block. Use pass for an empty body. |
|
|
12
|
+
| NUMBER | int literals must fit signed 64 bits, including the exact negative minimum. Float literals must be finite. |
|
|
13
|
+
| TYPE | Check the expected type, nullable status, generic arguments, and input/return contract. User generics are invariant unless an interface declares checked variance. |
|
|
14
|
+
| CALL | Supply ordinary labels exactly once; resolve inputs are omitted from a call. Inference must be concrete and consistent. |
|
|
15
|
+
| COLLECTION | Empty literals need context. List/Set elements and Map keys/values must fit. Tuple indexes are compile-time constants. |
|
|
16
|
+
| RECORD | Data fields must be deeply immutable. Records cannot retain mutable collections, DI inputs, or ownership; validation cannot replace fields. |
|
|
17
|
+
| MATCH | Cover null/bool cases and add else for open type domains. Remove duplicate, incompatible, or unreachable cases. |
|
|
18
|
+
| PATTERN | Tuple destructuring needs matching arity and new names in the current scope. |
|
|
19
|
+
| ITERATION | Iterate List, Set, Map, or a homogeneous Tuple; destructure heterogeneous tuples explicitly. |
|
|
20
|
+
| MUTABILITY | Mark class storage mutable for later writes; a function receives borrow/own access rather than a mutable storage modifier. |
|
|
21
|
+
|
|
22
|
+
Both braces and indentation are accepted. The formatter uses main.yaml preferences and checks that its output parses to the same program before returning an edit.
|
|
23
|
+
|
|
24
|
+
## Modules and interfaces
|
|
25
|
+
|
|
26
|
+
| Code | Meaning and remedy |
|
|
27
|
+
| --- | --- |
|
|
28
|
+
| PROJECT / MAIN | Supply main.aug at the root. Keep declarations in other files and imports/bindings before startup. |
|
|
29
|
+
| SYNTAX | Use word booleans, initialize blocks, implement/with, and resolve/to. Preview `aug migrate PROJECT`, then use --write or the editor's verified migration fix. |
|
|
30
|
+
| IMPORT / EXPORT | Import each file's dependencies. Cross-folder access needs export.aug; only exports belong in that file. Wildcards import visible local declarations, never internal imports. |
|
|
31
|
+
| NAME | Correct spelling or import a visible declaration. Quick Fix offers an import when a unique accessible source exists. |
|
|
32
|
+
| PRIVATE | A leading _ confines a declaration/member/module to its scope. Private names cannot be imported or exported. Constructor labels can differ from private storage. |
|
|
33
|
+
| INTERFACE | Classes need implements and matching method types, labels, ownership, errors, and effects. Override conflicting defaults. Records are the immutable-data alternative. |
|
|
34
|
+
| MODULE | An import cycle or forbidden folder dependency violates the module contract. The message includes the cycle or allowed dependencies. |
|
|
35
|
+
| LINT | An optional architectural warning: wildcard imports, public helper growth, dependency fan-out, broad errors, discarded errors, or explicit shared state. |
|
|
36
|
+
|
|
37
|
+
**Expand to named imports** is available for wildcard imports even without a diagnostic. Configure warnings and strict sibling boundaries in [main.yaml](tooling.md#configuration).
|
|
38
|
+
|
|
39
|
+
## State, dependencies, and errors
|
|
40
|
+
|
|
41
|
+
### EFFECT
|
|
42
|
+
|
|
43
|
+
Callables are pure by default. Declare `changes self` for state transitions or `changes input` for an owned/borrowed input. Receive I/O capabilities through resolve headers and declare `uses dependency.operation`. Callers and interface contracts include every effective effect, including layers.
|
|
44
|
+
|
|
45
|
+
Public fields and managed inputs grant reading. Mark local storage mutable when it needs initialization-independent changes. Constructors are pure; move startup effects into a named method. drop performs only local cleanup and cannot acquire effects/errors through interceptors.
|
|
46
|
+
|
|
47
|
+
### DI
|
|
48
|
+
|
|
49
|
+
Bindings belong in main, imported compositions, or test setup. Targets have only resolve header inputs and satisfy their key. The compiler rejects missing edges, duplicate keys, cycles, unsafe scoped retention, and effectful bound construction.
|
|
50
|
+
|
|
51
|
+
Stateful objects default to fresh. Shared state requires `shared mutable`; scoped state requires `scoped mutable`. Resolve scoped dependencies inside scope; keep their references there.
|
|
52
|
+
|
|
53
|
+
A helper's dependency belongs in its callable/class header. **Lift into the dependency header** replaces a precise body resolve and adds its typed resolve parameter. The application's missing binding remains a separate build error. Calls forward one compatible header dependency.
|
|
54
|
+
|
|
55
|
+
### OWN / BORROW
|
|
56
|
+
|
|
57
|
+
An own value moves into an own input/field/return. Do not copy it into managed storage or use it after a move. A mutable borrow is exclusive and cannot escape into a return or storage. Deep read-only values cannot be borrowed to bypass their contract.
|
|
58
|
+
|
|
59
|
+
Alias tracking includes nested references, call arguments/results, DI identities, branches, and loop re-entry. An exclusive argument cannot overlap another argument or receiver. Quick Fix can wrap a standalone managed mutation in a borrow block when its local access is otherwise legal.
|
|
60
|
+
|
|
61
|
+
### CONCURRENCY
|
|
62
|
+
|
|
63
|
+
A child task keeps its captured objects available until `wait for` or its scope join. Wait before changing a captured object through a collection method, a borrowed call, or a field assignment. An already-open `borrow` block does not let the parent mutate while the child uses the object. See the [conformance rules](language-conformance.md).
|
|
64
|
+
|
|
65
|
+
### THROWS
|
|
66
|
+
|
|
67
|
+
A checked error lacks a compatible catch or unless declaration. The language uses `unless`; THROWS is the diagnostic identifier retained for tooling.
|
|
68
|
+
|
|
69
|
+
**Propagate with unless** adds the specific error to the enclosing contract. At composition statements, **Catch and report the failure** creates a visible recovery template. Choose domain recovery deliberately; no fix silently discards an error.
|
|
70
|
+
|
|
71
|
+
Errors must implement Error. List.get can raise IndexError, dynamic division ArithmeticError, file operations FileError, and c_int conversion ConversionError. Annotated callable errors include every layer's unless clause. Bound constructors must handle their layer errors internally.
|
|
72
|
+
|
|
73
|
+
## Interceptors
|
|
74
|
+
|
|
75
|
+
### INTERCEPTOR
|
|
76
|
+
|
|
77
|
+
Declare an interceptor with one implemented around method. Constructor dependencies are managed resolve parameters; generic parameters belong on the interceptor. Apply a tag to an executable callable or constructor.
|
|
78
|
+
|
|
79
|
+
Selected labels match automatically. `[Name(y=x)]` maps target x to around y. Every selected input has a compatible source, and mappings are unique. Ownership, outputs, effects, and errors must fit the target and any implemented interface. Layer dependencies also appear in the target's dependency header.
|
|
80
|
+
|
|
81
|
+
Fixes can import a visible interceptor, inject a constructor dependency, add around to a braced declaration, or migrate an obsolete process entry point.
|
|
82
|
+
|
|
83
|
+
### NEXT
|
|
84
|
+
|
|
85
|
+
Next exists only inside around. `next()` forwards original inputs; `next(y=value)` replaces a mapped input. It cannot be stored, given generic arguments, or called from a helper. Each execution path calls it at most once; retries through loops/catches are rejected.
|
|
86
|
+
|
|
87
|
+
## Tests, configuration, and native C
|
|
88
|
+
|
|
89
|
+
| Code | Meaning and remedy |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| TEST | Put a class/function suite beside its declaration. Unique groups/cases; bindings before setup before cases. Check row arity/types and execute a bool assertion in each case. |
|
|
92
|
+
| DOC | @param labels, value-return tags, and error tags must match the effective signature. Unknown tags are errors. Missing public docs become warnings only when enabled. |
|
|
93
|
+
| CONFIG | main.yaml uses the supported keys and simple YAML lists. Unknown/duplicate keys and invalid values fail during check. |
|
|
94
|
+
| FFI | Use supported boundary types, matching C widths, labeled inputs, unsafe, and uses C.function in callable contracts. |
|
|
95
|
+
| NATIVE | A C compiler error mapped to its .aug file and line. Fix the boundary declaration or linker configuration; inspect emit-c for generated details. |
|
|
96
|
+
|
|
97
|
+
See [testing](testing.md) and [native tooling](tooling.md) for executable examples and exact limits.
|
package/docs/docker.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Docker build and run images
|
|
2
|
+
|
|
3
|
+
The repository supplies two base images. The **build** image contains Node.js 24, the August compiler, Clang and its sanitizer runtime, and the pinned native task, JSON, web, and crypto dependencies. The **run** image is a small Debian userland with the matching native shared libraries and CA certificates. It runs a compiled August executable as an unprivileged user. Build the run image after the build image so both use the same native dependency build.
|
|
4
|
+
|
|
5
|
+
Build the images from the repository root:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
docker build -f docker/Dockerfile.build -t augscript/build:local .
|
|
9
|
+
docker build -f docker/Dockerfile.run -t augscript/run:local .
|
|
10
|
+
docker build -f docker/Dockerfile.crypto-smoke -t augscript/crypto-smoke:local .
|
|
11
|
+
docker run --rm augscript/crypto-smoke:local
|
|
12
|
+
docker build -f docker/Dockerfile.web-smoke -t augscript/web-smoke:local .
|
|
13
|
+
docker run --rm -p 127.0.0.1:8080:8080 augscript/web-smoke:local
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Create a project with `aug init my-app`, then compile it for Linux. The mount is writable because `aug build` writes `.aug-build` and generated specifications into the project. The following commands assume your Docker engine can bind-mount your working directory:
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
docker run --rm \
|
|
20
|
+
--user "$(id -u):$(id -g)" \
|
|
21
|
+
--mount type=bind,source="$PWD/my-app",target=/workspace \
|
|
22
|
+
augscript/build:local build . --out /workspace/.aug-build/program
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Run that exact executable in the run image:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
docker run --rm \
|
|
29
|
+
--mount type=bind,source="$PWD/my-app/.aug-build",target=/app,readonly \
|
|
30
|
+
augscript/run:local
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
The crypto smoke command prints the SHA-256 digest of `abc`. The web smoke image serves `GET /health` on port 8080 and returns `{"status":"ok"}`. The run image uses Debian bookworm's C runtime; a binary built with this build image uses the matching base distribution. The run image has no shell command in its entry point and contains no compiler, source, package manager, or application secrets. Supply environment, network, ports, and data mounts for your application when needed. These images are source recipes, not published registry tags.
|
|
34
|
+
|
|
35
|
+
For a reproducible image build without a host bind mount, use a multistage Dockerfile: start with `FROM augscript/build:local AS build`, copy the application into `/workspace`, run `aug build /workspace --out /tmp/program`, then start with `FROM augscript/run:local` and copy `/tmp/program` to `/app/program` with `--chown=august:august`. The repository's [`Dockerfile.smoke`](../docker/Dockerfile.smoke) exercises this pattern with the generated starter.
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
[
|
|
2
|
+
{"path":"examples/hello","title":"Hello world with dependencies","group":"Start here","description":"A greeter, a logger, narrow folder exports, and explicit application bindings."},
|
|
3
|
+
{"path":"examples/new-syntax","title":"Labeled calls and injection","group":"Start here","description":"Constructor injection, named inputs, ordinary functions, and same-file tests."},
|
|
4
|
+
{"path":"examples/developer-workflow","title":"A small tested application","group":"Start here","description":"A calculator module with logging, fixtures, groups, and parameterized tests."},
|
|
5
|
+
{"path":"examples/cli-args","title":"Command-line arguments","group":"Start here","description":"Read arguments, inspect collections, and return a process exit status."},
|
|
6
|
+
{"path":"examples/collections","title":"Lists, tuples, sets, and maps","group":"Values and errors","description":"Create typed collections and update them through checked mutable access."},
|
|
7
|
+
{"path":"examples/generics","title":"Generic contracts","group":"Values and errors","description":"Write reusable records, interfaces, classes, and functions with type parameters."},
|
|
8
|
+
{"path":"examples/generic-di","title":"Generic dependency injection","group":"Values and errors","description":"Bind a generic interface and resolve a class that uses it."},
|
|
9
|
+
{"path":"examples/errors","title":"Checked failures","group":"Values and errors","description":"Declare errors with unless, catch them, and run cleanup."},
|
|
10
|
+
{"path":"examples/ownership","title":"Read access and mutable borrows","group":"State and lifetime","description":"Share a reference for reading and grant explicit access for mutation."},
|
|
11
|
+
{"path":"examples/ownership-transfer","title":"Move ownership","group":"State and lifetime","description":"Transfer an owned resource between labeled calls."},
|
|
12
|
+
{"path":"examples/drop","title":"Resource cleanup","group":"State and lifetime","description":"Release an owned resource when its lifetime ends."},
|
|
13
|
+
{"path":"examples/visibility","title":"Private state and helpers","group":"State and lifetime","description":"Keep underscore-prefixed implementation details inside their scope."},
|
|
14
|
+
{"path":"examples/approved-design","title":"Modules and composition","group":"Modules and packages","description":"Combine domain modules, generic values, explicit capabilities, and scoped providers."},
|
|
15
|
+
{"path":"examples/interceptors","title":"Function and constructor middleware","group":"Modules and packages","description":"Layer interceptors, map inputs, and keep logging dependencies explicit."},
|
|
16
|
+
{"path":"examples/packages/math","title":"Create a package","group":"Modules and packages","description":"Publish a small arithmetic library through export.aug and test its public surface."},
|
|
17
|
+
{"path":"examples/packages/app","title":"Use a package","group":"Modules and packages","description":"Install the neighboring arithmetic package and import it through a local alias."},
|
|
18
|
+
{"path":"examples/ffi","title":"A native C boundary","group":"Native applications","description":"Declare a C operation and call it inside an unsafe block."},
|
|
19
|
+
{"path":"examples/benchmark","title":"A finite benchmark","group":"Native applications","description":"Measure a deterministic arithmetic workload with aug bench."},
|
|
20
|
+
{"path":"examples/oidc-login","title":"OpenID Connect login application","group":"Web applications","description":"A login page, provider, client, session JWT, and logout flow in one August project."},
|
|
21
|
+
{"path":"benchmarks/startup","title":"Startup benchmark","group":"Measured programs","description":"The small program used to measure process startup."},
|
|
22
|
+
{"path":"benchmarks/cpu","title":"CPU benchmark","group":"Measured programs","description":"Two million dependent integer steps with a checked result."},
|
|
23
|
+
{"path":"benchmarks/collections","title":"Map and Set benchmark","group":"Measured programs","description":"Insert, find, and iterate over 20,000 collection entries."},
|
|
24
|
+
{"path":"benchmarks/json","title":"JSON benchmark","group":"Measured programs","description":"Parse, decode, and serialize a typed record 5,000 times."},
|
|
25
|
+
{"path":"benchmarks/http","title":"HTTP benchmark","group":"Measured programs","description":"Serve the typed JSON endpoint used in the throughput measurements."}
|
|
26
|
+
]
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "counters.aug · Modules and composition"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "examples/approved-design/counters.aug"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
pageClass: aug-example-page
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# `counters.aug`
|
|
13
|
+
|
|
14
|
+
[Modules and composition](index.md) · Source and specification
|
|
15
|
+
|
|
16
|
+
::: details Files in this project
|
|
17
|
+
|
|
18
|
+
- [`main.aug`](main.md)
|
|
19
|
+
- [`counters.aug`](counters.md)
|
|
20
|
+
- [`domain/app.aug`](domain/app.md)
|
|
21
|
+
- [`domain/export.aug`](domain/export.md)
|
|
22
|
+
- [`domain/models.aug`](domain/models.md)
|
|
23
|
+
- [`domain/numbers.aug`](domain/numbers.md)
|
|
24
|
+
|
|
25
|
+
:::
|
|
26
|
+
|
|
27
|
+
::::: example-compare
|
|
28
|
+
|
|
29
|
+
:::: example-code
|
|
30
|
+
|
|
31
|
+
## Code {#code}
|
|
32
|
+
|
|
33
|
+
::: code-group
|
|
34
|
+
|
|
35
|
+
```aug [Indentation]
|
|
36
|
+
/** Reading state has no mutation effect. */
|
|
37
|
+
interface State:
|
|
38
|
+
read() returns int
|
|
39
|
+
_Initial() implements State:
|
|
40
|
+
read() returns int:
|
|
41
|
+
return 0
|
|
42
|
+
_Updated(int count) implements State:
|
|
43
|
+
read() returns int:
|
|
44
|
+
return count
|
|
45
|
+
/** A mutable counter with an explicit transition contract. */
|
|
46
|
+
interface Counter:
|
|
47
|
+
increment() changes self
|
|
48
|
+
value() returns int
|
|
49
|
+
_Counter(resolve mutable State initial to _state) implements Counter:
|
|
50
|
+
increment() changes self:
|
|
51
|
+
_state to _Updated(count=_state.read() + 1)
|
|
52
|
+
value() returns int:
|
|
53
|
+
return _state.read()
|
|
54
|
+
/** The complete counter composition; its mutable state belongs to each scope. */
|
|
55
|
+
composition Counters:
|
|
56
|
+
implement State with _Initial
|
|
57
|
+
implement Counter with _Counter scoped mutable
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
```aug [Braces]
|
|
61
|
+
/** Reading state has no mutation effect. */
|
|
62
|
+
interface State {
|
|
63
|
+
read() returns int
|
|
64
|
+
}
|
|
65
|
+
_Initial() implements State {
|
|
66
|
+
read() returns int {
|
|
67
|
+
return 0
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
_Updated(int count) implements State {
|
|
71
|
+
read() returns int {
|
|
72
|
+
return count
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
/** A mutable counter with an explicit transition contract. */
|
|
76
|
+
interface Counter {
|
|
77
|
+
increment() changes self
|
|
78
|
+
value() returns int
|
|
79
|
+
}
|
|
80
|
+
_Counter(resolve mutable State initial to _state) implements Counter {
|
|
81
|
+
increment() changes self {
|
|
82
|
+
_state to _Updated(count=_state.read() + 1)
|
|
83
|
+
}
|
|
84
|
+
value() returns int {
|
|
85
|
+
return _state.read()
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** The complete counter composition; its mutable state belongs to each scope. */
|
|
89
|
+
composition Counters {
|
|
90
|
+
implement State with _Initial
|
|
91
|
+
implement Counter with _Counter scoped mutable
|
|
92
|
+
}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
:::
|
|
96
|
+
|
|
97
|
+
::::
|
|
98
|
+
|
|
99
|
+
:::: example-spec
|
|
100
|
+
|
|
101
|
+
## Compiled specification {#specification}
|
|
102
|
+
|
|
103
|
+
August 0.19.0. This document is compiled from checked code with deterministic wording guided by Simplified Technical English.
|
|
104
|
+
|
|
105
|
+
### In this file
|
|
106
|
+
|
|
107
|
+
- [`State`](counters.md#symbol-State) is an interface.
|
|
108
|
+
- [`_Initial`](counters.md#symbol-_Initial) is a class implementing `State`.
|
|
109
|
+
- [`_Updated`](counters.md#symbol-_Updated) is a class implementing `State`.
|
|
110
|
+
- [`Counter`](counters.md#symbol-Counter) is an interface.
|
|
111
|
+
- [`_Counter`](counters.md#symbol-_Counter) is a class implementing `Counter`.
|
|
112
|
+
- [`Counters`](counters.md#symbol-Counters) declares 2 providers.
|
|
113
|
+
|
|
114
|
+
### `State` {#symbol-State}
|
|
115
|
+
|
|
116
|
+
[source](counters.md#code)
|
|
117
|
+
|
|
118
|
+
Interface.
|
|
119
|
+
|
|
120
|
+
**Author documentation**
|
|
121
|
+
|
|
122
|
+
Reading state has no mutation effect.
|
|
123
|
+
|
|
124
|
+
#### `State.read` {#symbol-State.read}
|
|
125
|
+
|
|
126
|
+
[source](counters.md#code)
|
|
127
|
+
|
|
128
|
+
Returns: `int`.
|
|
129
|
+
|
|
130
|
+
Interface contract. A selected implementation supplies the behavior.
|
|
131
|
+
|
|
132
|
+
### `Counter` {#symbol-Counter}
|
|
133
|
+
|
|
134
|
+
[source](counters.md#code)
|
|
135
|
+
|
|
136
|
+
Interface.
|
|
137
|
+
|
|
138
|
+
**Author documentation**
|
|
139
|
+
|
|
140
|
+
A mutable counter with an explicit transition contract.
|
|
141
|
+
|
|
142
|
+
#### `Counter.increment` {#symbol-Counter.increment}
|
|
143
|
+
|
|
144
|
+
[source](counters.md#code)
|
|
145
|
+
|
|
146
|
+
Returns: no value.
|
|
147
|
+
|
|
148
|
+
May change: `self`.
|
|
149
|
+
|
|
150
|
+
Interface contract. A selected implementation supplies the behavior.
|
|
151
|
+
|
|
152
|
+
#### `Counter.value` {#symbol-Counter.value}
|
|
153
|
+
|
|
154
|
+
[source](counters.md#code)
|
|
155
|
+
|
|
156
|
+
Returns: `int`.
|
|
157
|
+
|
|
158
|
+
Interface contract. A selected implementation supplies the behavior.
|
|
159
|
+
|
|
160
|
+
### `Counters` {#symbol-Counters}
|
|
161
|
+
|
|
162
|
+
[source](counters.md#code)
|
|
163
|
+
|
|
164
|
+
**Author documentation**
|
|
165
|
+
|
|
166
|
+
The complete counter composition; its mutable state belongs to each scope.
|
|
167
|
+
|
|
168
|
+
This composition declares these providers before startup:
|
|
169
|
+
|
|
170
|
+
- Provide [`_Initial`](counters.md#symbol-_Initial) when `State` is requested. Reuse one instance.
|
|
171
|
+
- Provide [`_Counter`](counters.md#symbol-_Counter) when `Counter` is requested. Reuse one instance per explicit scope. Permit explicit shared mutation. Required dependencies: `State`.
|
|
172
|
+
|
|
173
|
+
### `_Initial` {#symbol-_Initial}
|
|
174
|
+
|
|
175
|
+
[source](counters.md#code)
|
|
176
|
+
|
|
177
|
+
Behavioral class, private to this file.
|
|
178
|
+
|
|
179
|
+
Satisfies [`State`](counters.md#symbol-State).
|
|
180
|
+
|
|
181
|
+
#### `_Initial.read` {#symbol-_Initial.read}
|
|
182
|
+
|
|
183
|
+
[source](counters.md#code)
|
|
184
|
+
|
|
185
|
+
Returns: `int`.
|
|
186
|
+
|
|
187
|
+
**What it does**
|
|
188
|
+
|
|
189
|
+
- Return `0`.
|
|
190
|
+
|
|
191
|
+
### `_Updated` {#symbol-_Updated}
|
|
192
|
+
|
|
193
|
+
[source](counters.md#code)
|
|
194
|
+
|
|
195
|
+
Behavioral class, private to this file.
|
|
196
|
+
|
|
197
|
+
Satisfies [`State`](counters.md#symbol-State).
|
|
198
|
+
|
|
199
|
+
**Inputs**
|
|
200
|
+
|
|
201
|
+
- `count` (`int`) — required labeled input — stored as `count` and read-only after initialization.
|
|
202
|
+
|
|
203
|
+
#### `_Updated.read` {#symbol-_Updated.read}
|
|
204
|
+
|
|
205
|
+
[source](counters.md#code)
|
|
206
|
+
|
|
207
|
+
Returns: `int`.
|
|
208
|
+
|
|
209
|
+
**What it does**
|
|
210
|
+
|
|
211
|
+
- Return `count`.
|
|
212
|
+
|
|
213
|
+
### `_Counter` {#symbol-_Counter}
|
|
214
|
+
|
|
215
|
+
[source](counters.md#code)
|
|
216
|
+
|
|
217
|
+
Behavioral class, private to this file.
|
|
218
|
+
|
|
219
|
+
Satisfies [`Counter`](counters.md#symbol-Counter).
|
|
220
|
+
|
|
221
|
+
**Inputs**
|
|
222
|
+
|
|
223
|
+
- `initial` ([`State`](counters.md#symbol-State)) — injected; callers omit it — stored as `_state` (private) and mutable.
|
|
224
|
+
|
|
225
|
+
#### `_Counter.increment` {#symbol-_Counter.increment}
|
|
226
|
+
|
|
227
|
+
[source](counters.md#code)
|
|
228
|
+
|
|
229
|
+
Returns: no value.
|
|
230
|
+
|
|
231
|
+
May change: `self`.
|
|
232
|
+
|
|
233
|
+
**What it does**
|
|
234
|
+
|
|
235
|
+
- Set `_state` to call [`_Updated`](counters.md#symbol-_Updated) with `count` = (call [`State.read`](counters.md#symbol-State.read) on `_state` plus `1`).
|
|
236
|
+
|
|
237
|
+
#### `_Counter.value` {#symbol-_Counter.value}
|
|
238
|
+
|
|
239
|
+
[source](counters.md#code)
|
|
240
|
+
|
|
241
|
+
Returns: `int`.
|
|
242
|
+
|
|
243
|
+
**What it does**
|
|
244
|
+
|
|
245
|
+
- Return call [`State.read`](counters.md#symbol-State.read) on `_state`.
|
|
246
|
+
|
|
247
|
+
### Shared language rules
|
|
248
|
+
|
|
249
|
+
See the [language reference](https://greenpandastudios.github.io/augscript/reference) for numeric, equality, ownership, and task rules.
|
|
250
|
+
|
|
251
|
+
::::
|
|
252
|
+
|
|
253
|
+
:::::
|