@grain/binaryen.ml 0.9.0 → 0.11.1

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 (135) hide show
  1. binaryen-archive/.gitignore +1 -0
  2. binaryen-archive/CHANGELOG.md +73 -0
  3. binaryen-archive/README.md +27 -3
  4. binaryen-archive/binaryen.opam +8 -8
  5. binaryen-archive/esy.lock/index.json +537 -460
  6. binaryen-archive/esy.lock/opam/{base.v0.14.1 → base.v0.14.2}/opam +4 -4
  7. binaryen-archive/esy.lock/opam/biniou.1.2.1/opam +1 -1
  8. binaryen-archive/esy.lock/opam/{cppo.1.6.7 → cppo.1.6.8}/opam +4 -6
  9. binaryen-archive/esy.lock/opam/{csexp.1.4.0 → csexp.1.5.1}/opam +11 -9
  10. binaryen-archive/esy.lock/opam/{dune-build-info.2.8.2 → dune-build-info.2.9.1}/opam +5 -5
  11. binaryen-archive/esy.lock/opam/{dune-configurator.2.8.2 → dune-configurator.2.9.1}/opam +5 -5
  12. binaryen-archive/esy.lock/opam/{dune.2.8.2 → dune.2.9.1}/opam +4 -4
  13. binaryen-archive/esy.lock/opam/easy-format.1.3.2/opam +1 -1
  14. binaryen-archive/esy.lock/opam/{fix.20201120 → fix.20211231}/opam +7 -5
  15. binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.11.0/opam +54 -0
  16. binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.11.0/opam +44 -0
  17. binaryen-archive/esy.lock/opam/js_of_ocaml.3.11.0/opam +45 -0
  18. binaryen-archive/esy.lock/opam/{menhir.20201216 → menhir.20211128}/opam +8 -6
  19. binaryen-archive/esy.lock/opam/{menhirLib.20201216 → menhirLib.20211128}/opam +8 -6
  20. binaryen-archive/esy.lock/opam/{menhirSdk.20201216 → menhirSdk.20211128}/opam +8 -6
  21. binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.4/opam +39 -0
  22. binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.4.0 → ocaml-lsp-server.1.9.0}/opam +15 -12
  23. binaryen-archive/esy.lock/opam/{ocaml-migrate-parsetree.2.1.0 → ocaml-migrate-parsetree.2.3.0}/opam +13 -10
  24. binaryen-archive/esy.lock/opam/ocaml-version.3.4.0/opam +49 -0
  25. binaryen-archive/esy.lock/opam/ocamlbuild.0.14.0/opam +1 -1
  26. binaryen-archive/esy.lock/opam/{ocamlfind.1.8.1 → ocamlfind.1.9.1}/opam +19 -39
  27. binaryen-archive/esy.lock/opam/ocamlformat-rpc-lib.0.19.0/opam +40 -0
  28. binaryen-archive/esy.lock/opam/ocamlformat.0.18.0/opam +56 -0
  29. binaryen-archive/esy.lock/opam/{odoc.1.5.2 → odoc.1.5.3}/opam +12 -12
  30. binaryen-archive/esy.lock/opam/pp.1.1.2/opam +58 -0
  31. binaryen-archive/esy.lock/opam/ppx_derivers.1.2.1/opam +1 -1
  32. binaryen-archive/esy.lock/opam/ppx_yojson_conv_lib.v0.14.0/opam +2 -2
  33. binaryen-archive/esy.lock/opam/{ppxlib.0.21.0 → ppxlib.0.22.2}/opam +40 -32
  34. binaryen-archive/esy.lock/opam/{re.1.9.0 → re.1.10.3}/opam +8 -4
  35. binaryen-archive/esy.lock/opam/result.1.5/opam +2 -2
  36. binaryen-archive/esy.lock/opam/sexplib0.v0.14.0/opam +2 -2
  37. binaryen-archive/esy.lock/opam/spawn.v0.15.0/opam +56 -0
  38. binaryen-archive/esy.lock/opam/stdio.v0.14.0/opam +2 -2
  39. binaryen-archive/esy.lock/opam/{topkg.1.0.3 → topkg.1.0.4}/opam +18 -22
  40. binaryen-archive/esy.lock/opam/tyxml.4.5.0/opam +42 -0
  41. binaryen-archive/esy.lock/opam/uucp.14.0.0/opam +41 -0
  42. binaryen-archive/esy.lock/opam/{uuseg.13.0.0 → uuseg.14.0.0}/opam +22 -28
  43. binaryen-archive/esy.lock/opam/yojson.1.7.0/opam +1 -1
  44. binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override/files/findlib-1.8.1.patch → opam__s__ocamlfind_opam__c__1.9.1_opam_override/files/findlib-1.9.1.patch} +0 -0
  45. binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.8.1_opam_override → opam__s__ocamlfind_opam__c__1.9.1_opam_override}/package.json +1 -1
  46. binaryen-archive/js/binaryen.es5.js +5 -0
  47. binaryen-archive/js/dune +1 -6
  48. binaryen-archive/js/element_segment.ml +33 -0
  49. binaryen-archive/js/export.ml +37 -0
  50. binaryen-archive/js/expression.ml +935 -177
  51. binaryen-archive/js/function.ml +31 -0
  52. binaryen-archive/js/global.ml +29 -0
  53. binaryen-archive/js/import.ml +24 -0
  54. binaryen-archive/js/literal.ml +8 -4
  55. binaryen-archive/js/module.ml +42 -46
  56. binaryen-archive/js/op.ml +9 -78
  57. binaryen-archive/js/settings.ml +60 -0
  58. binaryen-archive/js/table.ml +20 -3
  59. binaryen-archive/js/type.ml +3 -0
  60. binaryen-archive/package.json +14 -20
  61. binaryen-archive/src/binaryen_stubs_exports.c +78 -0
  62. binaryen-archive/src/binaryen_stubs_expressions.c +1300 -0
  63. binaryen-archive/src/binaryen_stubs_features.c +7 -0
  64. binaryen-archive/src/binaryen_stubs_functions.c +78 -0
  65. binaryen-archive/src/binaryen_stubs_globals.c +63 -0
  66. binaryen-archive/src/binaryen_stubs_imports.c +29 -0
  67. binaryen-archive/src/binaryen_stubs_memory.c +1 -1
  68. binaryen-archive/src/binaryen_stubs_modules.c +0 -122
  69. binaryen-archive/src/binaryen_stubs_ops.c +19 -173
  70. binaryen-archive/src/binaryen_stubs_settings.c +145 -0
  71. binaryen-archive/src/binaryen_stubs_tables.c +121 -7
  72. binaryen-archive/src/binaryen_stubs_types.c +18 -0
  73. binaryen-archive/src/dune +5 -44
  74. binaryen-archive/src/element_segment.ml +13 -0
  75. binaryen-archive/src/export.ml +33 -0
  76. binaryen-archive/src/expression.ml +805 -76
  77. binaryen-archive/src/function.ml +18 -0
  78. binaryen-archive/src/global.ml +14 -0
  79. binaryen-archive/src/import.ml +12 -0
  80. binaryen-archive/src/literal.ml +2 -2
  81. binaryen-archive/src/module.ml +64 -38
  82. binaryen-archive/src/ocaml_helpers.c +0 -8
  83. binaryen-archive/src/ocaml_helpers.h +2 -3
  84. binaryen-archive/src/op.ml +18 -131
  85. binaryen-archive/src/settings.ml +45 -0
  86. binaryen-archive/src/table.ml +26 -4
  87. binaryen-archive/src/type.ml +2 -0
  88. binaryen-archive/test/config/dune +8 -0
  89. binaryen-archive/test/config/ocamlopt_flags.ml +16 -0
  90. binaryen-archive/test/dune +4 -0
  91. binaryen-archive/test/test.expected +38 -3
  92. binaryen-archive/test/test.ml +90 -18
  93. binaryen-archive/virtual/dune +2 -2
  94. binaryen-archive/virtual/element_segment.mli +11 -0
  95. binaryen-archive/virtual/export.mli +22 -0
  96. binaryen-archive/virtual/expression.mli +389 -34
  97. binaryen-archive/virtual/function.mli +16 -0
  98. binaryen-archive/virtual/global.mli +12 -0
  99. binaryen-archive/virtual/import.mli +8 -0
  100. binaryen-archive/virtual/literal.mli +2 -2
  101. binaryen-archive/virtual/module.mli +25 -27
  102. binaryen-archive/virtual/op.mli +9 -53
  103. binaryen-archive/virtual/settings.mli +35 -0
  104. binaryen-archive/virtual/table.mli +19 -2
  105. binaryen-archive/virtual/type.mli +2 -0
  106. binaryen-archive/esy.lock/opam/conf-m4.1/opam +0 -22
  107. binaryen-archive/esy.lock/opam/dot-merlin-reader.4.1/opam +0 -30
  108. binaryen-archive/esy.lock/opam/js_of_ocaml-compiler.3.9.1/opam +0 -40
  109. binaryen-archive/esy.lock/opam/js_of_ocaml-ppx.3.9.0/opam +0 -30
  110. binaryen-archive/esy.lock/opam/js_of_ocaml.3.9.0/opam +0 -31
  111. binaryen-archive/esy.lock/opam/ocaml-compiler-libs.v0.12.3/opam +0 -29
  112. binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocaml-stub +0 -4
  113. binaryen-archive/esy.lock/opam/ocamlfind.1.8.1/files/ocamlfind.install +0 -6
  114. binaryen-archive/esy.lock/opam/ocamlformat.0.15.1/opam +0 -41
  115. binaryen-archive/esy.lock/opam/tyxml.4.4.0/opam +0 -47
  116. binaryen-archive/esy.lock/opam/uucp.13.0.0/opam +0 -44
  117. binaryen-archive/esy.lock/overrides/opam__s__conf_m4_opam__c__1_opam_override/package.json +0 -6
  118. binaryen-archive/js/features.ml +0 -27
  119. binaryen-archive/js/function_table.ml +0 -13
  120. binaryen-archive/src/binaryen_stubs_function_tables.c +0 -25
  121. binaryen-archive/src/config/dune +0 -8
  122. binaryen-archive/src/config/library_flags.ml +0 -16
  123. binaryen-archive/src/features.ml +0 -49
  124. binaryen-archive/src/function_table.ml +0 -6
  125. binaryen-archive/vendor/binaryen-c.h +0 -2647
  126. binaryen-archive/vendor/js/index.es5.js +0 -5
  127. binaryen-archive/vendor/linux/libbinaryen.a +0 -0
  128. binaryen-archive/vendor/linux/libbinaryen.so +0 -0
  129. binaryen-archive/vendor/macosx/libbinaryen.a +0 -0
  130. binaryen-archive/vendor/macosx/libbinaryen.dylib +0 -0
  131. binaryen-archive/vendor/mingw64/libbinaryen.a +0 -0
  132. binaryen-archive/vendor/mingw64/libbinaryen.dll +0 -0
  133. binaryen-archive/vendor/wasm-delegations.h +0 -85
  134. binaryen-archive/virtual/features.mli +0 -23
  135. binaryen-archive/virtual/function_table.mli +0 -4
@@ -1,5 +1,6 @@
1
1
  node_modules/
2
2
  _esy/
3
+ _build/
3
4
  .merlin
4
5
  META
5
6
  .vscode/
@@ -1,5 +1,78 @@
1
1
  # Changelog
2
2
 
3
+ ### [0.11.1](https://www.github.com/grain-lang/binaryen.ml/compare/v0.11.0...v0.11.1) (2022-01-16)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * Make features work in 32-bit mode ([#123](https://www.github.com/grain-lang/binaryen.ml/issues/123)) ([e435c8b](https://www.github.com/grain-lang/binaryen.ml/commit/e435c8bd9f6619c42b82e53e5d1caa929b5d4ebf))
9
+
10
+ ## [0.11.0](https://www.github.com/grain-lang/binaryen.ml/compare/v0.10.0...v0.11.0) (2022-01-13)
11
+
12
+
13
+ ### ⚠ BREAKING CHANGES
14
+
15
+ * Mention implicit python dependency in the docs
16
+ * Switch to libbinaryen dependency (#113)
17
+ * Remove MacOS-specific library flags (#111)
18
+ * Require OCaml 4.12 (#108)
19
+
20
+ ### Features
21
+
22
+ * Depend on libbinaryen ([59874ce](https://www.github.com/grain-lang/binaryen.ml/commit/59874ce785288d4a33ed5408ac4a0a33e16ff4c1))
23
+ * Remove MacOS-specific library flags ([#111](https://www.github.com/grain-lang/binaryen.ml/issues/111)) ([5a67f9f](https://www.github.com/grain-lang/binaryen.ml/commit/5a67f9f330332f8957976841819707d09124dc94))
24
+ * Require OCaml 4.12 ([#108](https://www.github.com/grain-lang/binaryen.ml/issues/108)) ([36eedea](https://www.github.com/grain-lang/binaryen.ml/commit/36eedea279fb19ee6131b72b21c24ba0a9d7f993))
25
+ * Switch to libbinaryen dependency ([#113](https://www.github.com/grain-lang/binaryen.ml/issues/113)) ([59874ce](https://www.github.com/grain-lang/binaryen.ml/commit/59874ce785288d4a33ed5408ac4a0a33e16ff4c1))
26
+
27
+
28
+ ### Miscellaneous Chores
29
+
30
+ * Mention implicit python dependency in the docs ([59874ce](https://www.github.com/grain-lang/binaryen.ml/commit/59874ce785288d4a33ed5408ac4a0a33e16ff4c1))
31
+
32
+ ## [0.10.0](https://www.github.com/grain-lang/binaryen.ml/compare/v0.9.1...v0.10.0) (2021-05-09)
33
+
34
+
35
+ ### ⚠ BREAKING CHANGES
36
+
37
+ * Move expressions into namespaces
38
+ * Move element segment into own module
39
+ * Move `Features` into `Module.Feature`
40
+ * Create Settings modules & move global functions
41
+ * Convert some Settings from ints to bools
42
+ * Remove SIMD methods that Binaryen replaced
43
+ * Upgrade Binaryen to v101 (#99)
44
+
45
+ ### Features
46
+
47
+ * Add `Module.get_features` ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
48
+ * Add `Type.expandType` ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
49
+ * Add operations on element segments ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
50
+ * Add operations on exports ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
51
+ * Add operations on expressions ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
52
+ * Add operations on functions ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
53
+ * Add operations on globals ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
54
+ * Add operations on imports ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
55
+ * Add support for reference types ([#101](https://www.github.com/grain-lang/binaryen.ml/issues/101)) ([5058492](https://www.github.com/grain-lang/binaryen.ml/commit/50584929466b7aae5f7c9b48b8b9bab5676ed53e))
56
+ * Build vendored Binaryen with GCC 7 instead of 9 ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
57
+ * Convert some Settings from ints to bools ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
58
+ * Create Settings modules & move global functions ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
59
+ * Move `Features` into `Module.Feature` ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
60
+ * Move element segment into own module ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
61
+ * Move expressions into namespaces ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
62
+ * Upgrade Binaryen to v101 ([#99](https://www.github.com/grain-lang/binaryen.ml/issues/99)) ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
63
+
64
+
65
+ ### Miscellaneous Chores
66
+
67
+ * Remove SIMD methods that Binaryen replaced ([3de1b28](https://www.github.com/grain-lang/binaryen.ml/commit/3de1b289ed4673f701801f3087e48ac9746d89d1))
68
+
69
+ ### [0.9.1](https://www.github.com/grain-lang/binaryen.ml/compare/v0.9.0...v0.9.1) (2021-04-02)
70
+
71
+
72
+ ### Bug Fixes
73
+
74
+ * Correct JS conversion of i64 & float64_bits literals ([#96](https://www.github.com/grain-lang/binaryen.ml/issues/96)) ([00b7093](https://www.github.com/grain-lang/binaryen.ml/commit/00b7093ad57c7698ff7f6e69f59fd426ee341fbf))
75
+
3
76
  ## [0.9.0](https://www.github.com/grain-lang/binaryen.ml/compare/v0.8.1...v0.9.0) (2021-03-17)
4
77
 
5
78
 
@@ -18,9 +18,9 @@ let params = Type.create [| Type.int32; Type.int32 |]
18
18
  let results = Type.int32
19
19
 
20
20
  (* Get arguments 0 and 1, add them *)
21
- let x = Expression.local_get wasm_mod 0 Type.int32
22
- let y = Expression.local_get wasm_mod 1 Type.int32
23
- let add = Expression.binary wasm_mod Op.add_int32 x y
21
+ let x = Expression.Local_get.make wasm_mod 0 Type.int32
22
+ let y = Expression.Local_get.make wasm_mod 1 Type.int32
23
+ let add = Expression.Binary.make wasm_mod Op.add_int32 x y
24
24
 
25
25
  (* Create the add function *)
26
26
  (* Note: no additional local variables *)
@@ -42,6 +42,30 @@ This project aims to provide full feature parity with the [Binaryen C API](https
42
42
 
43
43
  None of these are particularly challenging to create bindings for—they just haven't been written yet. If you need anything that's missing, feel free to open a PR.
44
44
 
45
+ ## Python dependency
46
+
47
+ When using this package with `esy`, you'll need to ensure that a `python` executable exists in one of these locations: `/usr/local/bin/python`, `/usr/bin/python`, `/bin/python`, `/usr/sbin/python`, or `/sbin/python`. Esy will only look for python in those locations, and it is not provided for you in the sandbox.
48
+
49
+ **Note:** This implicit dependency will be removed in a future version.
50
+
51
+ ## MacOS C++ Compiler
52
+
53
+ When including this library in your `dune` MacOS executables, you'll need to specify `-cc clang++` in your `(ocamlopt_flags)` stanza. This is required because Binaryen will throw errors for itself to catch and using `clang++` is the only way to handle them correctly. You can find more info on this [ocaml issue](https://github.com/ocaml/ocaml/issues/10423).
54
+
55
+ Your stanza could look something like this:
56
+
57
+ ```diff
58
+ (executable
59
+ (name example)
60
+ (public_name example)
61
+ (package example)
62
+ + (ocamlopt_flags -cc clang++)
63
+ (modules example)
64
+ (libraries binaryen))
65
+ ```
66
+
67
+ These flags likely won't work on other operating systems, so you'll probably need to use `dune-configurator` to vary the flags per platform. You can see an example of this in our [tests/](./tests/dune).
68
+
45
69
  ## Static Linking
46
70
 
47
71
  If you are planning to create portable binaries for Windows, it will try to find Cygwin/MinGW locations in your `PATH`. To avoid this, you probably want to add this to your `(executable)` stanzas:
@@ -1,5 +1,5 @@
1
1
  opam-version: "2.0"
2
- version: "0.9.0"
2
+ version: "0.11.1"
3
3
  synopsis: "OCaml bindings for Binaryen"
4
4
  maintainer: "oscar@grain-lang.org"
5
5
  author: "Oscar Spencer"
@@ -12,11 +12,11 @@ build: [
12
12
  [ "dune" "build" "-p" name "-j" jobs ]
13
13
  ]
14
14
  depends: [
15
- "ocaml" {>= "4.09"}
16
- "dune" {>= "2.7.1"}
17
- "dune-configurator" {>= "2.7.1"}
18
- "js_of_ocaml" {>= "3.6.0"}
19
- "js_of_ocaml-ppx" {>= "3.6.0"}
20
- "js_of_ocaml-compiler" {>= "3.6.0"}
15
+ "ocaml" {>= "4.12"}
16
+ "dune" {>= "2.9.1"}
17
+ "dune-configurator" {>= "2.9.1"}
18
+ "js_of_ocaml" {>= "3.10.0"}
19
+ "js_of_ocaml-ppx" {>= "3.10.0"}
20
+ "js_of_ocaml-compiler" {>= "3.10.0"}
21
+ "libbinaryen" {>= "101.0.1" < "102.0.0"}
21
22
  ]
22
- available: arch = "x86_64" & (os = "linux" | os = "macos" | os = "win32")