Skip to content

Commit 5a3d256

Browse files
authored
Merge pull request #42 from alexcrichton/less-verbose
Adjust canonical ABI option syntax to be less verbose
2 parents d02c15d + 7d29dee commit 5a3d256

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

design/mvp/Explainer.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -616,9 +616,9 @@ canon ::= (canon lift core-prefix(<core:funcidx>) <canonopt>* bind-id(<extern
616616
canonopt ::= string-encoding=utf8
617617
| string-encoding=utf16
618618
| string-encoding=latin1+utf16
619-
| (memory core-prefix(<core:memidx>))
620-
| (realloc core-prefix(<core:funcidx>))
621-
| (post-return core-prefix(<core:funcidx>))
619+
| (memory <core:memidx>)
620+
| (realloc <core:funcidx>)
621+
| (post-return <core:funcidx>)
622622
```
623623
While the production `externdesc` accepts any `sort`, the validation rules
624624
for `canon lift` would only allow the `func` sort. In the future, other sorts
@@ -697,7 +697,7 @@ takes a string, does some logging, then returns a string.
697697
(core instance $libc (instantiate $Libc))
698698
(core func $log (canon lower
699699
(func $logging "log")
700-
(memory (core memory $libc "mem")) (realloc (core func $libc "realloc"))
700+
(memory (core memory $libc "mem")) (realloc (func $libc "realloc"))
701701
))
702702
(core module $Main
703703
(import "libc" "memory" (memory 1))
@@ -713,7 +713,7 @@ takes a string, does some logging, then returns a string.
713713
))
714714
(func $run (param string) (result string) (canon lift
715715
(core func $main "run")
716-
(memory (core memory $libc "mem")) (realloc (core func $libc "realloc"))
716+
(memory $libc "mem") (realloc (func $libc "realloc"))
717717
))
718718
(export "run" (func $run))
719719
)
@@ -770,7 +770,7 @@ exported string at instantiation time:
770770
(core instance $main (instantiate $Main (with "libc" (instance $libc))))
771771
(func $start (param string) (result string) (canon lift
772772
(core func $main "start")
773-
(memory (core memory $libc "mem")) (realloc (core func $libc "realloc"))
773+
(memory $libc "mem") (realloc (func $libc "realloc"))
774774
))
775775
(start $start (value $name) (result (value $greeting)))
776776
(export "greeting" (value $greeting))

design/mvp/examples/SharedEverythingDynamicLinking.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ would look like:
159159
))
160160
(func $zip (param (list u8)) (result (list u8)) (canon lift
161161
(func $main "zip")
162-
(memory (memory $libc "memory")) (realloc (func $libc "realloc"))
162+
(memory $libc "memory") (realloc (func $libc "realloc"))
163163
))
164164
(export "zip" (func $zip))
165165
)
@@ -238,7 +238,7 @@ component-aware `clang`, the resulting component would look like:
238238
))
239239
(func $transform (param (list u8)) (result (list u8)) (canon lift
240240
(func $main "transform")
241-
(memory (memory $libc "memory")) (realloc (func $libc "realloc"))
241+
(memory $libc "memory") (realloc (func $libc "realloc"))
242242
))
243243
(export "transform" (func $transform))
244244
)
@@ -285,11 +285,11 @@ components. The resulting component could look like:
285285
(instance $libc (instantiate (module $Libc)))
286286
(func $zip (canon lower
287287
(func $zipper "zip")
288-
(memory (memory $libc "memory")) (realloc (func $libc "realloc"))
288+
(memory $libc "memory") (realloc (func $libc "realloc"))
289289
))
290290
(func $transform (canon lower
291291
(func $imgmgk "transform")
292-
(memory (memory $libc "memory")) (realloc (func $libc "realloc"))
292+
(memory $libc "memory") (realloc (func $libc "realloc"))
293293
))
294294
(instance $main (instantiate (module $Main)
295295
(with "libc" (instance $libc))
@@ -298,7 +298,7 @@ components. The resulting component could look like:
298298
))
299299
(func $run (param string) (result string) (canon lift
300300
(func $main "run")
301-
(memory (memory $libc "memory")) (realloc (func $libc "realloc"))
301+
(memory $libc "memory") (realloc (func $libc "realloc"))
302302
))
303303
(export "run" (func $run))
304304
)

0 commit comments

Comments
 (0)