@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,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Native binding contract · Compression with zlib"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi.json"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
search: false
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Native binding contract
|
|
13
|
+
|
|
14
|
+
[Compression with zlib](../../../../../index.md)
|
|
15
|
+
|
|
16
|
+
This is the exact descriptor checked for this dependency. It records native symbols, ownership, errors, and ABI boundaries. The compiler checks August declarations against it; foreign implementations remain the native author’s responsibility.
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"format": 1,
|
|
21
|
+
"profile": "aug-native-abi-1",
|
|
22
|
+
"resources": [],
|
|
23
|
+
"functions": [
|
|
24
|
+
{
|
|
25
|
+
"module": "api",
|
|
26
|
+
"name": "_compress",
|
|
27
|
+
"symbol": "aug_zlib_compress_v1",
|
|
28
|
+
"params": [
|
|
29
|
+
{
|
|
30
|
+
"name": "input",
|
|
31
|
+
"kind": "bytes"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"result": {
|
|
35
|
+
"kind": "bytes",
|
|
36
|
+
"release": "aug_zlib_release_v1"
|
|
37
|
+
},
|
|
38
|
+
"error": "contracts.CompressionError",
|
|
39
|
+
"callingConvention": "C",
|
|
40
|
+
"status": "i32",
|
|
41
|
+
"uses": [],
|
|
42
|
+
"changes": [],
|
|
43
|
+
"thread": "caller",
|
|
44
|
+
"retainsInputs": false
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"module": "api",
|
|
48
|
+
"name": "_decompress",
|
|
49
|
+
"symbol": "aug_zlib_decompress_v1",
|
|
50
|
+
"params": [
|
|
51
|
+
{
|
|
52
|
+
"name": "input",
|
|
53
|
+
"kind": "bytes"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
"name": "maximumOutput",
|
|
57
|
+
"kind": "i64",
|
|
58
|
+
"minimum": 0,
|
|
59
|
+
"maximum": 268435456
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"result": {
|
|
63
|
+
"kind": "bytes",
|
|
64
|
+
"release": "aug_zlib_release_v1"
|
|
65
|
+
},
|
|
66
|
+
"error": "contracts.CompressionError",
|
|
67
|
+
"callingConvention": "C",
|
|
68
|
+
"status": "i32",
|
|
69
|
+
"uses": [],
|
|
70
|
+
"changes": [],
|
|
71
|
+
"thread": "caller",
|
|
72
|
+
"retainsInputs": false
|
|
73
|
+
}
|
|
74
|
+
]
|
|
75
|
+
}
|
|
76
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Compression with zlib"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "examples/native-zlib"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Compression with zlib
|
|
12
|
+
|
|
13
|
+
Compress a buffer with zlib and verify the restored bytes. A fixed output limit bounds decompression.
|
|
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
|
+
This project requires the August `0.21.0` LLVM preview on macOS 14+ with Apple Silicon, or Debian/Ubuntu GNU/Linux x64 or ARM64 with glibc 2.36+. The library archives are public; the matching compiler release is still being qualified.
|
|
18
|
+
|
|
19
|
+
## Project files
|
|
20
|
+
|
|
21
|
+
- [`main.aug`](main.md)
|
|
22
|
+
- [`compression.aug`](compression.md)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Try this project
|
|
26
|
+
|
|
27
|
+
[Download this project](/downloads/native-zlib.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:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
cd native-zlib
|
|
31
|
+
aug install .
|
|
32
|
+
aug check .
|
|
33
|
+
aug spec .
|
|
34
|
+
aug test .
|
|
35
|
+
aug run .
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
[Browse all examples](../index.md)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "main.aug · Compression with zlib"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "examples/native-zlib/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
|
+
[Compression with zlib](index.md) · Source and specification
|
|
15
|
+
|
|
16
|
+
::: details Files in this project
|
|
17
|
+
|
|
18
|
+
- [`main.aug`](main.md)
|
|
19
|
+
- [`compression.aug`](compression.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 roundTrip from compression
|
|
34
|
+
import CompressionError from "https://github.com/GreenPandaStudios/aug-zlib#v0.1.3"
|
|
35
|
+
try:
|
|
36
|
+
print(value=roundTrip().text())
|
|
37
|
+
catch CompressionError error:
|
|
38
|
+
print(value=error.message)
|
|
39
|
+
catch ConversionError error:
|
|
40
|
+
print(value="Invalid UTF-8")
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```aug [Braces]
|
|
44
|
+
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
45
|
+
import roundTrip from compression
|
|
46
|
+
import CompressionError from "https://github.com/GreenPandaStudios/aug-zlib#v0.1.3"
|
|
47
|
+
try {
|
|
48
|
+
print(value=roundTrip().text())
|
|
49
|
+
}
|
|
50
|
+
catch CompressionError error {
|
|
51
|
+
print(value=error.message)
|
|
52
|
+
}
|
|
53
|
+
catch ConversionError error {
|
|
54
|
+
print(value="Invalid UTF-8")
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
:::
|
|
59
|
+
|
|
60
|
+
::::
|
|
61
|
+
|
|
62
|
+
:::: example-spec
|
|
63
|
+
|
|
64
|
+
## Compiled specification {#specification}
|
|
65
|
+
|
|
66
|
+
### Startup
|
|
67
|
+
|
|
68
|
+
It prints `text` on [`roundTrip`](compression.md#symbol-roundTrip). If this work raises [`CompressionError`](dependencies/packages/%40greenpandastudios/aug-zlib/0.1.3/contracts.md#symbol-CompressionError) as `error`, it prints `error.message`. If this work raises `ConversionError`, it prints `"Invalid UTF-8"`.
|
|
69
|
+
|
|
70
|
+
### Dependencies
|
|
71
|
+
|
|
72
|
+
It uses [`CompressionError`](dependencies/packages/%40greenpandastudios/aug-zlib/0.1.3/contracts.md#symbol-CompressionError) (`message`) from `https://github.com/GreenPandaStudios/aug-zlib#v0.1.3`. It uses [`roundTrip`](compression.md#symbol-roundTrip) from `compression`.
|
|
73
|
+
|
|
74
|
+
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
75
|
+
|
|
76
|
+
::::
|
|
77
|
+
|
|
78
|
+
:::::
|
|
@@ -65,11 +65,11 @@ It implements [`Logger`](logger.md#symbol-Logger).
|
|
|
65
65
|
|
|
66
66
|
#### `ConsoleLogger.log` · [source](console.md#code) {#symbol-ConsoleLogger.log}
|
|
67
67
|
|
|
68
|
-
It takes `message` as a string (Text to display). It gets `console` ([`Console`](dependencies/august/0.
|
|
68
|
+
It takes `message` as a string (Text to display). 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).
|
|
69
69
|
|
|
70
70
|
### Dependencies
|
|
71
71
|
|
|
72
|
-
It uses [`Console`](dependencies/august/0.
|
|
72
|
+
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`.
|
|
73
73
|
|
|
74
74
|
::::
|
|
75
75
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
title: "august/0.
|
|
2
|
+
title: "august/0.21.0/io/contracts.aug · Labeled calls and injection"
|
|
3
3
|
generated: true
|
|
4
|
-
source: "examples/new-syntax/.aug-spec/august/0.
|
|
4
|
+
source: "examples/new-syntax/.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
|
[Labeled calls and injection](../../../../index.md) · Dependency source and specification
|
|
16
16
|
|
|
@@ -70,17 +70,17 @@ It implements [`IGreeter`](greeter.md#symbol-IGreeter). It takes `x` as an integ
|
|
|
70
70
|
|
|
71
71
|
#### `Greeter.greet` · [source](greeter.md#code) {#symbol-Greeter.greet}
|
|
72
72
|
|
|
73
|
-
It takes `name` as a string. It gets `console` ([`Console`](dependencies/august/0.
|
|
73
|
+
It takes `name` as a string. It gets `console` ([`Console`](dependencies/august/0.21.0/io/contracts.md#symbol-Console)) from dependency injection. It passes the text `Hello, {name}!` to [`logger.log`](logger.md#symbol-Logger.log), using injected `console`.
|
|
74
74
|
|
|
75
75
|
### `IGreeter` · interface · [source](greeter.md#code) {#symbol-IGreeter}
|
|
76
76
|
|
|
77
77
|
#### `IGreeter.greet` · [source](greeter.md#code) {#symbol-IGreeter.greet}
|
|
78
78
|
|
|
79
|
-
It takes `name` as a string. It gets `console` ([`Console`](dependencies/august/0.
|
|
79
|
+
It takes `name` as a string. 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).
|
|
80
80
|
|
|
81
81
|
### Dependencies
|
|
82
82
|
|
|
83
|
-
It uses [`Console`](dependencies/august/0.
|
|
83
|
+
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) ([`log`](logger.md#symbol-Logger.log)) from `logger`.
|
|
84
84
|
|
|
85
85
|
::::
|
|
86
86
|
|
|
@@ -64,11 +64,11 @@ Displays application messages.
|
|
|
64
64
|
|
|
65
65
|
#### `Logger.log` · [source](logger.md#code) {#symbol-Logger.log}
|
|
66
66
|
|
|
67
|
-
It takes `message` as a string (Text to display). It gets `console` ([`Console`](dependencies/august/0.
|
|
67
|
+
It takes `message` as a string (Text to display). 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
|
|
|
@@ -73,7 +73,7 @@ print(value=count)
|
|
|
73
73
|
|
|
74
74
|
### Providers
|
|
75
75
|
|
|
76
|
-
`Console` is provided by [`SystemConsole`](dependencies/august/0.
|
|
76
|
+
`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`](console.md#symbol-ConsoleLogger). The same instance is shared.
|
|
77
77
|
|
|
78
78
|
### Startup
|
|
79
79
|
|
|
@@ -83,7 +83,7 @@ It prints `count`.
|
|
|
83
83
|
|
|
84
84
|
### Dependencies
|
|
85
85
|
|
|
86
|
-
It uses [`SystemConsole`](dependencies/august/0.
|
|
86
|
+
It uses [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole) from `august.io`. It uses [`ConsoleLogger`](console.md#symbol-ConsoleLogger) from `console`. It uses [`Greeter`](greeter.md#symbol-Greeter) ([`greet`](greeter.md#symbol-Greeter.greet)) from `greeter`. It uses [`increment`](math.md#symbol-increment) from `math`.
|
|
87
87
|
|
|
88
88
|
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
89
89
|
|
package/docs/examples/ownership-transfer/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 · Move ownership"
|
|
3
3
|
generated: true
|
|
4
|
-
source: "examples/ownership-transfer/.aug-spec/august/0.
|
|
4
|
+
source: "examples/ownership-transfer/.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
|
[Move ownership](../../../../index.md) · Dependency source and specification
|
|
16
16
|
|
|
@@ -64,7 +64,7 @@ print(value="end of main")
|
|
|
64
64
|
|
|
65
65
|
### Providers
|
|
66
66
|
|
|
67
|
-
`Console` is provided by [`SystemConsole`](dependencies/august/0.
|
|
67
|
+
`Console` is provided by [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole). The same instance is shared.
|
|
68
68
|
|
|
69
69
|
### Startup
|
|
70
70
|
|
|
@@ -74,7 +74,7 @@ It gets `first` of type [`Resource`](resource.md#symbol-Resource) from [`make`](
|
|
|
74
74
|
|
|
75
75
|
### Dependencies
|
|
76
76
|
|
|
77
|
-
It uses [`SystemConsole`](dependencies/august/0.
|
|
77
|
+
It uses [`SystemConsole`](dependencies/august/0.21.0/io/contracts.md#symbol-SystemConsole) from `august.io`. It uses [`Resource`](resource.md#symbol-Resource), [`consume`](resource.md#symbol-consume), and [`make`](resource.md#symbol-make) from `resource`.
|
|
78
78
|
|
|
79
79
|
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
80
80
|
|
|
@@ -87,11 +87,11 @@ It returns ownership of [`Resource`](resource.md#symbol-Resource). It sets `valu
|
|
|
87
87
|
|
|
88
88
|
### `consume` · [source](resource.md#code) {#symbol-consume}
|
|
89
89
|
|
|
90
|
-
It takes `value` as [`Resource`](resource.md#symbol-Resource) with ownership transferred. It gets `console` ([`Console`](dependencies/august/0.
|
|
90
|
+
It takes `value` as [`Resource`](resource.md#symbol-Resource) with ownership transferred. It gets `console` ([`Console`](dependencies/august/0.21.0/io/contracts.md#symbol-Console)) from dependency injection. It passes `"consumed"` to [`console.write`](dependencies/august/0.21.0/io/contracts.md#symbol-Console.write).
|
|
91
91
|
|
|
92
92
|
### Dependencies
|
|
93
93
|
|
|
94
|
-
It uses [`Console`](dependencies/august/0.
|
|
94
|
+
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`.
|
|
95
95
|
|
|
96
96
|
::::
|
|
97
97
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "data.aug · Record allocation benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/records/data.aug"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
pageClass: aug-example-page
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# `data.aug`
|
|
13
|
+
|
|
14
|
+
[Record allocation benchmark](index.md) · Source and specification
|
|
15
|
+
|
|
16
|
+
::: details Files in this project
|
|
17
|
+
|
|
18
|
+
- [`main.aug`](main.md)
|
|
19
|
+
- [`data.aug`](data.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: "data.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
33
|
+
record Item(int id, string name)
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```aug [Braces]
|
|
37
|
+
// aug-spec: "data.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
38
|
+
record Item(int id, string name)
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
:::
|
|
42
|
+
|
|
43
|
+
::::
|
|
44
|
+
|
|
45
|
+
:::: example-spec
|
|
46
|
+
|
|
47
|
+
## Compiled specification {#specification}
|
|
48
|
+
|
|
49
|
+
### `Item` · immutable record · [source](data.md#code) {#symbol-Item}
|
|
50
|
+
|
|
51
|
+
It takes `id` as an integer, kept read-only and `name` as a string, kept read-only.
|
|
52
|
+
|
|
53
|
+
::::
|
|
54
|
+
|
|
55
|
+
:::::
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Record allocation benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/records"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Record allocation benchmark
|
|
12
|
+
|
|
13
|
+
Retain immutable records and sum their fields.
|
|
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
|
+
- [`data.aug`](data.md)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## Try this project
|
|
24
|
+
|
|
25
|
+
[Download this project](/downloads/records-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 records-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,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "main.aug · Record allocation benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/records/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
|
+
[Record allocation benchmark](index.md) · Source and specification
|
|
15
|
+
|
|
16
|
+
::: details Files in this project
|
|
17
|
+
|
|
18
|
+
- [`main.aug`](main.md)
|
|
19
|
+
- [`data.aug`](data.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 Item from data
|
|
34
|
+
int iterations = 50000
|
|
35
|
+
own List<Item> values = []
|
|
36
|
+
int index = 0
|
|
37
|
+
while index < iterations:
|
|
38
|
+
values.append(value=Item(id=index, name="August"))
|
|
39
|
+
index = index + 1
|
|
40
|
+
int checksum = 0
|
|
41
|
+
for item in values:
|
|
42
|
+
checksum = checksum + item.id
|
|
43
|
+
print(value=checksum)
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```aug [Braces]
|
|
47
|
+
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
48
|
+
import Item from data
|
|
49
|
+
int iterations = 50000
|
|
50
|
+
own List<Item> values = []
|
|
51
|
+
int index = 0
|
|
52
|
+
while index < iterations {
|
|
53
|
+
values.append(value=Item(id=index, name="August"))
|
|
54
|
+
index = index + 1
|
|
55
|
+
}
|
|
56
|
+
int checksum = 0
|
|
57
|
+
for item in values {
|
|
58
|
+
checksum = checksum + item.id
|
|
59
|
+
}
|
|
60
|
+
print(value=checksum)
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
:::
|
|
64
|
+
|
|
65
|
+
::::
|
|
66
|
+
|
|
67
|
+
:::: example-spec
|
|
68
|
+
|
|
69
|
+
## Compiled specification {#specification}
|
|
70
|
+
|
|
71
|
+
### Startup
|
|
72
|
+
|
|
73
|
+
It sets `iterations` to `50000`. It sets `values` of type `List<Item>` to a list with no items. `values` of type `List<Item>` owns this value. It sets `index` to `0`.
|
|
74
|
+
|
|
75
|
+
While `index` is less than `iterations`, it appends an [`Item`](data.md#symbol-Item) with `id` from `index` and `name` `"August"` to `values`; then it increases `index` by `1`. After the loop, it sets `checksum` to `0`. For each `item` in a snapshot of `values`, it increases `checksum` by `item.id`. After the loop, it prints `checksum`.
|
|
76
|
+
|
|
77
|
+
### Dependencies
|
|
78
|
+
|
|
79
|
+
It uses [`Item`](data.md#symbol-Item) (`id`) from `data`.
|
|
80
|
+
|
|
81
|
+
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
82
|
+
|
|
83
|
+
::::
|
|
84
|
+
|
|
85
|
+
:::::
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "String processing benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/strings"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# String processing benchmark
|
|
12
|
+
|
|
13
|
+
Split text into parts and sum their byte lengths.
|
|
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
|
+
|
|
21
|
+
|
|
22
|
+
## Try this project
|
|
23
|
+
|
|
24
|
+
[Download this project](/downloads/strings-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:
|
|
25
|
+
|
|
26
|
+
```sh
|
|
27
|
+
cd strings-benchmark
|
|
28
|
+
aug check .
|
|
29
|
+
aug spec .
|
|
30
|
+
aug run .
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
See [the performance page](../../performance.md) for measurements, input sizes, and reproduction steps.
|
|
34
|
+
|
|
35
|
+
[Browse all examples](../index.md)
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "main.aug · String processing benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/strings/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
|
+
[String processing benchmark](index.md) · Source and specification
|
|
15
|
+
|
|
16
|
+
::: details Files in this project
|
|
17
|
+
|
|
18
|
+
- [`main.aug`](main.md)
|
|
19
|
+
|
|
20
|
+
:::
|
|
21
|
+
|
|
22
|
+
::::: example-compare
|
|
23
|
+
|
|
24
|
+
:::: example-code
|
|
25
|
+
|
|
26
|
+
## Code {#code}
|
|
27
|
+
|
|
28
|
+
::: code-group
|
|
29
|
+
|
|
30
|
+
```aug [Indentation]
|
|
31
|
+
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
32
|
+
int iterations = 20000
|
|
33
|
+
int index = 0
|
|
34
|
+
int checksum = 0
|
|
35
|
+
while index < iterations:
|
|
36
|
+
parts = "August,clear,local,checked".split(separator=",")
|
|
37
|
+
for part in parts:
|
|
38
|
+
checksum = checksum + part.length()
|
|
39
|
+
index = index + 1
|
|
40
|
+
print(value=checksum)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
```aug [Braces]
|
|
44
|
+
// aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
|
|
45
|
+
int iterations = 20000
|
|
46
|
+
int index = 0
|
|
47
|
+
int checksum = 0
|
|
48
|
+
while index < iterations {
|
|
49
|
+
parts = "August,clear,local,checked".split(separator=",")
|
|
50
|
+
for part in parts {
|
|
51
|
+
checksum = checksum + part.length()
|
|
52
|
+
}
|
|
53
|
+
index = index + 1
|
|
54
|
+
}
|
|
55
|
+
print(value=checksum)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
:::
|
|
59
|
+
|
|
60
|
+
::::
|
|
61
|
+
|
|
62
|
+
:::: example-spec
|
|
63
|
+
|
|
64
|
+
## Compiled specification {#specification}
|
|
65
|
+
|
|
66
|
+
### Startup
|
|
67
|
+
|
|
68
|
+
It sets `iterations` to `20000`. It sets `index` and `checksum` separately, each to `0`. While `index` is less than `iterations`, it sets `parts` to `split` on `"August,clear,local,checked"` with `separator` `","`. For each `part` in a snapshot of `parts`, it increases `checksum` by the byte length of `part`.
|
|
69
|
+
|
|
70
|
+
After the loop, it increases `index` by `1`. After the loop, it prints `checksum`.
|
|
71
|
+
|
|
72
|
+
Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
|
|
73
|
+
|
|
74
|
+
::::
|
|
75
|
+
|
|
76
|
+
:::::
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Task scheduling benchmark"
|
|
3
|
+
generated: true
|
|
4
|
+
source: "benchmarks/tasks"
|
|
5
|
+
editLink: false
|
|
6
|
+
prev: false
|
|
7
|
+
next: false
|
|
8
|
+
outline: [2, 3]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Task scheduling benchmark
|
|
12
|
+
|
|
13
|
+
Start and join two tasks in each bounded scope.
|
|
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/tasks-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 tasks-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)
|