@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.
Files changed (295) hide show
  1. package/README.md +1 -1
  2. package/docs/assets/benchmarks/execution.svg +774 -637
  3. package/docs/assets/benchmarks/http.svg +278 -249
  4. package/docs/assets/benchmarks/improvements.svg +66 -66
  5. package/docs/assets/benchmarks/kernels-mobile.svg +1 -0
  6. package/docs/assets/benchmarks/kernels.svg +1 -0
  7. package/docs/assets/benchmarks/memory.svg +153 -153
  8. package/docs/benchmark-results.json +227089 -90363
  9. package/docs/compatibility.md +6 -6
  10. package/docs/contributing-benchmarks.md +36 -6
  11. package/docs/dev-containers.md +8 -15
  12. package/docs/dgx-consumers.json +122 -0
  13. package/docs/dgx-gyms.json +784 -0
  14. package/docs/dgx-kernels.json +1170 -0
  15. package/docs/dgx-performance.json +227849 -0
  16. package/docs/dgx-spark.md +64 -0
  17. package/docs/diagnostics.md +1 -1
  18. package/docs/docker.md +16 -17
  19. package/docs/example-projects.json +32 -0
  20. package/docs/examples/approved-design/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
  21. package/docs/examples/approved-design/domain/app.md +4 -4
  22. package/docs/examples/approved-design/main.md +2 -2
  23. package/docs/examples/calls-benchmark/index.md +36 -0
  24. package/docs/examples/calls-benchmark/main.md +78 -0
  25. package/docs/examples/calls-benchmark/operations.md +60 -0
  26. package/docs/examples/developer-workflow/calculator.md +5 -5
  27. package/docs/examples/developer-workflow/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
  28. package/docs/examples/developer-workflow/logging/console.md +2 -2
  29. package/docs/examples/developer-workflow/logging/logger.md +2 -2
  30. package/docs/examples/developer-workflow/main.md +2 -2
  31. package/docs/examples/errors-benchmark/index.md +36 -0
  32. package/docs/examples/errors-benchmark/main.md +92 -0
  33. package/docs/examples/errors-benchmark/operations.md +65 -0
  34. package/docs/examples/float-benchmark/index.md +35 -0
  35. package/docs/examples/float-benchmark/main.md +75 -0
  36. package/docs/examples/generic-di/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
  37. package/docs/examples/generic-di/main.md +2 -2
  38. package/docs/examples/generic-di/types.md +3 -3
  39. package/docs/examples/hello/app/greeter.md +3 -3
  40. package/docs/examples/hello/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
  41. package/docs/examples/hello/logging/console.md +2 -2
  42. package/docs/examples/hello/logging/logger.md +2 -2
  43. package/docs/examples/hello/main.md +2 -2
  44. package/docs/examples/index.md +18 -1
  45. package/docs/examples/interceptors/app.md +5 -5
  46. package/docs/examples/interceptors/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
  47. package/docs/examples/interceptors/interceptors.md +2 -2
  48. package/docs/examples/interceptors/logging.md +3 -3
  49. package/docs/examples/interceptors/main.md +2 -2
  50. package/docs/examples/list-benchmark/index.md +35 -0
  51. package/docs/examples/list-benchmark/main.md +78 -0
  52. package/docs/examples/map-churn-benchmark/index.md +35 -0
  53. package/docs/examples/map-churn-benchmark/main.md +106 -0
  54. package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/api.md +104 -0
  55. package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.md +54 -0
  56. package/docs/examples/native-blake3/dependencies/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi-json.md +48 -0
  57. package/docs/examples/native-blake3/hashing.md +93 -0
  58. package/docs/examples/native-blake3/index.md +38 -0
  59. package/docs/examples/native-blake3/main.md +73 -0
  60. package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/api.md +406 -0
  61. package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.md +51 -0
  62. package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.md +63 -0
  63. package/docs/examples/native-pytorch/dependencies/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi-json.md +161 -0
  64. package/docs/examples/native-pytorch/index.md +38 -0
  65. package/docs/examples/native-pytorch/main.md +73 -0
  66. package/docs/examples/native-pytorch/tensors.md +123 -0
  67. package/docs/examples/native-sqlite/database.md +116 -0
  68. package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/api.md +284 -0
  69. package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.md +51 -0
  70. package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.md +75 -0
  71. package/docs/examples/native-sqlite/dependencies/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi-json.md +119 -0
  72. package/docs/examples/native-sqlite/index.md +38 -0
  73. package/docs/examples/native-sqlite/main.md +73 -0
  74. package/docs/examples/native-zlib/compression.md +99 -0
  75. package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/api.md +153 -0
  76. package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.md +54 -0
  77. package/docs/examples/native-zlib/dependencies/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi-json.md +76 -0
  78. package/docs/examples/native-zlib/index.md +38 -0
  79. package/docs/examples/native-zlib/main.md +78 -0
  80. package/docs/examples/new-syntax/console.md +2 -2
  81. package/docs/examples/new-syntax/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
  82. package/docs/examples/new-syntax/greeter.md +3 -3
  83. package/docs/examples/new-syntax/logger.md +2 -2
  84. package/docs/examples/new-syntax/main.md +2 -2
  85. package/docs/examples/ownership-transfer/dependencies/august/{0.20.1 → 0.21.0}/io/contracts.md +3 -3
  86. package/docs/examples/ownership-transfer/main.md +2 -2
  87. package/docs/examples/ownership-transfer/resource.md +2 -2
  88. package/docs/examples/packages-math/aug-package-json.md +1 -1
  89. package/docs/examples/records-benchmark/data.md +55 -0
  90. package/docs/examples/records-benchmark/index.md +36 -0
  91. package/docs/examples/records-benchmark/main.md +85 -0
  92. package/docs/examples/strings-benchmark/index.md +35 -0
  93. package/docs/examples/strings-benchmark/main.md +76 -0
  94. package/docs/examples/tasks-benchmark/index.md +36 -0
  95. package/docs/examples/tasks-benchmark/main.md +89 -0
  96. package/docs/examples/tasks-benchmark/operations.md +58 -0
  97. package/docs/getting-started.md +3 -3
  98. package/docs/grammar.md +2 -2
  99. package/docs/gym-results.json +784 -0
  100. package/docs/implementation-map.md +6 -0
  101. package/docs/index.md +1 -1
  102. package/docs/kernel-results.json +1170 -0
  103. package/docs/language-conformance.md +6 -0
  104. package/docs/language-constructs.md +9 -1
  105. package/docs/learn/index.md +1 -1
  106. package/docs/maintaining-docs.md +1 -1
  107. package/docs/native-implementation.md +276 -0
  108. package/docs/native-interop-llvm-plan.md +342 -0
  109. package/docs/native-package-examples.md +684 -0
  110. package/docs/native-packages.md +179 -0
  111. package/docs/packages.md +2 -2
  112. package/docs/performance.md +50 -29
  113. package/docs/production-readiness.md +11 -1
  114. package/docs/public/downloads/approved-design.zip +0 -0
  115. package/docs/public/downloads/calls-benchmark.zip +0 -0
  116. package/docs/public/downloads/developer-workflow.zip +0 -0
  117. package/docs/public/downloads/errors-benchmark.zip +0 -0
  118. package/docs/public/downloads/float-benchmark.zip +0 -0
  119. package/docs/public/downloads/generic-di.zip +0 -0
  120. package/docs/public/downloads/hello.zip +0 -0
  121. package/docs/public/downloads/interceptors.zip +0 -0
  122. package/docs/public/downloads/json-benchmark.zip +0 -0
  123. package/docs/public/downloads/list-benchmark.zip +0 -0
  124. package/docs/public/downloads/map-churn-benchmark.zip +0 -0
  125. package/docs/public/downloads/native-blake3.zip +0 -0
  126. package/docs/public/downloads/native-pytorch.zip +0 -0
  127. package/docs/public/downloads/native-sqlite.zip +0 -0
  128. package/docs/public/downloads/native-zlib.zip +0 -0
  129. package/docs/public/downloads/new-syntax.zip +0 -0
  130. package/docs/public/downloads/oidc-login.zip +0 -0
  131. package/docs/public/downloads/ownership-transfer.zip +0 -0
  132. package/docs/public/downloads/packages-app.zip +0 -0
  133. package/docs/public/downloads/packages-math.zip +0 -0
  134. package/docs/public/downloads/records-benchmark.zip +0 -0
  135. package/docs/public/downloads/strings-benchmark.zip +0 -0
  136. package/docs/public/downloads/tasks-benchmark.zip +0 -0
  137. package/docs/qualification-results.md +66 -0
  138. package/docs/reference.md +24 -0
  139. package/docs/releasing.md +81 -6
  140. package/docs/research/libtorch-native-qualification.md +115 -0
  141. package/docs/research/native-interop-llvm.md +197 -0
  142. package/docs/research/qualification-methods.md +15 -0
  143. package/docs/roadmap.md +1 -0
  144. package/docs/safety-gyms.md +41 -0
  145. package/docs/tooling.md +16 -15
  146. package/docs/web-library-gaps.md +1 -1
  147. package/docs/web.md +4 -0
  148. package/examples/approved-design/.aug-spec/manifest.json +3 -3
  149. package/examples/approved-design/domain/app.aug.md +4 -4
  150. package/examples/approved-design/main.aug.md +2 -2
  151. package/examples/developer-workflow/.aug-spec/manifest.json +3 -3
  152. package/examples/developer-workflow/calculator.aug.md +5 -5
  153. package/examples/developer-workflow/logging/console.aug.md +2 -2
  154. package/examples/developer-workflow/logging/logger.aug.md +2 -2
  155. package/examples/developer-workflow/main.aug.md +2 -2
  156. package/examples/generic-di/.aug-spec/manifest.json +3 -3
  157. package/examples/generic-di/main.aug.md +2 -2
  158. package/examples/generic-di/types.aug.md +3 -3
  159. package/examples/hello/.aug-spec/manifest.json +3 -3
  160. package/examples/hello/app/greeter.aug.md +3 -3
  161. package/examples/hello/logging/console.aug.md +2 -2
  162. package/examples/hello/logging/logger.aug.md +2 -2
  163. package/examples/hello/main.aug.md +2 -2
  164. package/examples/interceptors/.aug-spec/manifest.json +3 -3
  165. package/examples/interceptors/app.aug.md +5 -5
  166. package/examples/interceptors/interceptors.aug.md +2 -2
  167. package/examples/interceptors/logging.aug.md +3 -3
  168. package/examples/interceptors/main.aug.md +2 -2
  169. package/examples/native-blake3/.aug-spec/manifest.json +16 -0
  170. package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.1/native.abi.json +29 -0
  171. package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug +14 -0
  172. package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/api.aug.md +34 -0
  173. package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug +4 -0
  174. package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/contracts.aug.md +8 -0
  175. package/examples/native-blake3/.aug-spec/packages/@greenpandastudios/aug-blake3/0.1.3/native.abi.json +29 -0
  176. package/examples/native-blake3/AGENTS.md +5 -0
  177. package/examples/native-blake3/aug.lock.json +253 -0
  178. package/examples/native-blake3/hashing.aug +11 -0
  179. package/examples/native-blake3/hashing.aug.md +25 -0
  180. package/examples/native-blake3/main.aug +8 -0
  181. package/examples/native-blake3/main.aug.md +13 -0
  182. package/examples/native-pytorch/.aug-spec/manifest.json +18 -0
  183. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.1/native.abi.json +142 -0
  184. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.3/native.abi.json +142 -0
  185. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug +101 -0
  186. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/api.aug.md +160 -0
  187. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug +3 -0
  188. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md +8 -0
  189. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug +6 -0
  190. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md +13 -0
  191. package/examples/native-pytorch/.aug-spec/packages/@greenpandastudios/aug-pytorch/0.1.4/native.abi.json +142 -0
  192. package/examples/native-pytorch/AGENTS.md +5 -0
  193. package/examples/native-pytorch/aug.lock.json +309 -0
  194. package/examples/native-pytorch/main.aug +8 -0
  195. package/examples/native-pytorch/main.aug.md +13 -0
  196. package/examples/native-pytorch/tensors.aug +23 -0
  197. package/examples/native-pytorch/tensors.aug.md +35 -0
  198. package/examples/native-sqlite/.aug-spec/manifest.json +18 -0
  199. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.2/native.abi.json +100 -0
  200. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug +48 -0
  201. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug.md +91 -0
  202. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug +3 -0
  203. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug.md +8 -0
  204. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug +8 -0
  205. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug.md +22 -0
  206. package/examples/native-sqlite/.aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi.json +100 -0
  207. package/examples/native-sqlite/AGENTS.md +5 -0
  208. package/examples/native-sqlite/aug.lock.json +236 -0
  209. package/examples/native-sqlite/database.aug +15 -0
  210. package/examples/native-sqlite/database.aug.md +27 -0
  211. package/examples/native-sqlite/main.aug +8 -0
  212. package/examples/native-sqlite/main.aug.md +13 -0
  213. package/examples/native-zlib/.aug-spec/manifest.json +16 -0
  214. package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.1/native.abi.json +57 -0
  215. package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug +29 -0
  216. package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/api.aug.md +54 -0
  217. package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug +4 -0
  218. package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/contracts.aug.md +8 -0
  219. package/examples/native-zlib/.aug-spec/packages/@greenpandastudios/aug-zlib/0.1.3/native.abi.json +57 -0
  220. package/examples/native-zlib/AGENTS.md +5 -0
  221. package/examples/native-zlib/aug.lock.json +236 -0
  222. package/examples/native-zlib/compression.aug +15 -0
  223. package/examples/native-zlib/compression.aug.md +27 -0
  224. package/examples/native-zlib/main.aug +10 -0
  225. package/examples/native-zlib/main.aug.md +13 -0
  226. package/examples/new-syntax/.aug-spec/manifest.json +3 -3
  227. package/examples/new-syntax/console.aug.md +2 -2
  228. package/examples/new-syntax/greeter.aug.md +3 -3
  229. package/examples/new-syntax/logger.aug.md +2 -2
  230. package/examples/new-syntax/main.aug.md +2 -2
  231. package/examples/oidc-login/aug.lock.json +6 -6
  232. package/examples/ownership-transfer/.aug-spec/manifest.json +3 -3
  233. package/examples/ownership-transfer/main.aug.md +2 -2
  234. package/examples/ownership-transfer/resource.aug.md +2 -2
  235. package/examples/packages/math/aug-package.json +1 -1
  236. package/native/compiler-packs.json +43 -0
  237. package/package.json +3 -2
  238. package/runtime/aug_http.c +48 -21
  239. package/runtime/aug_http_ir.c +30 -0
  240. package/runtime/aug_http_ir.h +18 -0
  241. package/runtime/aug_ir.c +209 -0
  242. package/runtime/aug_ir.h +89 -0
  243. package/runtime/aug_json.c +6 -1
  244. package/runtime/aug_runtime.c +82 -16
  245. package/runtime/aug_runtime.h +16 -2
  246. package/runtime/aug_tasks.c +38 -7
  247. package/runtime/aug_values.c +12 -6
  248. package/scripts/bootstrap-native.mjs +4 -1
  249. package/src/ast.js +1 -1
  250. package/src/checker.js +110 -28
  251. package/src/cli.js +92 -14
  252. package/src/codegen.js +31 -6
  253. package/src/compiler-packs.js +66 -0
  254. package/src/config.js +2 -2
  255. package/src/editor.js +15 -6
  256. package/src/formatter.js +4 -2
  257. package/src/git-http.js +137 -0
  258. package/src/git-packages.js +9 -1
  259. package/src/help.js +10 -2
  260. package/src/ir-types.js +5 -0
  261. package/src/ir-verify.js +277 -0
  262. package/src/ir.js +962 -0
  263. package/src/llvm-debug.js +101 -0
  264. package/src/llvm-native.js +152 -0
  265. package/src/llvm-platform.js +20 -0
  266. package/src/llvm.js +781 -0
  267. package/src/native-artifacts.js +207 -0
  268. package/src/native-bindings.js +189 -0
  269. package/src/native-contracts.js +295 -0
  270. package/src/native-declarations.js +68 -0
  271. package/src/native-facts.js +63 -0
  272. package/src/package-locking.js +43 -0
  273. package/src/package-manager.js +23 -8
  274. package/src/parser.js +20 -2
  275. package/src/project.js +2 -2
  276. package/src/runtime-abi.js +23 -0
  277. package/src/runtime-adapters.js +18 -0
  278. package/src/schemas.js +24 -17
  279. package/src/semantic.js +8 -3
  280. package/src/snippets.js +1 -0
  281. package/src/spec.js +49 -8
  282. /package/examples/approved-design/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
  283. /package/examples/approved-design/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
  284. /package/examples/developer-workflow/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
  285. /package/examples/developer-workflow/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
  286. /package/examples/generic-di/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
  287. /package/examples/generic-di/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
  288. /package/examples/hello/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
  289. /package/examples/hello/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
  290. /package/examples/interceptors/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
  291. /package/examples/interceptors/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
  292. /package/examples/new-syntax/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
  293. /package/examples/new-syntax/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
  294. /package/examples/ownership-transfer/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug +0 -0
  295. /package/examples/ownership-transfer/.aug-spec/august/{0.20.1 → 0.21.0}/io/contracts.aug.md +0 -0
@@ -0,0 +1,309 @@
1
+ {
2
+ "format": 1,
3
+ "compiler": "0.21.0",
4
+ "specifications": {
5
+ "url_db404a9d2d69617ca3ed": "https://github.com/GreenPandaStudios/aug-pytorch#v0.1.4"
6
+ },
7
+ "roots": {
8
+ "url_db404a9d2d69617ca3ed": "packages/url_db404a9d2d69617ca3ed"
9
+ },
10
+ "npm": {},
11
+ "git": [
12
+ {
13
+ "request": "https://github.com/GreenPandaStudios/aug-pytorch#v0.1.4",
14
+ "repository": "https://github.com/GreenPandaStudios/aug-pytorch.git",
15
+ "revision": "v0.1.4",
16
+ "folder": "",
17
+ "commit": "345c975b74a892ba1e0534503917e937dace6b87"
18
+ }
19
+ ],
20
+ "packages": [
21
+ {
22
+ "path": "packages/url_db404a9d2d69617ca3ed",
23
+ "name": "@greenpandastudios/aug-pytorch",
24
+ "version": "0.1.4",
25
+ "source": "src",
26
+ "digest": "4cf9a1763ba0a2c5fa3da6a47c13b39f0872952060e87f7692f5dad20417472a",
27
+ "dependencies": {},
28
+ "native": {
29
+ "profile": "aug-native-abi-1",
30
+ "bindings": "native.abi.json",
31
+ "bindingsSha256": "f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5",
32
+ "upstream": {
33
+ "repository": "https://github.com/pytorch/pytorch",
34
+ "version": "2.14.1",
35
+ "sourceRevision": "5c4886908584029761b579af026dcfb627c84070"
36
+ },
37
+ "artifacts": [
38
+ {
39
+ "id": "linux-arm64",
40
+ "target": {
41
+ "triple": "aarch64-unknown-linux-gnu",
42
+ "os": "linux",
43
+ "arch": "arm64",
44
+ "minimumLibc": "2.36",
45
+ "cpuBaseline": "armv8-a",
46
+ "libc": "glibc",
47
+ "cxxRuntime": "bundled-libstdc++",
48
+ "cxxABI": "itanium-cxx11",
49
+ "features": [
50
+ "cpu",
51
+ "float64"
52
+ ]
53
+ },
54
+ "url": "https://github.com/GreenPandaStudios/aug-pytorch/releases/download/v0.1.4/native-linux-arm64.tar.gz",
55
+ "sha256": "8eb7c5e30635949228548208bda1ac0a7c42801d2299a90ea4d4c2064e700573",
56
+ "maximumDownloadBytes": 205707311,
57
+ "maximumUnpackedBytes": 443080682,
58
+ "link": {
59
+ "kind": "dynamic",
60
+ "libraries": [
61
+ "lib/libaug_torch.so.1"
62
+ ]
63
+ },
64
+ "runtime": {
65
+ "files": [
66
+ "lib/libarm_compute.so",
67
+ "lib/libarm_compute_graph.so",
68
+ "lib/libaug_torch.so.1",
69
+ "lib/libc10.so",
70
+ "lib/libgcc_s.so.1",
71
+ "lib/libgfortran.so.5",
72
+ "lib/libgomp.so.1",
73
+ "lib/libopenblas.so.0",
74
+ "lib/libstdc++.so.6",
75
+ "lib/libtorch_cpu.so",
76
+ "lib/libz.so.1"
77
+ ],
78
+ "closureManifest": "runtime-files.json",
79
+ "relocation": "loader-relative"
80
+ },
81
+ "components": [
82
+ {
83
+ "id": "https://github.com/pytorch/pytorch",
84
+ "version": "2.14.1",
85
+ "compatibilityKey": "aug-pytorch-runtime",
86
+ "linkage": "dynamic",
87
+ "required": true
88
+ },
89
+ {
90
+ "id": "gcc-runtime",
91
+ "version": "12.2.0-14+deb12u1",
92
+ "compatibilityKey": "gcc-runtime",
93
+ "linkage": "dynamic",
94
+ "required": true
95
+ },
96
+ {
97
+ "id": "arm-compute",
98
+ "version": "53.2.0",
99
+ "compatibilityKey": "arm-compute",
100
+ "linkage": "dynamic",
101
+ "required": true
102
+ },
103
+ {
104
+ "id": "openblas",
105
+ "version": "0.3.34",
106
+ "compatibilityKey": "openblas",
107
+ "linkage": "dynamic",
108
+ "required": true
109
+ }
110
+ ],
111
+ "fileManifest": "files.json",
112
+ "provenance": "provenance.json",
113
+ "notices": "THIRD_PARTY_NOTICES.md"
114
+ },
115
+ {
116
+ "id": "linux-x64",
117
+ "target": {
118
+ "triple": "x86_64-unknown-linux-gnu",
119
+ "os": "linux",
120
+ "arch": "x64",
121
+ "minimumLibc": "2.36",
122
+ "cpuBaseline": "x86-64",
123
+ "libc": "glibc",
124
+ "cxxRuntime": "bundled-libstdc++",
125
+ "cxxABI": "itanium-cxx11",
126
+ "features": [
127
+ "cpu",
128
+ "float64"
129
+ ]
130
+ },
131
+ "url": "https://github.com/GreenPandaStudios/aug-pytorch/releases/download/v0.1.4/native-linux-x64.tar.gz",
132
+ "sha256": "e39d75858c158af03bae161d54b3a267b4fcf3dc4568be6467df72e472793f7b",
133
+ "maximumDownloadBytes": 207516626,
134
+ "maximumUnpackedBytes": 535024433,
135
+ "link": {
136
+ "kind": "dynamic",
137
+ "libraries": [
138
+ "lib/libaug_torch.so.1"
139
+ ]
140
+ },
141
+ "runtime": {
142
+ "files": [
143
+ "lib/libaug_torch.so.1",
144
+ "lib/libc10.so",
145
+ "lib/libgcc_s.so.1",
146
+ "lib/libgomp.so.1",
147
+ "lib/libstdc++.so.6",
148
+ "lib/libtorch_cpu.so"
149
+ ],
150
+ "closureManifest": "runtime-files.json",
151
+ "relocation": "loader-relative"
152
+ },
153
+ "components": [
154
+ {
155
+ "id": "https://github.com/pytorch/pytorch",
156
+ "version": "2.14.1",
157
+ "compatibilityKey": "aug-pytorch-runtime",
158
+ "linkage": "dynamic",
159
+ "required": true
160
+ },
161
+ {
162
+ "id": "gcc-runtime",
163
+ "version": "12.2.0-14+deb12u1",
164
+ "compatibilityKey": "gcc-runtime",
165
+ "linkage": "dynamic",
166
+ "required": true
167
+ }
168
+ ],
169
+ "fileManifest": "files.json",
170
+ "provenance": "provenance.json",
171
+ "notices": "THIRD_PARTY_NOTICES.md"
172
+ },
173
+ {
174
+ "id": "macos-arm64",
175
+ "target": {
176
+ "triple": "aarch64-apple-darwin",
177
+ "os": "macos",
178
+ "arch": "arm64",
179
+ "minimumOS": "14.0",
180
+ "cpuBaseline": "armv8-a",
181
+ "libc": "libSystem",
182
+ "cxxRuntime": "system-libc++",
183
+ "cxxABI": "apple-libc++",
184
+ "features": [
185
+ "cpu",
186
+ "float64"
187
+ ]
188
+ },
189
+ "url": "https://github.com/GreenPandaStudios/aug-pytorch/releases/download/v0.1.4/native-macos-arm64.tar.gz",
190
+ "sha256": "a130f4a67b574456e5eb0538dc099cb99e5356fdb47ebd4926da6f9b65ccb1e1",
191
+ "maximumDownloadBytes": 92487957,
192
+ "maximumUnpackedBytes": 388370911,
193
+ "link": {
194
+ "kind": "dynamic",
195
+ "libraries": [
196
+ "lib/libaug_torch.1.dylib"
197
+ ]
198
+ },
199
+ "runtime": {
200
+ "files": [
201
+ "lib/libaug_torch.1.dylib",
202
+ "lib/libc10.dylib",
203
+ "lib/libomp.dylib",
204
+ "lib/libtorch_cpu.dylib"
205
+ ],
206
+ "closureManifest": "runtime-files.json",
207
+ "relocation": "loader-relative"
208
+ },
209
+ "components": [
210
+ {
211
+ "id": "https://github.com/pytorch/pytorch",
212
+ "version": "2.14.1",
213
+ "compatibilityKey": "aug-pytorch-runtime",
214
+ "linkage": "dynamic",
215
+ "required": true
216
+ }
217
+ ],
218
+ "fileManifest": "files.json",
219
+ "provenance": "provenance.json",
220
+ "notices": "THIRD_PARTY_NOTICES.md"
221
+ }
222
+ ],
223
+ "sourceBuild": {
224
+ "recipe": "native/build.json",
225
+ "inputs": "native/sources.lock.json",
226
+ "tools": [
227
+ "Node 24+",
228
+ "Clang",
229
+ "macOS: Apple SDK",
230
+ "GNU/Linux: Docker with the pinned Debian 12 maintainer image and patchelf"
231
+ ],
232
+ "automatic": false
233
+ }
234
+ }
235
+ }
236
+ ],
237
+ "native": {
238
+ "format": 1,
239
+ "targets": {
240
+ "aarch64-apple-darwin/macos14": {
241
+ "target": {
242
+ "triple": "aarch64-apple-darwin",
243
+ "os": "macos",
244
+ "arch": "arm64",
245
+ "cpuBaseline": "armv8-a",
246
+ "libc": "libSystem",
247
+ "minimumOS": "26.0"
248
+ },
249
+ "packages": [
250
+ {
251
+ "sourcePackage": "@greenpandastudios/aug-pytorch@0.1.4",
252
+ "sourceDigest": "4cf9a1763ba0a2c5fa3da6a47c13b39f0872952060e87f7692f5dad20417472a",
253
+ "sourceCommit": "345c975b74a892ba1e0534503917e937dace6b87",
254
+ "contractSha256": "f07b8cab89ad7cfe368edcd9daf87ecc810adb6a2eed1f446d7b71fb664e91f5",
255
+ "artifact": {
256
+ "id": "macos-arm64",
257
+ "target": {
258
+ "triple": "aarch64-apple-darwin",
259
+ "os": "macos",
260
+ "arch": "arm64",
261
+ "minimumOS": "14.0",
262
+ "cpuBaseline": "armv8-a",
263
+ "libc": "libSystem",
264
+ "cxxRuntime": "system-libc++",
265
+ "cxxABI": "apple-libc++",
266
+ "features": [
267
+ "cpu",
268
+ "float64"
269
+ ]
270
+ },
271
+ "url": "https://github.com/GreenPandaStudios/aug-pytorch/releases/download/v0.1.4/native-macos-arm64.tar.gz",
272
+ "sha256": "a130f4a67b574456e5eb0538dc099cb99e5356fdb47ebd4926da6f9b65ccb1e1",
273
+ "maximumDownloadBytes": 92487957,
274
+ "maximumUnpackedBytes": 388370911,
275
+ "link": {
276
+ "kind": "dynamic",
277
+ "libraries": [
278
+ "lib/libaug_torch.1.dylib"
279
+ ]
280
+ },
281
+ "runtime": {
282
+ "files": [
283
+ "lib/libaug_torch.1.dylib",
284
+ "lib/libc10.dylib",
285
+ "lib/libomp.dylib",
286
+ "lib/libtorch_cpu.dylib"
287
+ ],
288
+ "closureManifest": "runtime-files.json",
289
+ "relocation": "loader-relative"
290
+ },
291
+ "components": [
292
+ {
293
+ "id": "https://github.com/pytorch/pytorch",
294
+ "version": "2.14.1",
295
+ "compatibilityKey": "aug-pytorch-runtime",
296
+ "linkage": "dynamic",
297
+ "required": true
298
+ }
299
+ ],
300
+ "fileManifest": "files.json",
301
+ "provenance": "provenance.json",
302
+ "notices": "THIRD_PARTY_NOTICES.md"
303
+ }
304
+ }
305
+ ]
306
+ }
307
+ }
308
+ }
309
+ }
@@ -0,0 +1,8 @@
1
+ // aug-spec: "main.aug.md" explains this file. Read it before changes; refresh with aug spec.
2
+ import calculate from tensors
3
+ import TensorError from "https://github.com/GreenPandaStudios/aug-pytorch#v0.1.4"
4
+
5
+ try:
6
+ print(value=calculate())
7
+ catch TensorError error:
8
+ print(value=error.message)
@@ -0,0 +1,13 @@
1
+ <!-- Generated by aug spec. Edit the August source, then regenerate. -->
2
+
3
+ # `main.aug`
4
+
5
+ ## Startup
6
+
7
+ It prints [`calculate`](tensors.aug.md#symbol-calculate). If this work raises [`TensorError`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md#symbol-TensorError) as `error`, it prints `error.message`.
8
+
9
+ ## Dependencies
10
+
11
+ It uses [`TensorError`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md#symbol-TensorError) (`message`) from `https://github.com/GreenPandaStudios/aug-pytorch#v0.1.4`. It uses [`calculate`](tensors.aug.md#symbol-calculate) from `tensors`.
12
+
13
+ Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
@@ -0,0 +1,23 @@
1
+ // aug-spec: "tensors.aug.md" explains this file. Read it before changes; refresh with aug spec.
2
+ import Tensor and TensorError and tensor and add and sum and values from "https://github.com/GreenPandaStudios/aug-pytorch#v0.1.4"
3
+
4
+ /** Add two CPU tensors using LibTorch and return the sum of their elements. */
5
+ calculate() returns float unless TensorError:
6
+ own Tensor left = tensor(values=[1.0, 2.0, 3.0])
7
+ own Tensor right = tensor(values=[4.0, 5.0, 6.0])
8
+ own Tensor result = add(left, right)
9
+ return sum(tensor=result)
10
+
11
+ test calculate:
12
+ when cpu:
13
+ it adds_and_reads_real_tensors:
14
+ own Tensor left = tensor(values=[1.0, 2.0, 3.0])
15
+ own Tensor right = tensor(values=[4.0, 5.0, 6.0])
16
+ own Tensor result = add(left, right)
17
+ List<float> output = values(tensor=result)
18
+ assert(output.length() == 3)
19
+ assert(output.get(index=0) == 5.0)
20
+ assert(output.get(index=1) == 7.0)
21
+ assert(output.get(index=2) == 9.0)
22
+ assert(sum(tensor=result) == 21.0)
23
+ assert(calculate() == 21.0)
@@ -0,0 +1,35 @@
1
+ <!-- Generated by aug spec. Edit the August source, then regenerate. -->
2
+
3
+ # `tensors.aug`
4
+
5
+ <a id="symbol-calculate"></a>
6
+ ## `calculate` · [source](tensors.aug#L5)
7
+
8
+ Add two CPU tensors using LibTorch and return the sum of their elements. Failures can raise [`TensorError`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md#symbol-TensorError).
9
+
10
+ It sets `left` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) to [`tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-tensor) with `values` from a list containing `1.0`, `2.0`, `3.0`. `left` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) owns this value. It sets `right` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) to [`tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-tensor) with `values` from a list containing `4.0`, `5.0`, `6.0`. `right` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) owns this value.
11
+
12
+ It sets `result` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) to [`add`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-add) with `left` and `right`. `result` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) owns this value. It returns [`sum`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-sum) with `tensor` from `result`.
13
+
14
+ <a id="symbol-test calculate"></a>
15
+ ## `test calculate` · [source](tensors.aug#L11)
16
+
17
+ Tests [`calculate`](tensors.aug.md#symbol-calculate). Each case gets fresh setup and dependencies.
18
+
19
+ ### `cpu`
20
+
21
+ #### `adds_and_reads_real_tensors` · [source](tensors.aug#L13)
22
+
23
+ It sets `left` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) to [`tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-tensor) with `values` from a list containing `1.0`, `2.0`, `3.0`. `left` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) owns this value. It sets `right` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) to [`tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-tensor) with `values` from a list containing `4.0`, `5.0`, `6.0`. `right` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) owns this value.
24
+
25
+ It sets `result` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) to [`add`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-add) with `left` and `right`. `result` of type [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor) owns this value. It sets `output` of type `List<float>` to [`values`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-values) with `tensor` from `result`. The test requires the number of elements in `output` equals `3`.
26
+
27
+ The test requires the item at index `0` in `output` equals `5.0`. The test requires the item at index `1` in `output` equals `7.0`. The test requires the item at index `2` in `output` equals `9.0`. The test requires [`sum`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-sum) with `tensor` from `result` equals `21.0`.
28
+
29
+ The test requires [`calculate`](tensors.aug.md#symbol-calculate) equals `21.0`.
30
+
31
+ ## Dependencies
32
+
33
+ It uses [`add`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-add), [`sum`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-sum), [`tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-tensor), [`values`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/api.aug.md#symbol-values), [`Tensor`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/bindings.aug.md#symbol-Tensor), and [`TensorError`](.aug-spec/packages/%40greenpandastudios/aug-pytorch/0.1.4/contracts.aug.md#symbol-TensorError) from `https://github.com/GreenPandaStudios/aug-pytorch#v0.1.4`.
34
+
35
+ Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).
@@ -0,0 +1,18 @@
1
+ {
2
+ "format": 1,
3
+ "files": [
4
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug",
5
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/api.aug.md",
6
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug",
7
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/bindings.aug.md",
8
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug",
9
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/contracts.aug.md",
10
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi.json",
11
+ "database.aug.md",
12
+ "main.aug.md"
13
+ ],
14
+ "nativeDescriptors": {
15
+ ".aug-spec/packages/@greenpandastudios/aug-sqlite/0.1.3/native.abi.json": "3c75c2925c85f1b83db06ee00fa04f1d2d37c9fd6edca0d074ce89b4647ffffb"
16
+ },
17
+ "digest": "ed7a20db7ca07240f85a285f7e52186ec864cb5fbeb2904ef19ab3f97140fa39"
18
+ }
@@ -0,0 +1,100 @@
1
+ {
2
+ "format": 1,
3
+ "profile": "aug-native-abi-1",
4
+ "resources": [
5
+ {
6
+ "module": "bindings",
7
+ "name": "Database",
8
+ "release": "aug_sqlite_release_v1"
9
+ }
10
+ ],
11
+ "functions": [
12
+ {
13
+ "module": "api",
14
+ "name": "_open",
15
+ "symbol": "aug_sqlite_open_v1",
16
+ "params": [
17
+ {
18
+ "name": "path",
19
+ "kind": "utf8"
20
+ }
21
+ ],
22
+ "result": {
23
+ "kind": "resource",
24
+ "resource": "bindings.Database"
25
+ },
26
+ "error": "contracts.SqliteError",
27
+ "callingConvention": "C",
28
+ "status": "i32",
29
+ "uses": [],
30
+ "changes": [],
31
+ "thread": "caller",
32
+ "retainsInputs": false
33
+ },
34
+ {
35
+ "module": "api",
36
+ "name": "_execute",
37
+ "symbol": "aug_sqlite_execute_v1",
38
+ "params": [
39
+ {
40
+ "name": "database",
41
+ "kind": "resource",
42
+ "resource": "bindings.Database",
43
+ "ownership": "borrow"
44
+ },
45
+ {
46
+ "name": "sql",
47
+ "kind": "utf8"
48
+ },
49
+ {
50
+ "name": "parameters",
51
+ "kind": "utf8-list"
52
+ }
53
+ ],
54
+ "result": {
55
+ "kind": "i64"
56
+ },
57
+ "error": "contracts.SqliteError",
58
+ "callingConvention": "C",
59
+ "status": "i32",
60
+ "uses": [],
61
+ "changes": [
62
+ "database"
63
+ ],
64
+ "thread": "caller",
65
+ "retainsInputs": false
66
+ },
67
+ {
68
+ "module": "api",
69
+ "name": "_queryScalar",
70
+ "symbol": "aug_sqlite_scalar_v1",
71
+ "params": [
72
+ {
73
+ "name": "database",
74
+ "kind": "resource",
75
+ "resource": "bindings.Database",
76
+ "ownership": "read"
77
+ },
78
+ {
79
+ "name": "sql",
80
+ "kind": "utf8"
81
+ },
82
+ {
83
+ "name": "parameters",
84
+ "kind": "utf8-list"
85
+ }
86
+ ],
87
+ "result": {
88
+ "kind": "utf8",
89
+ "release": "aug_sqlite_text_release_v1"
90
+ },
91
+ "error": "contracts.SqliteError",
92
+ "callingConvention": "C",
93
+ "status": "i32",
94
+ "uses": [],
95
+ "changes": [],
96
+ "thread": "caller",
97
+ "retainsInputs": false
98
+ }
99
+ ]
100
+ }
@@ -0,0 +1,48 @@
1
+ // Generated by aug spec. This is a copy of the installed dependency source.
2
+ // aug-spec: "api.aug.md" explains this file. Read it before changes; refresh with aug spec.
3
+ import Database from bindings
4
+ import SqliteError and DatabaseStorage from contracts
5
+ extern C _open(string path) returns own Database unless SqliteError
6
+ extern C _execute(borrow Database database, string sql, List<string> parameters) returns int unless SqliteError changes database
7
+ extern C _queryScalar(Database database, string sql, List<string> parameters) returns string unless SqliteError
8
+ /** Open a serialized connection. Use :memory: for an in-memory database. */
9
+ NativeDatabaseStorage() implements DatabaseStorage:
10
+ open(string path) returns own Database:
11
+ unsafe:
12
+ return _open(path)
13
+ open(resolve DatabaseStorage storage, string path) returns own Database:
14
+ return storage.open(path)
15
+ /** Open an in-memory database without filesystem permission. */
16
+ openMemory() returns own Database:
17
+ unsafe:
18
+ return _open(path=":memory:")
19
+ /** Execute one parameterized statement. Return the number of changed rows. */
20
+ execute(borrow Database database, string sql, List<string> parameters) returns int:
21
+ unsafe:
22
+ return _execute(database, sql, parameters)
23
+ /** Query one non-null text value with SELECT. Reject PRAGMAs, transactions, savepoints and writes before execution. Copy the result before finalization. */
24
+ queryScalar(Database database, string sql, List<string> parameters) returns string:
25
+ unsafe:
26
+ return _queryScalar(database, sql, parameters)
27
+
28
+ test openMemory:
29
+ when databases:
30
+ it binds_and_queries:
31
+ own Database database = openMemory()
32
+ borrow database:
33
+ execute(database, sql="CREATE TABLE users (name TEXT NOT NULL)", parameters=[])
34
+ execute(database, sql="INSERT INTO users (name) VALUES (?)", parameters=["O'Reilly"])
35
+ assert(queryScalar(database, sql="SELECT name FROM users", parameters=[]) == "O'Reilly")
36
+ it rejects_connection_and_transaction_control:
37
+ own Database database = openMemory()
38
+ for statement in ["PRAGMA query_only=ON", "BEGIN", "COMMIT", "ROLLBACK", "SAVEPOINT hidden"]:
39
+ rejected = false
40
+ try:
41
+ queryScalar(database, sql=statement, parameters=[])
42
+ catch SqliteError error:
43
+ rejected = error.code == 23
44
+ assert(rejected)
45
+ borrow database:
46
+ execute(database, sql="CREATE TABLE rows (value TEXT)", parameters=[])
47
+ execute(database, sql="INSERT INTO rows VALUES (?)", parameters=["unchanged"])
48
+ assert(queryScalar(database, sql="SELECT value FROM rows", parameters=[]) == "unchanged")
@@ -0,0 +1,91 @@
1
+ <!-- Generated by aug spec. Edit the August source, then regenerate. -->
2
+
3
+ # `api.aug`
4
+
5
+ <a id="symbol-NativeDatabaseStorage"></a>
6
+ ## `NativeDatabaseStorage` · class · [source](api.aug#L9)
7
+
8
+ Open a serialized connection. Use :memory: for an in-memory database. It implements [`DatabaseStorage`](contracts.aug.md#symbol-DatabaseStorage).
9
+
10
+ <a id="symbol-NativeDatabaseStorage.open"></a>
11
+ ### `NativeDatabaseStorage.open` · [source](api.aug#L10)
12
+
13
+ It takes `path` as a string. It returns ownership of [`Database`](bindings.aug.md#symbol-Database). Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError).
14
+
15
+ Within an unsafe block, it returns [`_open`](api.aug.md#symbol-_open) with `path`. Native operations must satisfy their declared C contracts.
16
+
17
+ <a id="symbol-open"></a>
18
+ ## `open` · [source](api.aug#L13)
19
+
20
+ It takes `path` as a string. It gets `storage` ([`DatabaseStorage`](contracts.aug.md#symbol-DatabaseStorage)) from dependency injection. It returns ownership of [`Database`](bindings.aug.md#symbol-Database). Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError).
21
+
22
+ It returns [`storage.open`](contracts.aug.md#symbol-DatabaseStorage.open) with `path`.
23
+
24
+ <a id="symbol-openMemory"></a>
25
+ ## `openMemory` · [source](api.aug#L16)
26
+
27
+ Open an in-memory database without filesystem permission. It returns ownership of [`Database`](bindings.aug.md#symbol-Database). Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError).
28
+
29
+ Within an unsafe block, it returns [`_open`](api.aug.md#symbol-_open) with `path` `":memory:"`. Native operations must satisfy their declared C contracts.
30
+
31
+ <a id="symbol-execute"></a>
32
+ ## `execute` · [source](api.aug#L20)
33
+
34
+ Execute one parameterized statement. Return the number of changed rows. It takes `database` as [`Database`](bindings.aug.md#symbol-Database) with permission to mutate it during the call, `sql` as a string, and `parameters` as `List<string>`.
35
+
36
+ It may change `database`. Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError). Within an unsafe block, it returns [`_execute`](api.aug.md#symbol-_execute) with `database`, `sql`, and `parameters`. Native operations must satisfy their declared C contracts.
37
+
38
+ <a id="symbol-queryScalar"></a>
39
+ ## `queryScalar` · [source](api.aug#L24)
40
+
41
+ Query one non-null text value with SELECT. Reject PRAGMAs, transactions, savepoints and writes before execution. Copy the result before finalization. It takes `database` as [`Database`](bindings.aug.md#symbol-Database), `sql` as a string, and `parameters` as `List<string>`.
42
+
43
+ Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError). Within an unsafe block, it returns [`_queryScalar`](api.aug.md#symbol-_queryScalar) with `database`, `sql`, and `parameters`. Native operations must satisfy their declared C contracts.
44
+
45
+ <a id="symbol-_open"></a>
46
+ ## `_open` · [source](api.aug#L5)
47
+
48
+ It is private to its defining scope. It takes `path` as a string. It returns ownership of [`Database`](bindings.aug.md#symbol-Database). Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError).
49
+
50
+ Native implementation: `@greenpandastudios/aug-sqlite@0.1.3`, `3.53.4`. Supported targets: linux arm64 glibc 2.36+, linux x64 glibc 2.36+, macos arm64 14.0+. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `3c75c2925c85f1b83db06ee00fa04f1d2d37c9fd6edca0d074ce89b4647ffffb`). It calls `aug_sqlite_open_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. The caller owns the returned handle. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
51
+
52
+ <a id="symbol-_execute"></a>
53
+ ## `_execute` · [source](api.aug#L6)
54
+
55
+ It is private to its defining scope. It takes `database` as [`Database`](bindings.aug.md#symbol-Database) with permission to mutate it during the call, `sql` as a string, and `parameters` as `List<string>`.
56
+
57
+ It returns `int`. It may change `database`. Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError).
58
+
59
+ Native implementation: `@greenpandastudios/aug-sqlite@0.1.3`, `3.53.4`. Supported targets: linux arm64 glibc 2.36+, linux x64 glibc 2.36+, macos arm64 14.0+. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `3c75c2925c85f1b83db06ee00fa04f1d2d37c9fd6edca0d074ce89b4647ffffb`). It calls `aug_sqlite_execute_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. `database` lends mutable access for this call. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
60
+
61
+ <a id="symbol-_queryScalar"></a>
62
+ ## `_queryScalar` · [source](api.aug#L7)
63
+
64
+ It is private to its defining scope. It takes `database` as [`Database`](bindings.aug.md#symbol-Database), `sql` as a string, and `parameters` as `List<string>`. It returns `string`. Failures can raise [`SqliteError`](contracts.aug.md#symbol-SqliteError).
65
+
66
+ Native implementation: `@greenpandastudios/aug-sqlite@0.1.3`, `3.53.4`. Supported targets: linux arm64 glibc 2.36+, linux x64 glibc 2.36+, macos arm64 14.0+. Binding contract: [`native.abi.json`](native.abi.json) (SHA-256 `3c75c2925c85f1b83db06ee00fa04f1d2d37c9fd6edca0d074ce89b4647ffffb`). It calls `aug_sqlite_scalar_v1` through the C ABI on the caller thread; a blocking native call blocks that thread. `database` lends read access for this call. August copies the returned buffer, then calls `aug_sqlite_text_release_v1` to release it. The compiler checks the provider, descriptor digest, signature and ownership at August call sites. The native author promises not to retain inputs, enter August from foreign threads, or unwind across the C boundary; internal native workers may run. The compiler does not prove those promises.
67
+
68
+ <a id="symbol-test openMemory"></a>
69
+ ## `test openMemory` · [source](api.aug#L28)
70
+
71
+ Tests [`openMemory`](api.aug.md#symbol-openMemory). Each case gets fresh setup and dependencies.
72
+
73
+ ### `databases`
74
+
75
+ #### `binds_and_queries` · [source](api.aug#L30)
76
+
77
+ It gets `database` of type [`Database`](bindings.aug.md#symbol-Database) from [`openMemory`](api.aug.md#symbol-openMemory). `database` of type [`Database`](bindings.aug.md#symbol-Database) owns this value. With temporary permission to change `database`, it calls [`execute`](api.aug.md#symbol-execute) with `database`, `sql` `"CREATE TABLE users (name TEXT NOT NULL)"`, and `parameters` from a list with no items; then it calls [`execute`](api.aug.md#symbol-execute) with `database`, `sql` `"INSERT INTO users (name) VALUES (?)"`, and `parameters` from a list containing `"O'Reilly"`. The test requires [`queryScalar`](api.aug.md#symbol-queryScalar) with `database`, `sql` `"SELECT name FROM users"`, and `parameters` from a list with no items equals `"O'Reilly"`.
78
+
79
+ #### `rejects_connection_and_transaction_control` · [source](api.aug#L36)
80
+
81
+ It gets `database` of type [`Database`](bindings.aug.md#symbol-Database) from [`openMemory`](api.aug.md#symbol-openMemory). `database` of type [`Database`](bindings.aug.md#symbol-Database) owns this value. For each `statement` in a snapshot of a list containing `"PRAGMA query_only=ON"`, `"BEGIN"`, `"COMMIT"`, `"ROLLBACK"`, `"SAVEPOINT hidden"`, it sets `rejected` to `false`.
82
+
83
+ It tries to call [`queryScalar`](api.aug.md#symbol-queryScalar) with `database`, `sql` from `statement`, and `parameters` from a list with no items. If this work raises [`SqliteError`](contracts.aug.md#symbol-SqliteError) as `error`, it sets `rejected` to `error.code` equals `23`. The test requires `rejected` is true. After the loop, with temporary permission to change `database`, it calls [`execute`](api.aug.md#symbol-execute) with `database`, `sql` `"CREATE TABLE rows (value TEXT)"`, and `parameters` from a list with no items; then it calls [`execute`](api.aug.md#symbol-execute) with `database`, `sql` `"INSERT INTO rows VALUES (?)"`, and `parameters` from a list containing `"unchanged"`.
84
+
85
+ The test requires [`queryScalar`](api.aug.md#symbol-queryScalar) with `database`, `sql` `"SELECT value FROM rows"`, and `parameters` from a list with no items equals `"unchanged"`.
86
+
87
+ ## Dependencies
88
+
89
+ It uses [`Database`](bindings.aug.md#symbol-Database) from `bindings`. It uses [`DatabaseStorage`](contracts.aug.md#symbol-DatabaseStorage) ([`open`](contracts.aug.md#symbol-DatabaseStorage.open)) and [`SqliteError`](contracts.aug.md#symbol-SqliteError) from `contracts`.
90
+
91
+ Built-in operations follow the [language reference](https://greenpandastudios.github.io/augscript/language-constructs).