@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,361 @@
|
|
|
1
|
+
# AugScript language guide
|
|
2
|
+
|
|
3
|
+
Version 0.18. The language aims for code that communicates behavior, dependencies, and effects to a developer seeing a module for the first time.
|
|
4
|
+
|
|
5
|
+
## A complete project
|
|
6
|
+
|
|
7
|
+
`main.aug` contains imports, dependency bindings, and startup statements. Declarations live in other files. Every file has its own import scope.
|
|
8
|
+
|
|
9
|
+
```aug project=quickstart file=main.aug
|
|
10
|
+
import Console and SystemConsole from august.io
|
|
11
|
+
import Application from app
|
|
12
|
+
|
|
13
|
+
implement Console with SystemConsole
|
|
14
|
+
implement app with Application
|
|
15
|
+
|
|
16
|
+
resolve app to program
|
|
17
|
+
program.start()
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```aug project=quickstart file=app.aug
|
|
21
|
+
import Console from august.io
|
|
22
|
+
|
|
23
|
+
/** The application's startup behavior. */
|
|
24
|
+
interface Runnable:
|
|
25
|
+
start() uses Console.write
|
|
26
|
+
|
|
27
|
+
/** Construction receives dependencies and performs no I/O. */
|
|
28
|
+
Application(resolve Console console) implements Runnable:
|
|
29
|
+
start():
|
|
30
|
+
console.write(value="Hello, AugScript!")
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Run `node bin/aug.mjs run PROJECT`, or choose **AugScript: Run Project** in VS Code. Node.js 24+ and a C11 compiler are required.
|
|
34
|
+
|
|
35
|
+
## Blocks and statement boundaries
|
|
36
|
+
|
|
37
|
+
Either spelling creates the same block:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
if ready {
|
|
41
|
+
work()
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if ready:
|
|
45
|
+
work()
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
A colon must be followed by a newline and an indented body. Use a consistent spaces-only or tabs-only prefix within each indentation region. Nested regions must agree with their parent's prefix. Blank lines and comment-only lines do not create blocks. Misaligned dedents, extra indentation, and mixed prefixes are errors. Braced children can appear in an indented block.
|
|
49
|
+
|
|
50
|
+
Parentheses and collection literals allow continuation across lines; their indentation does not create a statement block. Literal `{1, 2}` and `{1: "apple"}` retain their meaning. `pass` is an empty statement, useful for empty interfaces and bodies.
|
|
51
|
+
|
|
52
|
+
A newline, a closing block brace, EOF, or an optional semicolon terminates a statement. Separate two statements on one line with a semicolon. An unfinished operator continues an expression; a leading operator or call parenthesis on a new line does not attach to the previous statement. Start a return value on the same line as `return`. See [the grammar](grammar.md).
|
|
53
|
+
|
|
54
|
+
Use `and`, `or`, and `not` for booleans. They short-circuit. Comparisons bind before `not`: `not count == 0` means `not (count == 0)`. The symbolic boolean operators are rejected; `!=` still compares for inequality.
|
|
55
|
+
|
|
56
|
+
## Imports and visibility
|
|
57
|
+
|
|
58
|
+
`import Name from sibling` imports only that sibling's own public declaration. Imports are explicit even within a folder. Names beginning with `_` are private to their declaring file, class, or interface, and cannot be imported or exported.
|
|
59
|
+
|
|
60
|
+
A folder's public surface is defined by its special `export.aug`:
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
export Logger from logger
|
|
64
|
+
export ConsoleLogger from console
|
|
65
|
+
export folder nested
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Cross-folder access requires the export entry. A dotted path also requires each crossed child folder to be exposed by its parent. A folder with no export file exposes nothing across its boundary. `export.aug` accepts only exports. Private modules and folders cannot be exported.
|
|
69
|
+
|
|
70
|
+
`import Logger and ConsoleLogger from logging` combines imports. `import everything from logging` imports visible declarations and rejects collisions; it never exposes a module's internal imports. The formatter preserves it. Hover shows available names, **Expand to named imports** offers an explicit list, and the [compiled spec](specifications.md) explains dependencies actually used.
|
|
71
|
+
|
|
72
|
+
Import cycles are errors. Optional module dependency policies and public-surface warnings are configured in `main.yaml`. `strict_modules: true` also requires sibling imports to appear in the local export file. Ctrl-click `from` or a path segment to open its source file or export file, including `august.io`.
|
|
73
|
+
|
|
74
|
+
Project dependencies use aliases in `main.yaml`: `packages: math: "npm:@owner/aug-math@1.2.3"` as a nested YAML block. Run `aug install`, then write `import add from math`. A library exposes only its source folder's `export.aug`; internal modules and undeclared transitive dependencies are inaccessible. See [creating and using packages](packages.md#author-a-package).
|
|
75
|
+
|
|
76
|
+
## Types, labels, and generics
|
|
77
|
+
|
|
78
|
+
Built-in types include `int`, `c_int`, `float`, `bool`, `string`, `void`, `Error`, runtime error classes, `List<T>`, `Set<T>`, `Map<K,V>`, `Tuple<T1,...>`, Bytes, Json, Html, Task<T>, Shared<T>, HttpRequest, HttpResponse<T>, ServerEvent<T>, and opaque RSA key types. `optional T` allows a value of T or null. Omitted optional inputs and fields become null; there is no separate missing state. `Type?`, `optional Type?`, and the old missing keyword are rejected.
|
|
79
|
+
|
|
80
|
+
Write `Type name = expression`, `Type name to expression`, or an inferred assignment. Every ordinary input in a call has its public label: `add(right=2, left=1)`. Each label is supplied once. Inputs marked `resolve` are supplied through composition and cannot be passed explicitly.
|
|
81
|
+
|
|
82
|
+
User generics are invariant by default. Inference must produce a concrete, consistent type; repeated occurrences of a type parameter cannot disagree. Empty literals can infer from other labeled arguments. Explicit arguments remain available when inference has no evidence.
|
|
83
|
+
|
|
84
|
+
```aug project=generics-guide file=main.aug
|
|
85
|
+
import Item and describe and Holder and Named and Producer from types
|
|
86
|
+
|
|
87
|
+
print(value=describe(value=Item()))
|
|
88
|
+
Producer<Named> item = Holder(value=Item())
|
|
89
|
+
print(value=item.get().name())
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
```aug project=generics-guide file=types.aug
|
|
93
|
+
interface Named:
|
|
94
|
+
name() returns string
|
|
95
|
+
|
|
96
|
+
Item() implements Named:
|
|
97
|
+
name() returns string:
|
|
98
|
+
return "item"
|
|
99
|
+
|
|
100
|
+
describe<T implements Named>(T value) returns string:
|
|
101
|
+
return value.name()
|
|
102
|
+
|
|
103
|
+
interface Producer<out T>:
|
|
104
|
+
get() returns T
|
|
105
|
+
|
|
106
|
+
Holder<T>(T value) implements Producer<T>:
|
|
107
|
+
get() returns T:
|
|
108
|
+
return value
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Constraints name interfaces. Multiple constraints use `and`. Only interfaces declare `out T` or `in T`; the compiler checks every occurrence, including inherited members. Classes, records, and mutable collections remain invariant. Generic DI keys must be concrete, such as `Repository<int>`.
|
|
112
|
+
|
|
113
|
+
## Classes, records, and local state
|
|
114
|
+
|
|
115
|
+
A class starts with its name and ends its header with `implements Interface`. There is no `class` or `function` prefix and no class inheritance. Interfaces can extend several interfaces and supply default methods; conflicting inherited defaults require an explicit override. Interfaces have methods and no fields.
|
|
116
|
+
|
|
117
|
+
Header inputs become fields. Fields are read-only after initialization unless marked `mutable`. Public names grant access; names starting with `_` keep storage private. Separate a public constructor label from private storage with `int initial to _count`. The shorthand `int _count` exposes the input label `count`.
|
|
118
|
+
|
|
119
|
+
```aug project=state-guide file=main.aug
|
|
120
|
+
import Counter from counter
|
|
121
|
+
|
|
122
|
+
counter to Counter(initial=4)
|
|
123
|
+
borrow counter:
|
|
124
|
+
counter.increment()
|
|
125
|
+
print(value=counter.value())
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
```aug project=state-guide file=counter.aug
|
|
129
|
+
interface Count:
|
|
130
|
+
increment() changes self
|
|
131
|
+
value() returns int
|
|
132
|
+
|
|
133
|
+
Counter(mutable int initial to _count) implements Count:
|
|
134
|
+
initialize:
|
|
135
|
+
_count = _count + 1
|
|
136
|
+
increment() changes self:
|
|
137
|
+
_count = _count + 1
|
|
138
|
+
value() returns int:
|
|
139
|
+
return _count
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The optional `initialize` block runs after header and local field initialization and must be pure. It may establish local fields. Put it before methods. Put external startup work in a named method and call it from main.
|
|
143
|
+
|
|
144
|
+
An immutable record is data and needs no marker interface:
|
|
145
|
+
|
|
146
|
+
```aug project=data-guide file=main.aug
|
|
147
|
+
import Point from data
|
|
148
|
+
|
|
149
|
+
point = Point(y=2, x=1)
|
|
150
|
+
print(value=point == Point(x=1, y=2))
|
|
151
|
+
print(value={point, Point(x=1, y=2)}.length())
|
|
152
|
+
(first, second) = (1, "pear")
|
|
153
|
+
print(value=second)
|
|
154
|
+
|
|
155
|
+
for (key, value) in {1: "apple", 2: "pear"}:
|
|
156
|
+
print(value=value)
|
|
157
|
+
|
|
158
|
+
Map<int, string> fruit = {1: "apple"}
|
|
159
|
+
match fruit.get(key=7):
|
|
160
|
+
when null:
|
|
161
|
+
print(value="missing")
|
|
162
|
+
when some name:
|
|
163
|
+
print(value=name)
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
```aug project=data-guide file=data.aug
|
|
167
|
+
record Point(int x, int y)
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
Record fields contain primitives, tuples, and immutable records. They cannot store mutable collections, capabilities, or ownership inputs. Records compare and hash by type and field values. Validation uses `record Positive(int value) unless DomainError { initialize { ... } }`; it may reject an input, and cannot replace immutable fields. Behavioral classes compare by identity.
|
|
171
|
+
|
|
172
|
+
## Collections and iteration
|
|
173
|
+
|
|
174
|
+
| Literal | Type | Behavior |
|
|
175
|
+
| --- | --- | --- |
|
|
176
|
+
| `[1, 2]` | `List<int>` | Ordered, mutable elements. |
|
|
177
|
+
| `(1, 2)` | `Tuple<int,int>` | Fixed positions; `(1,)` is a singleton. |
|
|
178
|
+
| `{1, 2}` | `Set<int>` | Unique elements with hashing. |
|
|
179
|
+
| `{1: "apples", 2: "pears"}` | `Map<int,string>` | Hashed keys; the last duplicate key wins. |
|
|
180
|
+
|
|
181
|
+
Empty literals require context: `List<int> values = []`, `Set<int> values = {}`, or `Map<int,string> values = {}`. Typed declarations require a variable name. Mixed integer/float literals widen to float. A tuple can contain different types. `(1)` is grouping and `()` is an empty tuple.
|
|
182
|
+
|
|
183
|
+
| Type | Reading | Mutation |
|
|
184
|
+
| --- | --- | --- |
|
|
185
|
+
| List | `length()`, `get(index=...)` unless IndexError, `at(index=...)` returns T? | `append(value=...)` |
|
|
186
|
+
| Set | `length()`, `contains(value=...)` | `add(value=...)` |
|
|
187
|
+
| Map | `length()`, `contains(key=...)`, `get(key=...)` returns V? | `set(key=..., value=...)` |
|
|
188
|
+
| Tuple | `length()`, `get(index=constant)` with compile-time bounds | None |
|
|
189
|
+
|
|
190
|
+
Managed mutations need a borrow; owned collections mutate directly. Collections cannot store borrowed or owned references by copying them. Reference results grant reading.
|
|
191
|
+
|
|
192
|
+
Tuple destructuring introduces new local names and checks arity. `for item in values` snapshots List, Set, and homogeneous Tuple elements. `for (key, value) in map` snapshots entries in insertion order. Modifying the original collection does not extend the current iteration. Reference elements remain read-only.
|
|
193
|
+
|
|
194
|
+
## Functions, effects, and capabilities
|
|
195
|
+
|
|
196
|
+
A bare header without `implements` declares a function. Omitting `returns` means void. Non-void bodies must return or throw on every path. A bodyless top-level declaration cannot be called unless it is an extern declaration.
|
|
197
|
+
|
|
198
|
+
Public standalone functions and interface contracts are pure unless they declare capabilities. State transitions declare `changes self` or `changes input`; mutable reference inputs require `borrow` or `own`. A helper cannot mutate a managed input, an alias, or nested objects reachable through it.
|
|
199
|
+
|
|
200
|
+
I/O uses capability interfaces and checked `uses dependency.operation` contracts. Capability types have interface behavior and permit explicit adapter substitution. The standard `august.io` folder provides Console/SystemConsole, FileReader/FileWriter/LocalFiles, and Arguments/ProcessArguments.
|
|
201
|
+
|
|
202
|
+
```aug project=capabilities-guide file=main.aug
|
|
203
|
+
import Console and SystemConsole from august.io
|
|
204
|
+
import announce from messages
|
|
205
|
+
|
|
206
|
+
implement Console with SystemConsole
|
|
207
|
+
announce(message="Dependencies are visible")
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
```aug project=capabilities-guide file=messages.aug
|
|
211
|
+
import Console from august.io
|
|
212
|
+
|
|
213
|
+
announce(resolve Console console, string message) uses console.write:
|
|
214
|
+
console.write(value=message)
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
A caller's contract must include the effects of its calls and interceptor layers. Interface implementations cannot add mutation or effects beyond the interface contract. A contract may name `Console.write` when a concrete dependency is exposed through another interface.
|
|
218
|
+
|
|
219
|
+
### Short implementation headers
|
|
220
|
+
|
|
221
|
+
Class methods and private `_helpers` infer `uses` when it is omitted. Interfaces, public standalone functions, interface default methods, and interceptor `around` methods retain explicit effect contracts. An explicit `uses` clause is an upper bound, including on implementations. `changes` and `unless` are still explicit.
|
|
222
|
+
|
|
223
|
+
```text
|
|
224
|
+
import Console from august.io
|
|
225
|
+
|
|
226
|
+
interface Logger:
|
|
227
|
+
log(string message) uses Console.write
|
|
228
|
+
|
|
229
|
+
ConsoleLogger(resolve Console console) implements Logger:
|
|
230
|
+
log(string message):
|
|
231
|
+
_write(console, message)
|
|
232
|
+
|
|
233
|
+
_write(Console console, string message):
|
|
234
|
+
console.write(value=message)
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Both bodies infer `Console.write`; the interface states it once. Inference follows calls, generic substitutions and interceptor layers to a fixed point, so declaration order does not matter. Hover and `aug explain` show inferred capabilities; generated library API pages include them. Calling an inferred helper from a pure public function is a compile error. A pure interface cannot acquire hidden I/O through its implementation.
|
|
238
|
+
|
|
239
|
+
Capability implementations inherit their operation contract even when a test adapter does no I/O. This includes shared-state capabilities such as `ExpiringStore<T>`. Constructors and `drop()` remain pure; inference does not permit I/O while holding a lock. Type-changing recursive generic effect inference that cannot converge requires an explicit finite `uses` clause.
|
|
240
|
+
|
|
241
|
+
Outside main and test setup, every injected dependency is declared in the callable/class header. Calls forward the one compatible header dependency; multiple candidates require a clearer header. Constructor and interceptor dependencies are checked the same way. Body-level `resolve` is rejected with a fix to lift it into the header.
|
|
242
|
+
|
|
243
|
+
Raw `print`, `arguments`, `read_file`, and `write_file` are available to main/test tooling and the trusted standard adapters. Other callables receive explicit capabilities. Pure construction cannot perform these effects.
|
|
244
|
+
|
|
245
|
+
## Dependency injection and lifetimes
|
|
246
|
+
|
|
247
|
+
Provide one implementation per key before startup: `implement Logger with ConsoleLogger`. A named key such as `app` selects a class without a type key. `resolve app to program` retrieves it explicitly. Legacy `bind` and assignment-form resolve are rejected; use `aug migrate` or the editor migration fix.
|
|
248
|
+
|
|
249
|
+
A bound class must have only `resolve` header inputs. Duplicate bindings, missing dependencies, cycles, incompatible keys, and effectful bound construction are errors. Diagnostics show the dependency path. Declaration order does not determine initialization order.
|
|
250
|
+
|
|
251
|
+
| Lifetime | Meaning |
|
|
252
|
+
| --- | --- |
|
|
253
|
+
| `shared` | One eagerly constructed instance per composition. Default for stateless adapters. |
|
|
254
|
+
| `fresh` | Construct on each resolve. Default for stateful classes. |
|
|
255
|
+
| `scoped` | Cache inside an explicit `scope` block; nested scopes have their own cache and restore the outer cache. |
|
|
256
|
+
|
|
257
|
+
Statefulness includes mutable fields, owned mutable storage, `changes self` methods, and retained stateful dependencies. Process-wide state requires `shared mutable`. Stateful scoped bindings use `scoped mutable`. Scoped dependencies require a scope even through fresh factories; shared objects cannot retain them.
|
|
258
|
+
|
|
259
|
+
A scoped reference cannot escape into an outer variable, a return, or longer-lived storage. A first-class `composition Services { implement ... }` collects bindings in an explicitly imported module. Main or test setup uses `include Services` before execution. There is one root and no implicit registration.
|
|
260
|
+
|
|
261
|
+
See [the scoped composition example](../examples/approved-design/counters.aug).
|
|
262
|
+
|
|
263
|
+
## Ownership and read access
|
|
264
|
+
|
|
265
|
+
Default objects are managed and reclaimed by the runtime. Ordinary reads require no borrow. An `own` value has exclusive lifetime control; passing it to an own input, field, or return moves it. Using a moved value or copying it into managed storage is rejected.
|
|
266
|
+
|
|
267
|
+
`borrow value { ... }` or its colon form grants exclusive mutable access. A `borrow Type input` grants it for the call. The compiler tracks aliases, nested references, binding identities, call inputs/results, branch joins, escaping loans, and loop re-entry. Ordinary managed inputs and public reference reads are deep read-only views.
|
|
268
|
+
|
|
269
|
+
Owned values are dropped on normal or error exits. An optional `drop()` method takes no inputs, returns void, and performs only local cleanup. Cleanup layers cannot add effects or errors. External shutdown work belongs in an explicit effect-declared method. Managed objects are collected at runtime safe points; process roots survive to shutdown.
|
|
270
|
+
|
|
271
|
+
`Shared(value=...)` takes a fresh or owned value. The wrapper owns that payload, so dropping an owned `Shared<T>` also runs the payload's `drop()` before later local cleanup. A `resolve` dependency counts as a call input for alias checks: it cannot refer to an object also passed as an exclusive input. A scheduled task captures dependencies supplied through `resolve` as well as written call arguments. Wait for a task before mutably borrowing an object it reads through either path.
|
|
272
|
+
|
|
273
|
+
A child borrowing an owned `Shared<T>` pins the wrapper until the child finishes. The parent cannot transfer it to another owner, put it in another `Shared<T>`, or return it while the child uses it. A child can still read a `Shared<T>` concurrently through its own reference. Use `lock` to access the payload.
|
|
274
|
+
|
|
275
|
+
If a child starts while a `borrow` block is already open, the parent cannot mutate the captured object until it waits. The rule also applies to a borrowed function call or a direct field assignment. See the [executable conformance rules](language-conformance.md).
|
|
276
|
+
|
|
277
|
+
If `start` runs inside a loop, a wait for one result may leave children from earlier iterations running. Their captures remain pinned until the enclosing `scope` joins them. To release captures on each iteration, put a `scope` inside the loop and finish its children there.
|
|
278
|
+
|
|
279
|
+
For a collection of tasks, `wait for tasks` joins the whole list. Waiting for one task selected with a dynamic index cannot prove which sibling tasks remain active, so their captures stay pinned until the scope joins them.
|
|
280
|
+
|
|
281
|
+
The analysis intentionally rejects some programs when it cannot prove separate origins or freshness. This prototype is conservative; it is not a formal ownership proof. Threading semantics remain deferred.
|
|
282
|
+
|
|
283
|
+
## Null, matching, and checked failures
|
|
284
|
+
|
|
285
|
+
Nullable locals narrow after null checks, short-circuit conditions, match patterns, and surviving early-return branches. Mutable fields are narrowed conservatively.
|
|
286
|
+
|
|
287
|
+
`match value` uses `when null`, `when some name`, `when true`, `when false`, or `when Type name`. Nullable and bool matches must cover every case. Open class/interface domains require `else`. Duplicate/unreachable cases and incompatible patterns are errors.
|
|
288
|
+
|
|
289
|
+
An error satisfies Error. A callable declares specific errors with `returns T unless FileError and DomainError`. It can throw any value satisfying its declaration; declaring Error accepts any Error implementation. Calls must catch or propagate all effective errors, including interceptor layers.
|
|
290
|
+
|
|
291
|
+
`start` evaluates its receiver and arguments immediately; their errors belong to the scheduling statement. The scheduled operation's errors belong to a `wait for` or its owning scope's implicit join. Unobserved sibling failures can reach any wait in that group. Grouped waits observe every selected child, including cancellation cleanup, and rethrow the first failure. A helper awaiting a `Task<T>` parameter declares or handles `Error`, since that public type does not specify a narrower error contract yet.
|
|
292
|
+
|
|
293
|
+
An error already leaving the parent remains the reported error if cancelling a child causes its cleanup to fail. `always` cleanup still runs for that child. A `return` from a scope joins its children before the caller receives the result.
|
|
294
|
+
|
|
295
|
+
```aug project=errors-guide file=main.aug
|
|
296
|
+
import load from files
|
|
297
|
+
import FileReader and LocalFiles from august.io
|
|
298
|
+
|
|
299
|
+
implement FileReader with LocalFiles
|
|
300
|
+
try:
|
|
301
|
+
print(value=load(path="definitely-missing.txt"))
|
|
302
|
+
catch FileError error:
|
|
303
|
+
print(value="No configuration available")
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
```aug project=errors-guide file=files.aug
|
|
307
|
+
import FileReader from august.io
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Read a configuration file.
|
|
311
|
+
* @param path File path.
|
|
312
|
+
* @return UTF-8 text.
|
|
313
|
+
* @throws FileError Reading failed or the text is invalid.
|
|
314
|
+
*/
|
|
315
|
+
load(resolve FileReader files, string path) returns string uses files.read unless FileError:
|
|
316
|
+
return files.read(path=path)
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
List.get raises IndexError; List.at returns null. Division by a potentially zero value requires ArithmeticError handling. Literal nonzero divisors need no error clause. Runtime invariant corruption and allocation failure remain fatal.
|
|
320
|
+
|
|
321
|
+
Quick Fix offers propagation through `unless` or an explicit recovery template. Optional lints flag broad Error contracts and discarded errors. The internal diagnostic code for unchecked failures remains THROWS; the language spelling is `unless`.
|
|
322
|
+
|
|
323
|
+
## Interceptors
|
|
324
|
+
|
|
325
|
+
A first-class `interceptor` wraps a function, method, or constructor. It defines one implemented `around`, may have helper methods and resolve dependencies, and needs no interface.
|
|
326
|
+
|
|
327
|
+
```aug project=interceptors-guide file=main.aug
|
|
328
|
+
import describe from descriptions
|
|
329
|
+
|
|
330
|
+
print(value=describe(x=4, label="answer"))
|
|
331
|
+
```
|
|
332
|
+
|
|
333
|
+
```aug project=interceptors-guide file=descriptions.aug
|
|
334
|
+
interceptor AddOne<T>:
|
|
335
|
+
around(int y) returns T:
|
|
336
|
+
return next(y=y + 1)
|
|
337
|
+
|
|
338
|
+
[AddOne(y=x)]
|
|
339
|
+
describe(int x, string label) returns string:
|
|
340
|
+
return label
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
Around selects only the target inputs it needs. Labels match automatically; `[Validator(y=x)]` maps target x to around y. Resolve inputs are declared dependencies, never mappings. Types, ownership, effects, errors, and results are checked. Generic arguments can be inferred or supplied.
|
|
344
|
+
|
|
345
|
+
Layers execute in written order; the first is outermost. `next()` forwards original inputs to the next layer or target. Labeled overrides change mapped inputs, while unselected inputs pass through. Each path calls next at most once. A layer can deliberately short-circuit with a compatible result or error.
|
|
346
|
+
|
|
347
|
+
Every layer dependency must appear in the target's header dependencies; registration is explicit. Constructor layers must be pure. Callable hover and explain/context output show layer order, dependency origins, added effects/errors, delegation, and possible short-circuiting.
|
|
348
|
+
|
|
349
|
+
See [the complete validation and testing example](../examples/approved-design/domain/numbers.aug).
|
|
350
|
+
|
|
351
|
+
## Documentation, tests, and tooling
|
|
352
|
+
|
|
353
|
+
Javadoc immediately before a declaration feeds hover, completion, and signature help. Supported tags include `@param`, `@return`, `@throws`/`@exception`, `@see`, and `@deprecated`; `{@code ...}` and `{@link ...}` format inline help. Parameter labels, return tags, and effective error tags are checked; mismatches are DOC errors. Implementations can inherit interface method documentation.
|
|
354
|
+
|
|
355
|
+
`aug spec` compiles each file's complete behavior into an adjacent Markdown explanation. Comments are optional unless `main.yaml` sets `spec.require_comments` to `public` or `all`. See [compiled specifications](specifications.md).
|
|
356
|
+
|
|
357
|
+
Enable the public_docs lint for missing public descriptions. Keep behavior examples in [same-file class or function suites](testing.md). [Explain/context](tooling.md#context-for-developers-and-llms) gathers contracts and provenance with a bounded output budget. The persistent editor server checks local modules while an application root is unfinished; complete composition remains a build gate.
|
|
358
|
+
|
|
359
|
+
Numeric widths, Unicode behavior, FFI, configuration, debugging, benchmarks, and CLI output are specified in [the tooling guide](tooling.md).
|
|
360
|
+
|
|
361
|
+
First-party endpoints, wire inputs, HTTP policies, streams, server components and actions, scoped tasks, OpenAPI, endpoint tests and cryptographic capabilities are specified in the [web guide](web.md). The [same-app login proof](../examples/oidc-login/README.md) demonstrates these features through an OpenID Connect provider and client in one executable.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# August web release review
|
|
2
|
+
|
|
3
|
+
Reviewed on 2026-09-28 against [the confirmed implementation plan](web-implementation-plan.md). The repository had no existing commit, so the initial implementation was reviewed as a whole. Independent Standards and Spec reviewers performed follow-up checks after fixes. Compiler, native socket, browser transport, and same-file endpoint regressions verify the runtime behavior.
|
|
4
|
+
|
|
5
|
+
## Standards
|
|
6
|
+
|
|
7
|
+
All six original invariant findings are addressed: duplicate input safety, inherited child cancellation/deadlines, lock progress, owned capture lifetime, delayed checked errors, and response status errors. Follow-up fixes narrow cleanup to the explicit scope boundary, check possible sibling failures at waits, and observe all selected children during failed grouped waits. No concrete new defects were found in the final narrow review.
|
|
8
|
+
|
|
9
|
+
Policy emission now uses named native identifiers instead of duplicated numeric ordering.
|
|
10
|
+
|
|
11
|
+
## Spec
|
|
12
|
+
|
|
13
|
+
All five original and two follow-up findings are addressed: malformed duplicate inputs, cancellation while awaiting children, lossless int64 action values, complex typed forms, empty endpoint-test streams, string-valued Json form encoding, and post-yield failures in endpoint tests. No new defects were found in the final narrow review.
|
|
14
|
+
|
|
15
|
+
## Verification
|
|
16
|
+
|
|
17
|
+
`npm run check` passes. The final full `npm test` run passes all 185 tests, including native HTTP/1.1, TLS HTTP/2 and HTTP/3, independent signature verification, and the same-application OpenID Connect login/session/logout flow.
|
|
18
|
+
|
|
19
|
+
## Remaining scope
|
|
20
|
+
|
|
21
|
+
See [the gap ledger](web-library-gaps.md). Multicore worker and channel/broadcast changes were rejected by automatic approval review and have not been applied; explicit approval requests remain pending. This release uses cooperative scheduling on one OS thread. Broader HTTP and OpenID Connect certification, persistent accounts, federation, key rotation, inbound streams, and other recorded follow-up capabilities remain outside the verified proof.
|
|
22
|
+
|
|
23
|
+
Final review: Standards 0 unresolved findings; Spec 0 unresolved findings within the implemented scope. Pending approval scope remains incomplete.
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Releasing August
|
|
2
|
+
|
|
3
|
+
All first-party packages and the extension use one compiler-compatible version. npm manifests live in `packages`; canonical code remains in `src` and `runtime`.
|
|
4
|
+
|
|
5
|
+
## Verify and create artifacts
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
node scripts/version.mjs 0.19.0
|
|
9
|
+
npm ci
|
|
10
|
+
npm --prefix vscode ci
|
|
11
|
+
node scripts/bootstrap-native.mjs
|
|
12
|
+
npm run version:check
|
|
13
|
+
npm run check
|
|
14
|
+
npm test
|
|
15
|
+
npm run docs:check
|
|
16
|
+
npm run docs:build
|
|
17
|
+
npm run package:packages
|
|
18
|
+
npm run test:packages -- --native
|
|
19
|
+
npm run package:extension
|
|
20
|
+
node scripts/release-artifacts.mjs
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Update both changelogs and relevant guides, and commit regenerated docs. The final artifact step combines four installable npm tarballs, a VSIX, offline documentation, package metadata and SHA-256 checksums under `dist/release`. It excludes native caches, private credentials and application build output.
|
|
24
|
+
|
|
25
|
+
## GitHub release
|
|
26
|
+
|
|
27
|
+
After verification and committing, create and push the version tag:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
git tag v0.19.0
|
|
31
|
+
git push origin main v0.19.0
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
`release.yml` validates the tag against every manifest, runs compiler/native/docs/package gates, and uploads artifacts to a **draft prerelease**. Review the draft and publish it in GitHub Releases. `ci.yml` checks pushes and pull requests. Linux CI builds the pinned full native stack, runs the native suite, and executes core and crypto apps in the matching runtime image. macOS CI runs the same native suite with its private bootstrap.
|
|
35
|
+
|
|
36
|
+
## npm publication
|
|
37
|
+
|
|
38
|
+
The intended scope is `@greenpandastudios`. Claim this npm identity or choose an owned scope consistently before the first registry release. Create the initial packages with the owner's authenticated npm account. GitHub tarballs work independently of registry setup.
|
|
39
|
+
|
|
40
|
+
Configure a trusted publisher for each of the four npm packages:
|
|
41
|
+
|
|
42
|
+
- Owner: `GreenPandaStudios`
|
|
43
|
+
- Repository: `augscript`
|
|
44
|
+
- Workflow filename: `publish-npm.yml`
|
|
45
|
+
- Environment: `npm`
|
|
46
|
+
- Allowed action: `npm publish` (new configurations default to stage publishing)
|
|
47
|
+
|
|
48
|
+
Use npm CLI 11.5.1+ and GitHub-hosted runners. The workflow grants `id-token: write` for OIDC and needs no stored npm publishing token. Match package repository URLs to this repository. See [npm's trusted publisher instructions](https://docs.npmjs.com/trusted-publishers/).
|
|
49
|
+
|
|
50
|
+
Publishing a reviewed GitHub release automatically runs **Publish npm packages**. To retry, dispatch that workflow with the existing verified version tag. It checks out that tag, checks types/docs/installed artifacts, then publishes standard library, web, crypto and CLI in dependency order with public access and the `next` dist tag. The `npm` environment can hold owner-configured release protection. Existing versions cannot be overwritten; inspect partial runs before retrying.
|
|
51
|
+
|
|
52
|
+
## VS Code Marketplace
|
|
53
|
+
|
|
54
|
+
Confirm ownership of the `augscript` Marketplace publisher. Publishing a reviewed GitHub release runs **Publish VS Code extension** (`publish-marketplace.yml`); manual dispatch accepts the same published tag for retries. It downloads the release's VSIX, verifies its SHA-256 checksum, version and `augscript.augscript` identity, then publishes that exact artifact. VSIX files remain available directly from GitHub Releases.
|
|
55
|
+
|
|
56
|
+
One-time owner setup follows [Microsoft's secure publishing guide](https://code.visualstudio.com/api/working-with-extensions/publishing-extension#secure-automated-publishing-to-visual-studio-marketplace):
|
|
57
|
+
|
|
58
|
+
- Create a Microsoft Entra identity and grant it publishing access to the `augscript` Marketplace publisher.
|
|
59
|
+
- Add a GitHub federated credential with issuer `https://token.actions.githubusercontent.com`, audience `api://AzureADTokenExchange`, and subject `repo:GreenPandaStudios/augscript:environment:marketplace`.
|
|
60
|
+
- Create the GitHub environment `marketplace` and set its variables `AZURE_CLIENT_ID` and `AZURE_TENANT_ID` to that identity's IDs. Configure release protection there if needed.
|
|
61
|
+
|
|
62
|
+
The workflow uses Azure login through OIDC and the pinned `vsce` CLI's `--azure-credential` support. No publishing token is stored. The first public listing requires the publisher identity setup; the repository does not establish ownership of a Marketplace namespace. The intended listing is [AugScript](https://marketplace.visualstudio.com/items?itemName=augscript.augscript), currently unpublished.
|
|
63
|
+
|
|
64
|
+
The packaging script supplies the repository's `vscode` directory as the HTTPS
|
|
65
|
+
base for README images. Verify those URLs are public before Marketplace
|
|
66
|
+
publication; a private or not-yet-created repository cannot serve them to other
|
|
67
|
+
users. The extension logo and **AugScript: Open Welcome** images are bundled
|
|
68
|
+
locally and do not depend on that image host. To update artwork, run
|
|
69
|
+
`npm --prefix vscode run artwork` and commit the rendered PNGs.
|
|
70
|
+
|
|
71
|
+
Global Azure DevOps PATs retire on December 1, 2026; this project does not introduce a new long-lived Marketplace PAT. Marketplace identity setup is an external owner prerequisite.
|
|
72
|
+
|
|
73
|
+
## Documentation deployment
|
|
74
|
+
|
|
75
|
+
Enable GitHub Pages with **GitHub Actions** as its publishing source. `docs.yml` checks generated pages, builds the same Markdown and deploys through the `github-pages` environment after successful CI on main. Private repositories need an eligible GitHub plan for Pages. Docs remain readable in the repo and offline artifact when Pages is unavailable. See [GitHub's workflow requirements](https://docs.github.com/en/pages/getting-started-with-github-pages/using-custom-workflows-with-github-pages).
|
|
76
|
+
|
|
77
|
+
## Current limits
|
|
78
|
+
|
|
79
|
+
August is experimental. Native web/crypto bootstrap supports macOS and Linux; other platforms are unverified. Registry and Marketplace identities require owner configuration. User-authored source packages are supported through npm transport; prebuilt native dependency releases and a stable external native adapter ABI remain future work. See [the gap ledger](web-library-gaps.md) and [performance assessment](performance.md).
|
package/docs/roadmap.md
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Roadmap to 1.0.0
|
|
2
|
+
|
|
3
|
+
August's goal is a language that stays understandable as a codebase grows: local context, explicit public surfaces and dependencies, checked errors, and generated explanations that match the executable code. This roadmap covers the language, its native toolchain, and developer distribution. It uses evidence gates, not a speculative release date.
|
|
4
|
+
|
|
5
|
+
| Stage | Work | Exit evidence |
|
|
6
|
+
| --- | --- | --- |
|
|
7
|
+
| 0.19: public preview | Runnable CLI, editor, source packages, wiki, same-file tests, specs, measured benchmarks, and starter projects. | Current CI and [example projects](examples/index.md); experimental label remains. |
|
|
8
|
+
| 0.x: language and ownership | Define and check mutable captures, shared object lifetime, cleanup, delayed errors, and task cancellation for the documented cooperative task model; keep both block styles and specs in sync. | **Open:** the [ownership and task conformance suite](language-conformance.md) covers moves, aliases, branch and nested-scope joins, initialization, return/error exits, collection pressure, and public `Task<T>` errors. [Generated robustness checks](production-readiness.md#what-is-measured-and-verified) now exercise parser recovery, native results, and the core runtime under sanitizers. Adversarial review found additional capture and lifetime gaps after the first green CI run; independent review and wider runtime coverage remain before this gate can close. |
|
|
9
|
+
| 0.x: portable native stack | Reproducible Linux and macOS web/crypto builds; build/run container images for full apps; platform-specific CI. | Versioned dependency manifests, license notices, native integration tests, and matching package builds on each target. |
|
|
10
|
+
| 0.x: developer distribution | Publish version-matched npm packages and VS Code extension; project bootstrap with `npx`; package compatibility and reproducible releases. | Clean installed-package tests, signed/versioned artifacts, release instructions, and supported upgrade path. |
|
|
11
|
+
| 1.0.0 | Freeze the supported language and package/native ABI; publish migration policy and production support matrix. | All preceding gates pass in CI, examples and specs regenerate deterministically, dependency audit and security review pass, and known gaps are classified explicitly. |
|
|
12
|
+
|
|
13
|
+
HTTP and OIDC hardening are library and application work. They are tracked in the [web and crypto gap ledger](web-library-gaps.md) and are not gates for the language's 1.0 release. The [compatibility policy](compatibility.md) identifies the proposed 1.x contract and platform evidence still required. The [production readiness page](production-readiness.md) explains current use and dependency obligations. Language performance is tracked with [reproducible benchmarks](performance.md), with regressions investigated before a stable release.
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Read the compiled specification
|
|
2
|
+
|
|
3
|
+
August keeps explanations beside the code. `aug spec` compiles each checked source file into a neighboring Markdown file. It describes the code without running the application or sending it to a model.
|
|
4
|
+
|
|
5
|
+
[See complete example projects](examples/index.md) with highlighted source in either indentation or braces style and the actual compiled spec for every file.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
aug spec .
|
|
9
|
+
aug spec . --check
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
| Source | Explanation |
|
|
13
|
+
| --- | --- |
|
|
14
|
+
| `main.aug` | `main.aug.md`: providers and startup operations. |
|
|
15
|
+
| `orders.aug` | `orders.aug.md`: contracts, local behavior, helpers, and tests. |
|
|
16
|
+
| `export.aug` | `export.aug.md`: the folder's public surface. |
|
|
17
|
+
| An installed dependency | A versioned explanation and source copy under `.aug-spec/`. |
|
|
18
|
+
|
|
19
|
+
Successful `build`, `run`, and `bench` commands refresh these documents after native compilation. `aug pack` refreshes them before creating the source archive. `--check` writes nothing and exits with a failure if a document, dependency copy, or manifest is missing or stale. Use it in CI after `aug check`.
|
|
20
|
+
|
|
21
|
+
## What the document explains
|
|
22
|
+
|
|
23
|
+
The compiler describes labeled inputs, injected dependencies, return values, state changes, capabilities, and checked failures. It follows each local branch, loop, match, recovery path, and cleanup block. It includes private helpers and same-file tests. For endpoints, it describes routes, wire inputs, policies, middleware ordering, and configured HTTP behavior.
|
|
24
|
+
|
|
25
|
+
For example, this complete program uses two source files:
|
|
26
|
+
|
|
27
|
+
```aug project=spec-guide file=main.aug
|
|
28
|
+
import total from prices
|
|
29
|
+
print(value=total(price=7, quantity=3))
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
```aug project=spec-guide file=prices.aug
|
|
33
|
+
total(int price, int quantity) returns int:
|
|
34
|
+
if quantity > 0:
|
|
35
|
+
return price * quantity
|
|
36
|
+
return 0
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Without any comments, the generated spec lists `total` near the top of the file, explains its two labeled inputs and `int` result, and then describes its behavior:
|
|
40
|
+
|
|
41
|
+
> - If `quantity` is greater than `0`:
|
|
42
|
+
> - Return `price` times `quantity`.
|
|
43
|
+
> - Return `0`.
|
|
44
|
+
|
|
45
|
+
The generated document preserves the actual branch structure and links to the full explanation of each used dependency. Javadoc, when present, appears after the generated behavior as **Author documentation**. It can explain intent that a compiler cannot infer, but readers do not need comments to follow the checked inputs, operations, and outcomes.
|
|
46
|
+
|
|
47
|
+
Optional contracts use `optional Type`. Specs describe two possible states: a value or null. Omitted inputs become null, so missing and explicit null follow the same branch. If an older program handles missing and null differently, combine those cases deliberately before using the syntax migration command.
|
|
48
|
+
|
|
49
|
+
## Dependencies stay small and navigable
|
|
50
|
+
|
|
51
|
+
Each file starts with a short map of its declarations and startup steps, then explains local behavior. A compact dependency section follows it. Each used operation shows its inputs, result, injected values, changes, capabilities, and failures, with a link to the complete explanation. Dependency implementation bodies belong in their own documents.
|
|
52
|
+
|
|
53
|
+
`import everything` stays valid. The spec lists the names and operations actually used by the file. Adding an unused export does not expand that list. VS Code hover still shows all names available from the import.
|
|
54
|
+
|
|
55
|
+
The compiler creates offline dependency documents from the installed source versions. Package paths include the package name and exact version; standard-library paths include the compiler version. Documents use relative links and include source links. Commit generated specs and `.aug-spec/` together when you want readers to follow those links without installing dependencies.
|
|
56
|
+
|
|
57
|
+
## Optional comments, checked when required
|
|
58
|
+
|
|
59
|
+
Javadoc is optional by default and is included when present. To require it:
|
|
60
|
+
|
|
61
|
+
```yaml
|
|
62
|
+
spec:
|
|
63
|
+
require_comments: public
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
| Value | Requirement |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `none` | Default. Include existing Javadoc. |
|
|
69
|
+
| `public` | Require Javadoc for public declarations and methods in this project. |
|
|
70
|
+
| `all` | Also require it for private declarations and methods. |
|
|
71
|
+
|
|
72
|
+
Implementation methods can inherit documentation from their interfaces. This setting governs your project; it does not require you to edit installed dependencies. Existing validation of `@param`, `@return`, and `@throws` tags still applies.
|
|
73
|
+
|
|
74
|
+
## Editor and package workflow
|
|
75
|
+
|
|
76
|
+
In VS Code, use **AugScript: Open Compiled Specification** to generate and preview the current file's document. Save sources first. **AugScript: Generate Specifications** generates the project's documents. Language diagnostics and migration actions use the same compiler as the CLI.
|
|
77
|
+
|
|
78
|
+
`aug pack` includes adjacent specs and their offline dependency documents in the archive. Consumers import August declarations normally; Markdown files do not change the package's public exports or execute code. See [packages](packages.md).
|
|
79
|
+
|
|
80
|
+
## Determinism and limits
|
|
81
|
+
|
|
82
|
+
Generation is offline and deterministic for the same checked sources, configuration, installed dependency versions, and compiler version. It adds no timestamps or machine paths. It uses fixed templates and the compiler's semantic information.
|
|
83
|
+
|
|
84
|
+
ASD-STE100 guides the wording. The output is best effort Simplified Technical English, without a claim of formal compliance. Native C boundaries are explained through their declared contracts and author documentation; the compiler does not infer a foreign implementation's internals. Shared numeric, ownership, and task rules link to the language reference.
|
|
85
|
+
|
|
86
|
+
The writer refuses to replace a handwritten neighboring `.aug.md` file. Rename that file before generation. Files marked as generated belong to the compiler; edit their August source or Javadoc and regenerate.
|