@greenpandastudios/aug-cli 0.20.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/docs/assets/benchmarks/execution.svg +774 -637
- package/docs/assets/benchmarks/http.svg +278 -249
- package/docs/assets/benchmarks/improvements.svg +66 -66
- package/docs/assets/benchmarks/kernels-mobile.svg +1 -0
- package/docs/assets/benchmarks/kernels.svg +1 -0
- package/docs/assets/benchmarks/memory.svg +153 -153
- package/docs/benchmark-results.json +227089 -90363
- package/docs/compatibility.md +6 -6
- package/docs/contributing-benchmarks.md +36 -6
- package/docs/dev-containers.md +8 -15
- package/docs/dgx-consumers.json +122 -0
- package/docs/dgx-gyms.json +784 -0
- package/docs/dgx-kernels.json +1170 -0
- package/docs/dgx-performance.json +227849 -0
- package/docs/dgx-spark.md +64 -0
- package/docs/diagnostics.md +1 -1
- package/docs/docker.md +16 -17
- package/docs/example-projects.json +32 -0
- package/docs/examples/approved-design/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/approved-design/domain/app.md +4 -4
- package/docs/examples/approved-design/main.md +2 -2
- package/docs/examples/calls-benchmark/index.md +36 -0
- package/docs/examples/calls-benchmark/main.md +78 -0
- package/docs/examples/calls-benchmark/operations.md +60 -0
- package/docs/examples/developer-workflow/calculator.md +5 -5
- package/docs/examples/developer-workflow/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/developer-workflow/logging/console.md +2 -2
- package/docs/examples/developer-workflow/logging/logger.md +2 -2
- package/docs/examples/developer-workflow/main.md +2 -2
- package/docs/examples/errors-benchmark/index.md +36 -0
- package/docs/examples/errors-benchmark/main.md +92 -0
- package/docs/examples/errors-benchmark/operations.md +65 -0
- package/docs/examples/float-benchmark/index.md +35 -0
- package/docs/examples/float-benchmark/main.md +75 -0
- package/docs/examples/generic-di/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/generic-di/main.md +2 -2
- package/docs/examples/generic-di/types.md +3 -3
- package/docs/examples/hello/app/greeter.md +3 -3
- package/docs/examples/hello/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/hello/logging/console.md +2 -2
- package/docs/examples/hello/logging/logger.md +2 -2
- package/docs/examples/hello/main.md +2 -2
- package/docs/examples/index.md +18 -1
- package/docs/examples/interceptors/app.md +5 -5
- package/docs/examples/interceptors/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/interceptors/interceptors.md +2 -2
- package/docs/examples/interceptors/logging.md +3 -3
- package/docs/examples/interceptors/main.md +2 -2
- package/docs/examples/list-benchmark/index.md +35 -0
- package/docs/examples/list-benchmark/main.md +78 -0
- package/docs/examples/map-churn-benchmark/index.md +35 -0
- package/docs/examples/map-churn-benchmark/main.md +106 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/api.md +104 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.md +54 -0
- package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi-json.md +48 -0
- package/docs/examples/native-blake3/hashing.md +93 -0
- package/docs/examples/native-blake3/index.md +38 -0
- package/docs/examples/native-blake3/main.md +73 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/api.md +406 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.md +51 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.md +63 -0
- package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi-json.md +161 -0
- package/docs/examples/native-pytorch/index.md +38 -0
- package/docs/examples/native-pytorch/main.md +73 -0
- package/docs/examples/native-pytorch/tensors.md +123 -0
- package/docs/examples/native-sqlite/database.md +116 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/api.md +284 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.md +51 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.md +75 -0
- package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi-json.md +119 -0
- package/docs/examples/native-sqlite/index.md +38 -0
- package/docs/examples/native-sqlite/main.md +73 -0
- package/docs/examples/native-zlib/compression.md +99 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/api.md +153 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.md +54 -0
- package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi-json.md +76 -0
- package/docs/examples/native-zlib/index.md +38 -0
- package/docs/examples/native-zlib/main.md +78 -0
- package/docs/examples/new-syntax/console.md +2 -2
- package/docs/examples/new-syntax/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/new-syntax/greeter.md +3 -3
- package/docs/examples/new-syntax/logger.md +2 -2
- package/docs/examples/new-syntax/main.md +2 -2
- package/docs/examples/ownership-transfer/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
- package/docs/examples/ownership-transfer/main.md +2 -2
- package/docs/examples/ownership-transfer/resource.md +2 -2
- package/docs/examples/packages-math/aug-package-json.md +1 -1
- package/docs/examples/records-benchmark/data.md +55 -0
- package/docs/examples/records-benchmark/index.md +36 -0
- package/docs/examples/records-benchmark/main.md +85 -0
- package/docs/examples/strings-benchmark/index.md +35 -0
- package/docs/examples/strings-benchmark/main.md +76 -0
- package/docs/examples/tasks-benchmark/index.md +36 -0
- package/docs/examples/tasks-benchmark/main.md +89 -0
- package/docs/examples/tasks-benchmark/operations.md +58 -0
- package/docs/getting-started.md +3 -3
- package/docs/grammar.md +2 -2
- package/docs/gym-results.json +784 -0
- package/docs/implementation-map.md +6 -0
- package/docs/index.md +1 -1
- package/docs/kernel-results.json +1170 -0
- package/docs/language-conformance.md +6 -0
- package/docs/language-constructs.md +9 -1
- package/docs/learn/index.md +1 -1
- package/docs/maintaining-docs.md +1 -1
- package/docs/native-implementation.md +276 -0
- package/docs/native-interop-llvm-plan.md +342 -0
- package/docs/native-package-examples.md +684 -0
- package/docs/native-packages.md +179 -0
- package/docs/packages.md +2 -2
- package/docs/performance.md +50 -29
- package/docs/production-readiness.md +11 -1
- package/docs/public/downloads/approved-design.zip +0 -0
- package/docs/public/downloads/calls-benchmark.zip +0 -0
- package/docs/public/downloads/developer-workflow.zip +0 -0
- package/docs/public/downloads/errors-benchmark.zip +0 -0
- package/docs/public/downloads/float-benchmark.zip +0 -0
- package/docs/public/downloads/generic-di.zip +0 -0
- package/docs/public/downloads/hello.zip +0 -0
- package/docs/public/downloads/interceptors.zip +0 -0
- package/docs/public/downloads/json-benchmark.zip +0 -0
- package/docs/public/downloads/list-benchmark.zip +0 -0
- package/docs/public/downloads/map-churn-benchmark.zip +0 -0
- package/docs/public/downloads/native-blake3.zip +0 -0
- package/docs/public/downloads/native-pytorch.zip +0 -0
- package/docs/public/downloads/native-sqlite.zip +0 -0
- package/docs/public/downloads/native-zlib.zip +0 -0
- package/docs/public/downloads/new-syntax.zip +0 -0
- package/docs/public/downloads/oidc-login.zip +0 -0
- package/docs/public/downloads/ownership-transfer.zip +0 -0
- package/docs/public/downloads/packages-app.zip +0 -0
- package/docs/public/downloads/packages-math.zip +0 -0
- package/docs/public/downloads/records-benchmark.zip +0 -0
- package/docs/public/downloads/strings-benchmark.zip +0 -0
- package/docs/public/downloads/tasks-benchmark.zip +0 -0
- package/docs/qualification-results.md +66 -0
- package/docs/reference.md +24 -0
- package/docs/releasing.md +81 -6
- package/docs/research/libtorch-native-qualification.md +115 -0
- package/docs/research/native-interop-llvm.md +197 -0
- package/docs/research/qualification-methods.md +15 -0
- package/docs/roadmap.md +1 -0
- package/docs/safety-gyms.md +41 -0
- package/docs/tooling.md +16 -15
- package/docs/web-library-gaps.md +1 -1
- package/docs/web.md +4 -0
- package/examples/approved-design/.aug-spec/manifest.json +3 -3
- package/examples/approved-design/domain/app.aug.md +4 -4
- package/examples/approved-design/main.aug.md +2 -2
- package/examples/developer-workflow/.aug-spec/manifest.json +3 -3
- package/examples/developer-workflow/calculator.aug.md +5 -5
- package/examples/developer-workflow/logging/console.aug.md +2 -2
- package/examples/developer-workflow/logging/logger.aug.md +2 -2
- package/examples/developer-workflow/main.aug.md +2 -2
- package/examples/generic-di/.aug-spec/manifest.json +3 -3
- package/examples/generic-di/main.aug.md +2 -2
- package/examples/generic-di/types.aug.md +3 -3
- package/examples/hello/.aug-spec/manifest.json +3 -3
- package/examples/hello/app/greeter.aug.md +3 -3
- package/examples/hello/logging/console.aug.md +2 -2
- package/examples/hello/logging/logger.aug.md +2 -2
- package/examples/hello/main.aug.md +2 -2
- package/examples/interceptors/.aug-spec/manifest.json +3 -3
- package/examples/interceptors/app.aug.md +5 -5
- package/examples/interceptors/interceptors.aug.md +2 -2
- package/examples/interceptors/logging.aug.md +3 -3
- package/examples/interceptors/main.aug.md +2 -2
- package/examples/native-blake3/.aug-spec/manifest.json +16 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.1/native.abi.json +29 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug +14 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug.md +34 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug +4 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug.md +8 -0
- package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi.json +29 -0
- package/examples/native-blake3/AGENTS.md +5 -0
- package/examples/native-blake3/aug.lock.json +253 -0
- package/examples/native-blake3/hashing.aug +11 -0
- package/examples/native-blake3/hashing.aug.md +25 -0
- package/examples/native-blake3/main.aug +8 -0
- package/examples/native-blake3/main.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/manifest.json +18 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.1/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.3/native.abi.json +142 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug +101 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug.md +160 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug +3 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md +8 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug +6 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md +13 -0
- package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi.json +142 -0
- package/examples/native-pytorch/AGENTS.md +5 -0
- package/examples/native-pytorch/aug.lock.json +309 -0
- package/examples/native-pytorch/main.aug +8 -0
- package/examples/native-pytorch/main.aug.md +13 -0
- package/examples/native-pytorch/tensors.aug +23 -0
- package/examples/native-pytorch/tensors.aug.md +35 -0
- package/examples/native-sqlite/.aug-spec/manifest.json +18 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.2/native.abi.json +100 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug +48 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug.md +91 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug +3 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug.md +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug +8 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug.md +22 -0
- package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi.json +100 -0
- package/examples/native-sqlite/AGENTS.md +5 -0
- package/examples/native-sqlite/aug.lock.json +236 -0
- package/examples/native-sqlite/database.aug +15 -0
- package/examples/native-sqlite/database.aug.md +27 -0
- package/examples/native-sqlite/main.aug +8 -0
- package/examples/native-sqlite/main.aug.md +13 -0
- package/examples/native-zlib/.aug-spec/manifest.json +16 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.1/native.abi.json +57 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug +29 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug.md +54 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug +4 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug.md +8 -0
- package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi.json +57 -0
- package/examples/native-zlib/AGENTS.md +5 -0
- package/examples/native-zlib/aug.lock.json +236 -0
- package/examples/native-zlib/compression.aug +15 -0
- package/examples/native-zlib/compression.aug.md +27 -0
- package/examples/native-zlib/main.aug +10 -0
- package/examples/native-zlib/main.aug.md +13 -0
- package/examples/new-syntax/.aug-spec/manifest.json +3 -3
- package/examples/new-syntax/console.aug.md +2 -2
- package/examples/new-syntax/greeter.aug.md +3 -3
- package/examples/new-syntax/logger.aug.md +2 -2
- package/examples/new-syntax/main.aug.md +2 -2
- package/examples/oidc-login/aug.lock.json +6 -6
- package/examples/ownership-transfer/.aug-spec/manifest.json +3 -3
- package/examples/ownership-transfer/main.aug.md +2 -2
- package/examples/ownership-transfer/resource.aug.md +2 -2
- package/examples/packages/math/aug-package.json +1 -1
- package/native/compiler-packs.json +43 -0
- package/package.json +3 -2
- package/runtime/aug_http.c +48 -21
- package/runtime/aug_http_ir.c +30 -0
- package/runtime/aug_http_ir.h +18 -0
- package/runtime/aug_ir.c +209 -0
- package/runtime/aug_ir.h +89 -0
- package/runtime/aug_json.c +6 -1
- package/runtime/aug_runtime.c +82 -16
- package/runtime/aug_runtime.h +16 -2
- package/runtime/aug_tasks.c +38 -7
- package/runtime/aug_values.c +12 -6
- package/scripts/bootstrap-native.mjs +4 -1
- package/src/ast.js +1 -1
- package/src/checker.js +110 -28
- package/src/cli.js +92 -14
- package/src/codegen.js +31 -6
- package/src/compiler-packs.js +66 -0
- package/src/config.js +2 -2
- package/src/editor.js +15 -6
- package/src/formatter.js +4 -2
- package/src/git-http.js +137 -0
- package/src/git-packages.js +9 -1
- package/src/help.js +10 -2
- package/src/ir-types.js +5 -0
- package/src/ir-verify.js +277 -0
- package/src/ir.js +962 -0
- package/src/llvm-debug.js +101 -0
- package/src/llvm-native.js +152 -0
- package/src/llvm-platform.js +20 -0
- package/src/llvm.js +781 -0
- package/src/native-artifacts.js +207 -0
- package/src/native-bindings.js +189 -0
- package/src/native-contracts.js +295 -0
- package/src/native-declarations.js +68 -0
- package/src/native-facts.js +63 -0
- package/src/package-locking.js +43 -0
- package/src/package-manager.js +23 -8
- package/src/parser.js +20 -2
- package/src/project.js +2 -2
- package/src/runtime-abi.js +23 -0
- package/src/runtime-adapters.js +18 -0
- package/src/schemas.js +24 -17
- package/src/semantic.js +8 -3
- package/src/snippets.js +1 -0
- package/src/spec.js +49 -8
- /package/examples/approved-design/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/approved-design/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/developer-workflow/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/developer-workflow/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/generic-di/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/generic-di/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/hello/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/hello/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/interceptors/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/interceptors/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/new-syntax/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/new-syntax/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
- /package/examples/ownership-transfer/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
- /package/examples/ownership-transfer/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# August on DGX Spark
|
|
2
|
+
|
|
3
|
+
August's LLVM compiler built and ran on a physical DGX Spark on October 2, 2026. It passed the language regression suite, safety gyms, and installed-CLI checks for all four public native libraries. These are CPU results. They do not qualify GPU execution or the rest of PyTorch's API.
|
|
4
|
+
|
|
5
|
+
## Machine and measurement
|
|
6
|
+
|
|
7
|
+
The host ran Ubuntu 24.04.4 LTS, Linux 6.17.0-1021-nvidia, on a 20-core ARM64 CPU with Cortex-X925 and Cortex-A725 cores. Builds used August's Debian 12 maintainer container: glibc 2.36, Node 24.21.0, LLVM 23.1.2, and Debian Clang 14.0.6 for the independent C references. The container ran directly on the Spark's ARM64 CPU.
|
|
8
|
+
|
|
9
|
+
Timed runs were restricted to four performance cores, CPUs 5–8. Frequency and other host activity were not fixed. Each sample started a fresh executable; timings include process startup and exclude compilation. Implementation order rotated in a separate measurement process, and every output was checked. Both August and C used O2 without LTO or fast-math. Compare implementations within a row; do not treat these numbers as a comparison of Spark and the [Mac results](qualification-results.md).
|
|
10
|
+
|
|
11
|
+
The raw reports say `unknown` for the CPU model because Node did not expose its name in the container. The hardware description above comes from the host's `lscpu` inventory. The reports are preserved as recorded.
|
|
12
|
+
|
|
13
|
+
## Core workloads
|
|
14
|
+
|
|
15
|
+
These medians use 60 samples after three warmups. [The full report](dgx-performance.json) includes all samples, peak memory, build times, Node and Python comparisons, and the C migration backend. The [performance guide](performance.md) explains the programs and their comparison limits.
|
|
16
|
+
|
|
17
|
+
| Program | Work per run | August LLVM | C | August / C |
|
|
18
|
+
| --- | ---: | ---: | ---: | ---: |
|
|
19
|
+
| Startup | Print one integer | 1.33 ms | 0.92 ms | 1.44 |
|
|
20
|
+
| Integer loop | 2,000,000 steps | 7.77 ms | 7.51 ms | 1.04 |
|
|
21
|
+
| Map and Set | 20,000 entries | 4.24 ms | 3.70 ms | 1.15 |
|
|
22
|
+
| Map and Set | 200,000 entries | 63.48 ms | 22.47 ms | 2.83 |
|
|
23
|
+
| JSON | 5,000 records | 7.19 ms | 1.60 ms | 4.49 |
|
|
24
|
+
|
|
25
|
+
The larger collection case and JSON still have substantial overhead. The JSON C reference parses and writes data without constructing August records. A passing migration gate means LLVM stayed within the frozen limits against the same August program compiled through C; it does not mean every program matches a specialized C implementation.
|
|
26
|
+
|
|
27
|
+
## Eight application kernels
|
|
28
|
+
|
|
29
|
+
These medians use 30 samples after three warmups. Each linked project shows the complete August code beside its compiled explanation, with an indentation/braces switch. [Raw samples and expected results](dgx-kernels.json) retain the C migration comparison too.
|
|
30
|
+
|
|
31
|
+
| Program and code/spec | Work per run | August LLVM | C | August / C |
|
|
32
|
+
| --- | ---: | ---: | ---: | ---: |
|
|
33
|
+
| [Floating-point loop](examples/float-benchmark/main.md) | 1,000,000 | 2.15 ms | 1.57 ms | 1.37 |
|
|
34
|
+
| [Labeled calls](examples/calls-benchmark/main.md) | 200,000 | 2.50 ms | 1.58 ms | 1.59 |
|
|
35
|
+
| [List traversal](examples/list-benchmark/main.md) | 100,000 | 3.62 ms | 1.96 ms | 1.84 |
|
|
36
|
+
| [String processing](examples/strings-benchmark/main.md) | 20,000 | 8.29 ms | 2.07 ms | 4.00 |
|
|
37
|
+
| [Map deletion and refill](examples/map-churn-benchmark/main.md) | 4,000 | 5.31 ms | 4.47 ms | 1.19 |
|
|
38
|
+
| [Checked failures](examples/errors-benchmark/main.md) | 20,000 | 1.04 ms | 0.72 ms | 1.43 |
|
|
39
|
+
| [Record allocation](examples/records-benchmark/main.md) | 50,000 | 22.60 ms | 3.09 ms | 7.32 |
|
|
40
|
+
| [Task scheduling](examples/tasks-benchmark/main.md) | 2,000 | 8.23 ms | 1.30 ms | 6.32 |
|
|
41
|
+
|
|
42
|
+
The [C references](https://github.com/GreenPandaStudios/augscript/blob/e3c072be276e9801d348690435c08c4b146fd352/benchmarks/kernels.c) use concrete representations and explicit cleanup. The ordered map uses linear search. The task reference calls functions sequentially; it does not implement August's scheduler or cancellation rules. Managed strings, records and tasks remain useful targets for further optimization. The benchmark checks their behavior rather than removing that behavior to improve a number.
|
|
43
|
+
|
|
44
|
+
## HTTP throughput
|
|
45
|
+
|
|
46
|
+
Each median covers five fresh server runs with 5,000 validated requests per run, after warmup. The load is HTTP/1.1 loopback with keep-alive, fixed concurrency and no TLS, authentication or logging. It measures this endpoint and client together, not a server's maximum capacity. There is no standalone C HTTP implementation in this comparison.
|
|
47
|
+
|
|
48
|
+
| Concurrent clients | August LLVM | August C backend | Node |
|
|
49
|
+
| --- | ---: | ---: | ---: |
|
|
50
|
+
| 1 | 18,441 requests/s | 16,157 requests/s | 17,271 requests/s |
|
|
51
|
+
| 16 | 37,864 requests/s | 38,866 requests/s | 34,749 requests/s |
|
|
52
|
+
| 64 | 35,395 requests/s | 36,414 requests/s | 31,815 requests/s |
|
|
53
|
+
|
|
54
|
+
## Safety and real imports
|
|
55
|
+
|
|
56
|
+
All **266 LLVM parity tests** passed with no skips, including source breakpoints and debugger variable inspection. The full [safety gym report](dgx-gyms.json) passed 3,612 generated and edge-case checks in development and optimized builds, rejected eight forbidden contracts, and detected all 14 valid behavioral mutations. All six additional circuits passed with no skipped tests: source mutations, ownership/concurrency, native boundaries, package integrity, HTTP boundaries and sanitizers.
|
|
57
|
+
|
|
58
|
+
The [installed-CLI report](dgx-consumers.json) records public URL imports and named aliases for CPU LibTorch `v0.1.4`, SQLite `v0.1.3`, zlib `v0.1.3`, and Rust BLAKE3 `v0.1.3`. The real libraries produced the expected tensor sum, database query, compression round trip and hash. Frozen/offline restores, relocated deployments, same-file tests, resource cleanup counters, tasks, JSON, clocks, crypto and HTTP forms passed too. The test processes had no native developer tools on their search path; the unpublished compiler archive was supplied locally. The separate clean-container CI checks remove compilers, Git and development headers from the consumer filesystem.
|
|
59
|
+
|
|
60
|
+
These finite tests do not prove arbitrary foreign code safe. Core sanitizers do not instrument the interiors of prebuilt libraries, and the coroutine gate does not establish whole-process leak freedom. Read the [gym limits](safety-gyms.md) before interpreting a pass.
|
|
61
|
+
|
|
62
|
+
## Revision
|
|
63
|
+
|
|
64
|
+
This run used commit [`e3c072b`](https://github.com/GreenPandaStudios/augscript/commit/e3c072be276e9801d348690435c08c4b146fd352). All three benchmark/gym reports carry source SHA-256 `d6afc98df62d8a40990cf4032cf01595e8c353bf7419d44ddfefa7c479681a79`, which includes the platform's prepared compiler-pack metadata. The results apply to that recorded snapshot. [Contributor instructions](contributing-benchmarks.md) explain how to produce new evidence after a change.
|
package/docs/diagnostics.md
CHANGED
|
@@ -4,7 +4,7 @@ Start with the diagnostic's file, line, and message. The code identifies the rul
|
|
|
4
4
|
|
|
5
5
|
Terminal diagnostics include the source line, a pointer to the location, and a `help:` explanation. `aug check --json` preserves structured diagnostics for tooling. Fix the first dependency or configuration error before investigating follow-on name errors.
|
|
6
6
|
|
|
7
|
-
If `aug run` cannot prepare or start a program, its message identifies the failed stage. A missing
|
|
7
|
+
If `aug run` cannot prepare or start a program, its message identifies the failed stage. A missing or incompatible artifact names the required platform and version. A failed download identifies the library and URL; retry after checking the connection. An offline cache miss explains how to prepare it online. C reference builds report missing host tools separately. Changed installed source packages require an explicit `aug install` so a run does not hide unexpected edits. A program stopped by a signal reports that signal after its own runtime output.
|
|
8
8
|
|
|
9
9
|
When a fix changes a dependency, effect, error, or mutable input, review the caller's contract too. A suggested edit can satisfy a language rule without deciding the right recovery or design for your application. [The book](learn/index.md) includes deliberate mistakes you can check and repair yourself.
|
|
10
10
|
|
package/docs/docker.md
CHANGED
|
@@ -4,36 +4,30 @@ Compile an August application in a Linux build container, then deploy its execut
|
|
|
4
4
|
|
|
5
5
|
## Prepare the toolchain images
|
|
6
6
|
|
|
7
|
-
Build two local images
|
|
7
|
+
Build two local images. The build image contains Node.js 24 and the August CLI; `aug build` downloads its verified LLVM/runtime pack and package artifacts. The run image supplies Debian's runtime and CA certificates. It runs the executable and its neighboring libraries as an unprivileged user. These are local recipes; August does not publish registry tags for them. They target the pending 0.21.0 release.
|
|
8
8
|
|
|
9
|
-
Save this as `Dockerfile.build` in an empty working folder.
|
|
9
|
+
Save this as `Dockerfile.build` in an empty working folder. Pin `AUG_VERSION` to the version used by your application:
|
|
10
10
|
|
|
11
11
|
```dockerfile
|
|
12
12
|
FROM node:24-bookworm
|
|
13
|
-
ARG AUG_VERSION=0.
|
|
14
|
-
ENV AUG_NATIVE_HOME=/opt/augscript/.aug-native
|
|
13
|
+
ARG AUG_VERSION=0.21.0
|
|
15
14
|
RUN apt-get update \
|
|
16
|
-
&& apt-get install -y --no-install-recommends \
|
|
17
|
-
git clang libclang-rt-14-dev make cmake m4 autoconf \
|
|
18
|
-
automake libtool python3 zlib1g-dev ca-certificates \
|
|
15
|
+
&& apt-get install -y --no-install-recommends ca-certificates \
|
|
19
16
|
&& rm -rf /var/lib/apt/lists/*
|
|
20
17
|
RUN npm install --global --ignore-scripts --no-audit --no-fund \
|
|
21
|
-
@greenpandastudios/aug-cli@${AUG_VERSION}
|
|
22
|
-
&& aug-native
|
|
18
|
+
@greenpandastudios/aug-cli@${AUG_VERSION}
|
|
23
19
|
WORKDIR /workspace
|
|
24
20
|
ENTRYPOINT ["aug"]
|
|
25
21
|
CMD ["--help"]
|
|
26
22
|
```
|
|
27
23
|
|
|
28
|
-
Save this as `Dockerfile.run` beside it.
|
|
24
|
+
Save this as `Dockerfile.run` beside it. Each application supplies its own `lib` and `share` directories beside the executable:
|
|
29
25
|
|
|
30
26
|
```dockerfile
|
|
31
|
-
FROM augscript/build:local AS native
|
|
32
27
|
FROM debian:bookworm-slim
|
|
33
28
|
RUN apt-get update \
|
|
34
29
|
&& apt-get install -y --no-install-recommends ca-certificates zlib1g \
|
|
35
30
|
&& rm -rf /var/lib/apt/lists/*
|
|
36
|
-
COPY --from=native /opt/augscript/.aug-native/prefix/lib /opt/augscript/.aug-native/prefix/lib
|
|
37
31
|
RUN groupadd --system august \
|
|
38
32
|
&& useradd --system --gid august --home-dir /app august
|
|
39
33
|
WORKDIR /app
|
|
@@ -48,7 +42,7 @@ docker build -f Dockerfile.build -t augscript/build:local .
|
|
|
48
42
|
docker build -f Dockerfile.run -t augscript/run:local .
|
|
49
43
|
```
|
|
50
44
|
|
|
51
|
-
The first build downloads and
|
|
45
|
+
The first application build downloads the compiler and required artifacts; later builds reuse their verified cache. Keep these local images on the same Docker engine that builds your application.
|
|
52
46
|
|
|
53
47
|
## Compile an existing project
|
|
54
48
|
|
|
@@ -59,11 +53,15 @@ Keep the project in a directory shared with your Docker engine. If Docker report
|
|
|
59
53
|
```sh
|
|
60
54
|
docker run --rm \
|
|
61
55
|
--user "$(id -u):$(id -g)" \
|
|
56
|
+
--env AUG_NATIVE_ARTIFACT_CACHE=/workspace/.aug-build/artifact-cache \
|
|
57
|
+
--env AUG_PACKAGE_CACHE=/workspace/.aug-build/source-cache \
|
|
62
58
|
--mount type=bind,source="$PWD/my-app",target=/workspace \
|
|
63
59
|
augscript/build:local install .
|
|
64
60
|
|
|
65
61
|
docker run --rm \
|
|
66
62
|
--user "$(id -u):$(id -g)" \
|
|
63
|
+
--env AUG_NATIVE_ARTIFACT_CACHE=/workspace/.aug-build/artifact-cache \
|
|
64
|
+
--env AUG_PACKAGE_CACHE=/workspace/.aug-build/source-cache \
|
|
67
65
|
--mount type=bind,source="$PWD/my-app",target=/workspace \
|
|
68
66
|
augscript/build:local build . --out /workspace/.aug-build/program
|
|
69
67
|
```
|
|
@@ -76,7 +74,7 @@ docker run --rm \
|
|
|
76
74
|
augscript/run:local
|
|
77
75
|
```
|
|
78
76
|
|
|
79
|
-
The
|
|
77
|
+
The cache path is inside the writable project mount so it belongs to your host user. The images use the same Debian distribution. The executable loads libraries from its neighboring `lib` directory; keep `share` for dependency notices and source provenance. A Linux executable built here runs inside the runtime container, including when your host is macOS or Windows.
|
|
80
78
|
|
|
81
79
|
## Deploy an HTTP application
|
|
82
80
|
|
|
@@ -129,10 +127,11 @@ Save this `Dockerfile` in `my-api`. Docker's [multi-stage build](https://docs.do
|
|
|
129
127
|
```dockerfile
|
|
130
128
|
FROM augscript/build:local AS build
|
|
131
129
|
COPY . /workspace
|
|
132
|
-
RUN aug
|
|
133
|
-
&& aug
|
|
130
|
+
RUN aug install /workspace \
|
|
131
|
+
&& aug test /workspace \
|
|
132
|
+
&& aug build /workspace --out /tmp/deploy/program
|
|
134
133
|
FROM augscript/run:local
|
|
135
|
-
COPY --from=build --chown=august:august /tmp/
|
|
134
|
+
COPY --from=build --chown=august:august /tmp/deploy/ /app/
|
|
136
135
|
```
|
|
137
136
|
|
|
138
137
|
Save `.dockerignore` in the same folder:
|
|
@@ -1,4 +1,28 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"path": "examples/native-pytorch",
|
|
4
|
+
"title": "CPU tensors with PyTorch",
|
|
5
|
+
"group": "Native libraries (LLVM preview)",
|
|
6
|
+
"description": "Import real LibTorch from its public August package, add CPU tensors, and verify the elements and sum. Owned tensors are released when their scope ends."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"path": "examples/native-sqlite",
|
|
10
|
+
"title": "A database with SQLite",
|
|
11
|
+
"group": "Native libraries (LLVM preview)",
|
|
12
|
+
"description": "Create an in-memory database, insert a labeled bound value, and query it through the real SQLite implementation. Mutation requires a borrow; scope exit closes the database."
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"path": "examples/native-zlib",
|
|
16
|
+
"title": "Compression with zlib",
|
|
17
|
+
"group": "Native libraries (LLVM preview)",
|
|
18
|
+
"description": "Compress a buffer with zlib and verify the restored bytes. A fixed output limit bounds decompression."
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"path": "examples/native-blake3",
|
|
22
|
+
"title": "Hashing with Rust BLAKE3",
|
|
23
|
+
"group": "Native libraries (LLVM preview)",
|
|
24
|
+
"description": "Import a Rust implementation through an ordinary August package and verify a published BLAKE3 hash vector."
|
|
25
|
+
},
|
|
2
26
|
{
|
|
3
27
|
"path": "examples/hello",
|
|
4
28
|
"title": "Hello world with dependencies",
|
|
@@ -181,6 +205,14 @@
|
|
|
181
205
|
"group": "Measured programs",
|
|
182
206
|
"description": "The small program used to measure process startup."
|
|
183
207
|
},
|
|
208
|
+
{"path":"benchmarks/float","title":"Floating-point benchmark","group":"Measured programs","description":"Accumulate exact binary fractions and check the final value."},
|
|
209
|
+
{"path":"benchmarks/calls","title":"Function-call benchmark","group":"Measured programs","description":"Call a labeled function repeatedly with a dependent integer result."},
|
|
210
|
+
{"path":"benchmarks/list","title":"List traversal benchmark","group":"Measured programs","description":"Grow a list and sum its snapshot values."},
|
|
211
|
+
{"path":"benchmarks/strings","title":"String processing benchmark","group":"Measured programs","description":"Split text into parts and sum their byte lengths."},
|
|
212
|
+
{"path":"benchmarks/map-churn","title":"Map deletion benchmark","group":"Measured programs","description":"Delete, replace and reinsert entries, then check values and insertion order."},
|
|
213
|
+
{"path":"benchmarks/errors","title":"Checked-error benchmark","group":"Measured programs","description":"Interleave successful calls and caught checked failures."},
|
|
214
|
+
{"path":"benchmarks/records","title":"Record allocation benchmark","group":"Measured programs","description":"Retain immutable records and sum their fields."},
|
|
215
|
+
{"path":"benchmarks/tasks","title":"Task scheduling benchmark","group":"Measured programs","description":"Start and join two tasks in each bounded scope."},
|
|
184
216
|
{
|
|
185
217
|
"path": "benchmarks/cpu",
|
|
186
218
|
"title": "CPU benchmark",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "august/0.
|
|
2
|
+
title: "august/0.21.0/io/contracts.aug · Modules and composition"
|
|
3
3
|
generated: true
|
|
4
|
-
source: "examples/approved-design/.aug-spec/august/0.
|
|
4
|
+
source: "examples/approved-design/.aug-spec/august/0.21.0/io/contracts.aug"
|
|
5
5
|
editLink: false
|
|
6
6
|
prev: false
|
|
7
7
|
next: false
|
|
@@ -10,7 +10,7 @@ search: false
|
|
|
10
10
|
pageClass: aug-example-page
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
# `august/0.
|
|
13
|
+
# `august/0.21.0/io/contracts.aug`
|
|
14
14
|
|
|
15
15
|
[Modules and composition](../../../../index.md) · Dependency source and specification
|
|
16
16
|
|
|
@@ -82,19 +82,19 @@ The application's explicit startup operation.
|
|
|
82
82
|
|
|
83
83
|
#### `Application.start` · [source](app.md#code) {#symbol-Application.start}
|
|
84
84
|
|
|
85
|
-
Writes the fruit names through the selected console. It can call [`Console.write`](../dependencies/august/0.
|
|
85
|
+
Writes the fruit names through the selected console. It can call [`Console.write`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console.write).
|
|
86
86
|
|
|
87
87
|
### `ApplicationImpl` · class · [source](app.md#code) {#symbol-ApplicationImpl}
|
|
88
88
|
|
|
89
|
-
Construction stores dependencies; start performs the visible external work. It implements [`Application`](app.md#symbol-Application). The `console` dependency is injected as [`Console`](../dependencies/august/0.
|
|
89
|
+
Construction stores dependencies; start performs the visible external work. It implements [`Application`](app.md#symbol-Application). The `console` dependency is injected as [`Console`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console) and stored read-only.
|
|
90
90
|
|
|
91
91
|
#### `ApplicationImpl.start` · [source](app.md#code) {#symbol-ApplicationImpl.start}
|
|
92
92
|
|
|
93
|
-
Writes the fruit names through the selected console. It sets `fruit` to a list containing a [`Fruit`](models.md#symbol-Fruit) with `code` `1` and `name` `"apple"`, a [`Fruit`](models.md#symbol-Fruit) with `name` `"pear"` and `code` `2`. For each `item` in a snapshot of `fruit`, it passes `item.name` to [`console.write`](../dependencies/august/0.
|
|
93
|
+
Writes the fruit names through the selected console. It sets `fruit` to a list containing a [`Fruit`](models.md#symbol-Fruit) with `code` `1` and `name` `"apple"`, a [`Fruit`](models.md#symbol-Fruit) with `name` `"pear"` and `code` `2`. For each `item` in a snapshot of `fruit`, it passes `item.name` to [`console.write`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console.write).
|
|
94
94
|
|
|
95
95
|
### Dependencies
|
|
96
96
|
|
|
97
|
-
It uses [`Console`](../dependencies/august/0.
|
|
97
|
+
It uses [`Console`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console) ([`write`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console.write)) from `august.io`. It uses [`Fruit`](models.md#symbol-Fruit) (`name`) from `models`.
|
|
98
98
|
|
|
99
99
|
::::
|
|
100
100
|
|
|
@@ -113,7 +113,7 @@ catch RangeError error {
|
|
|
113
113
|
|
|
114
114
|
### Providers
|
|
115
115
|
|
|
116
|
-
`Console` is provided by [`SystemConsole`](dependencies/august/0.
|
|
116
|
+
`Console` is provided by [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole). The same instance is shared.
|
|
117
117
|
|
|
118
118
|
`Application` is provided by [`ApplicationImpl`](domain/app.md#symbol-ApplicationImpl). The same instance is shared. It requires bindings for `Console`. Include providers from [`Counters`](counters.md#symbol-Counters).
|
|
119
119
|
|
|
@@ -129,7 +129,7 @@ It calls [`double`](domain/numbers.md#symbol-double) with `amount` `-1`. If this
|
|
|
129
129
|
|
|
130
130
|
### Dependencies
|
|
131
131
|
|
|
132
|
-
It uses [`SystemConsole`](dependencies/august/0.
|
|
132
|
+
It uses [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole) from `august.io`. It uses [`Counter`](counters.md#symbol-Counter) ([`increment`](counters.md#symbol-Counter.increment) and [`value`](counters.md#symbol-Counter.value)) and [`Counters`](counters.md#symbol-Counters) from `counters`. It uses [`Application`](domain/app.md#symbol-Application) ([`start`](domain/app.md#symbol-Application.start)), [`ApplicationImpl`](domain/app.md#symbol-ApplicationImpl), [`Fruit`](domain/models.md#symbol-Fruit), [`RangeError`](domain/numbers.md#symbol-RangeError), and [`double`](domain/numbers.md#symbol-double) from `domain`.
|
|
133
133
|
|
|
134
134
|
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
135
135
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Function-call benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/calls"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Function-call benchmark
|
|
12
|
+
|
|
13
|
+
Call a labeled function repeatedly with a dependent integer result.
|
|
14
|
+
|
|
15
|
+
Open a file to read its source beside the explanation produced by `aug spec`. **Indentation** and **Braces** display the same checked program; your choice carries across file pages.
|
|
16
|
+
|
|
17
|
+
## Project files
|
|
18
|
+
|
|
19
|
+
- [`main.aug`](main.md)
|
|
20
|
+
- [`operations.aug`](operations.md)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Try this project
|
|
24
|
+
|
|
25
|
+
[Download this project](/downloads/calls-benchmark.zip), then extract the archive in an empty working folder. It contains the checked source, configuration, and generated specs. [Install August](../../getting-started.md) once, then run these commands. Native libraries are prepared automatically when needed:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
cd calls-benchmark
|
|
29
|
+
aug check .
|
|
30
|
+
aug spec .
|
|
31
|
+
aug run .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
See [the performance page](../../performance.md) for measurements, input sizes, and reproduction steps.
|
|
35
|
+
|
|
36
|
+
[Browse all examples](../index.md)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "main.aug · Function-call benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/calls/main.aug"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
pageClass: aug-example-page
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# `main.aug`
|
|
13
|
+
|
|
14
|
+
[Function-call benchmark](index.md) · Source and specification
|
|
15
|
+
|
|
16
|
+
::: details Files in this project
|
|
17
|
+
|
|
18
|
+
- [`main.aug`](main.md)
|
|
19
|
+
- [`operations.aug`](operations.md)
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
23
|
+
::::: example-compare
|
|
24
|
+
|
|
25
|
+
:::: example-code
|
|
26
|
+
|
|
27
|
+
## Code {#code}
|
|
28
|
+
|
|
29
|
+
::: code-group
|
|
30
|
+
|
|
31
|
+
```aug [Indentation]
|
|
32
|
+
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
33
|
+
import step from operations
|
|
34
|
+
int iterations = 200000
|
|
35
|
+
int state = 123
|
|
36
|
+
int index = 0
|
|
37
|
+
while index < iterations:
|
|
38
|
+
state = step(value=state)
|
|
39
|
+
index = index + 1
|
|
40
|
+
print(value=state)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```aug [Braces]
|
|
44
|
+
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
45
|
+
import step from operations
|
|
46
|
+
int iterations = 200000
|
|
47
|
+
int state = 123
|
|
48
|
+
int index = 0
|
|
49
|
+
while index < iterations {
|
|
50
|
+
state = step(value=state)
|
|
51
|
+
index = index + 1
|
|
52
|
+
}
|
|
53
|
+
print(value=state)
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
:::
|
|
57
|
+
|
|
58
|
+
::::
|
|
59
|
+
|
|
60
|
+
:::: example-spec
|
|
61
|
+
|
|
62
|
+
## Compiled specification {#specification}
|
|
63
|
+
|
|
64
|
+
### Startup
|
|
65
|
+
|
|
66
|
+
It sets `iterations` to `200000`. It sets `state` to `123`. It sets `index` to `0`. While `index` is less than `iterations`, it sets `state` to [`step`](operations.md#symbol-step) with `value` from `state`; then it increases `index` by `1`.
|
|
67
|
+
|
|
68
|
+
After the loop, it prints `state`.
|
|
69
|
+
|
|
70
|
+
### Dependencies
|
|
71
|
+
|
|
72
|
+
It uses [`step`](operations.md#symbol-step) from `operations`.
|
|
73
|
+
|
|
74
|
+
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
75
|
+
|
|
76
|
+
::::
|
|
77
|
+
|
|
78
|
+
:::::
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "operations.aug · Function-call benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/calls/operations.aug"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
pageClass: aug-example-page
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# `operations.aug`
|
|
13
|
+
|
|
14
|
+
[Function-call benchmark](index.md) · Source and specification
|
|
15
|
+
|
|
16
|
+
::: details Files in this project
|
|
17
|
+
|
|
18
|
+
- [`main.aug`](main.md)
|
|
19
|
+
- [`operations.aug`](operations.md)
|
|
20
|
+
|
|
21
|
+
:::
|
|
22
|
+
|
|
23
|
+
::::: example-compare
|
|
24
|
+
|
|
25
|
+
:::: example-code
|
|
26
|
+
|
|
27
|
+
## Code {#code}
|
|
28
|
+
|
|
29
|
+
::: code-group
|
|
30
|
+
|
|
31
|
+
```aug [Indentation]
|
|
32
|
+
// aug-spec: "operations.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
33
|
+
step(int value) returns int:
|
|
34
|
+
int product = value * 48271 + 1
|
|
35
|
+
return product - product / 2147483647 * 2147483647
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
```aug [Braces]
|
|
39
|
+
// aug-spec: "operations.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
40
|
+
step(int value) returns int {
|
|
41
|
+
int product = value * 48271 + 1
|
|
42
|
+
return product - product / 2147483647 * 2147483647
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
:::
|
|
47
|
+
|
|
48
|
+
::::
|
|
49
|
+
|
|
50
|
+
:::: example-spec
|
|
51
|
+
|
|
52
|
+
## Compiled specification {#specification}
|
|
53
|
+
|
|
54
|
+
### `step` · [source](operations.md#code) {#symbol-step}
|
|
55
|
+
|
|
56
|
+
It takes `value` as an integer. It sets `product` to (`value` times `48271`) plus `1`. It returns `product` minus ((`product` divided by `2147483647`) times `2147483647`).
|
|
57
|
+
|
|
58
|
+
::::
|
|
59
|
+
|
|
60
|
+
:::::
|
|
@@ -155,7 +155,7 @@ Adds two integers.
|
|
|
155
155
|
|
|
156
156
|
#### `Arithmetic.add` · [source](calculator.md#code) {#symbol-Arithmetic.add}
|
|
157
157
|
|
|
158
|
-
It takes `left` and `right` as integers. It gets `console` ([`Console`](dependencies/august/0.
|
|
158
|
+
It takes `left` and `right` as integers. It gets `console` ([`Console`](dependencies/august/0.21.0/io/contracts.md#symbol-Console)) from dependency injection. It returns `int`. It can call [`Console.write`](dependencies/august/0.21.0/io/contracts.md#symbol-Console.write).
|
|
159
159
|
|
|
160
160
|
### `Calculator` · class · [source](calculator.md#code) {#symbol-Calculator}
|
|
161
161
|
|
|
@@ -163,7 +163,7 @@ Uses the selected logger to describe each addition. It implements [`Arithmetic`]
|
|
|
163
163
|
|
|
164
164
|
#### `Calculator.add` · [source](calculator.md#code) {#symbol-Calculator.add}
|
|
165
165
|
|
|
166
|
-
Adds left and right, logging the operation. It takes `left` as an integer (First integer) and `right` as an integer (Second integer). It gets `console` ([`Console`](dependencies/august/0.
|
|
166
|
+
Adds left and right, logging the operation. It takes `left` as an integer (First integer) and `right` as an integer (Second integer). It gets `console` ([`Console`](dependencies/august/0.21.0/io/contracts.md#symbol-Console)) from dependency injection. It returns `int` — Sum of the two integers.
|
|
167
167
|
|
|
168
168
|
It passes `"adding integers"` to [`_logger.log`](logging/logger.md#symbol-Logger.log), using injected `console`. It returns `left` plus `right`.
|
|
169
169
|
|
|
@@ -179,7 +179,7 @@ Test adapter: keeps calculator tests independent of console output. It implement
|
|
|
179
179
|
|
|
180
180
|
#### `_SilentLogger.log` · [source](calculator.md#code) {#symbol-_SilentLogger.log}
|
|
181
181
|
|
|
182
|
-
It takes `message` as a string (Text to write). It gets `console` ([`Console`](dependencies/august/0.
|
|
182
|
+
It takes `message` as a string (Text to write). It gets `console` ([`Console`](dependencies/august/0.21.0/io/contracts.md#symbol-Console)) from dependency injection. It continues without an operation.
|
|
183
183
|
|
|
184
184
|
### `test Calculator calculator` · [source](calculator.md#code) {#symbol-test-20-Calculator-20-calculator}
|
|
185
185
|
|
|
@@ -187,7 +187,7 @@ Tests [`Calculator`](calculator.md#symbol-Calculator). Each case gets fresh setu
|
|
|
187
187
|
|
|
188
188
|
#### `addition`
|
|
189
189
|
|
|
190
|
-
Setup for each case: `Console` is provided by [`SystemConsole`](dependencies/august/0.
|
|
190
|
+
Setup for each case: `Console` is provided by [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole). Stateless instances are reused; stateful instances are created for each resolve. `Logger` is provided by [`_SilentLogger`](calculator.md#symbol-_SilentLogger). Stateless instances are reused; stateful instances are created for each resolve.
|
|
191
191
|
|
|
192
192
|
It sets `calculator` to a [`Calculator`](calculator.md#symbol-Calculator) using injected `Logger` for `_logger`. It sets `values` of type `List<int>` to a list containing `1`, `2`.
|
|
193
193
|
|
|
@@ -201,7 +201,7 @@ The test requires the number of elements in `values` equals `2`. The test requir
|
|
|
201
201
|
|
|
202
202
|
### Dependencies
|
|
203
203
|
|
|
204
|
-
It uses [`Console`](dependencies/august/0.
|
|
204
|
+
It uses [`Console`](dependencies/august/0.21.0/io/contracts.md#symbol-Console) ([`write`](dependencies/august/0.21.0/io/contracts.md#symbol-Console.write)) and [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole) from `august.io`. It uses [`Logger`](logging/logger.md#symbol-Logger) ([`log`](logging/logger.md#symbol-Logger.log)) from `logging`.
|
|
205
205
|
|
|
206
206
|
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
207
207
|
|
package/docs/examples/developer-workflow/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "august/0.
|
|
2
|
+
title: "august/0.21.0/io/contracts.aug · A small tested application"
|
|
3
3
|
generated: true
|
|
4
|
-
source: "examples/developer-workflow/.aug-spec/august/0.
|
|
4
|
+
source: "examples/developer-workflow/.aug-spec/august/0.21.0/io/contracts.aug"
|
|
5
5
|
editLink: false
|
|
6
6
|
prev: false
|
|
7
7
|
next: false
|
|
@@ -10,7 +10,7 @@ search: false
|
|
|
10
10
|
pageClass: aug-example-page
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
-
# `august/0.
|
|
13
|
+
# `august/0.21.0/io/contracts.aug`
|
|
14
14
|
|
|
15
15
|
[A small tested application](../../../../index.md) · Dependency source and specification
|
|
16
16
|
|
|
@@ -67,11 +67,11 @@ Writes application messages to standard output. It implements [`Logger`](logger.
|
|
|
67
67
|
|
|
68
68
|
#### `ConsoleLogger.log` · [source](console.md#code) {#symbol-ConsoleLogger.log}
|
|
69
69
|
|
|
70
|
-
It takes `message` as a string (Text to write). It gets `console` ([`Console`](../dependencies/august/0.
|
|
70
|
+
It takes `message` as a string (Text to write). It gets `console` ([`Console`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console)) from dependency injection. It passes `message` to [`console.write`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console.write).
|
|
71
71
|
|
|
72
72
|
### Dependencies
|
|
73
73
|
|
|
74
|
-
It uses [`Console`](../dependencies/august/0.
|
|
74
|
+
It uses [`Console`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console) ([`write`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console.write)) from `august.io`. It uses [`Logger`](logger.md#symbol-Logger) from `logger`.
|
|
75
75
|
|
|
76
76
|
::::
|
|
77
77
|
|
|
@@ -64,11 +64,11 @@ Receives a message describing an application operation.
|
|
|
64
64
|
|
|
65
65
|
#### `Logger.log` · [source](logger.md#code) {#symbol-Logger.log}
|
|
66
66
|
|
|
67
|
-
It takes `message` as a string (Text to write). It gets `console` ([`Console`](../dependencies/august/0.
|
|
67
|
+
It takes `message` as a string (Text to write). It gets `console` ([`Console`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console)) from dependency injection. It can call [`Console.write`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console.write).
|
|
68
68
|
|
|
69
69
|
### Dependencies
|
|
70
70
|
|
|
71
|
-
It uses [`Console`](../dependencies/august/0.
|
|
71
|
+
It uses [`Console`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console) ([`write`](../dependencies/august/0.21.0/io/contracts.md#symbol-Console.write)) from `august.io`.
|
|
72
72
|
|
|
73
73
|
::::
|
|
74
74
|
|
|
@@ -99,7 +99,7 @@ catch IndexError error {
|
|
|
99
99
|
|
|
100
100
|
### Providers
|
|
101
101
|
|
|
102
|
-
`Console` is provided by [`SystemConsole`](dependencies/august/0.
|
|
102
|
+
`Console` is provided by [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole). The same instance is shared. `Logger` is provided by [`ConsoleLogger`](logging/console.md#symbol-ConsoleLogger). The same instance is shared.
|
|
103
103
|
|
|
104
104
|
### Startup
|
|
105
105
|
|
|
@@ -111,7 +111,7 @@ It prints the value under `2` in `fruit`. It prints [`load`](calculator.md#symbo
|
|
|
111
111
|
|
|
112
112
|
### Dependencies
|
|
113
113
|
|
|
114
|
-
It uses [`SystemConsole`](dependencies/august/0.
|
|
114
|
+
It uses [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole) from `august.io`. It uses [`Calculator`](calculator.md#symbol-Calculator) ([`add`](calculator.md#symbol-Calculator.add)) and [`load`](calculator.md#symbol-load) from `calculator`. It uses [`ConsoleLogger`](logging/console.md#symbol-ConsoleLogger) from `logging`.
|
|
115
115
|
|
|
116
116
|
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
117
117
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Checked-error benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/errors"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Checked-error benchmark
|
|
12
|
+
|
|
13
|
+
Interleave successful calls and caught checked failures.
|
|
14
|
+
|
|
15
|
+
Open a file to read its source beside the explanation produced by `aug spec`. **Indentation** and **Braces** display the same checked program; your choice carries across file pages.
|
|
16
|
+
|
|
17
|
+
## Project files
|
|
18
|
+
|
|
19
|
+
- [`main.aug`](main.md)
|
|
20
|
+
- [`operations.aug`](operations.md)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Try this project
|
|
24
|
+
|
|
25
|
+
[Download this project](/downloads/errors-benchmark.zip), then extract the archive in an empty working folder. It contains the checked source, configuration, and generated specs. [Install August](../../getting-started.md) once, then run these commands. Native libraries are prepared automatically when needed:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
cd errors-benchmark
|
|
29
|
+
aug check .
|
|
30
|
+
aug spec .
|
|
31
|
+
aug run .
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
See [the performance page](../../performance.md) for measurements, input sizes, and reproduction steps.
|
|
35
|
+
|
|
36
|
+
[Browse all examples](../index.md)
|