@grain/binaryen.ml 0.16.0 → 0.18.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.
- binaryen-archive/CHANGELOG.md +43 -0
- binaryen-archive/binaryen.opam +6 -6
- binaryen-archive/esy.lock/index.json +509 -308
- binaryen-archive/esy.lock/opam/base-bigarray.base/opam +6 -0
- binaryen-archive/esy.lock/opam/{cppo.1.6.8 → cppo.1.6.9}/opam +21 -19
- binaryen-archive/esy.lock/opam/{dune-build-info.2.9.3 → dune-build-info.3.3.1}/opam +8 -6
- binaryen-archive/esy.lock/opam/{dune-configurator.2.9.3 → dune-configurator.3.3.1}/opam +10 -9
- binaryen-archive/esy.lock/opam/dune-rpc.3.3.1/opam +43 -0
- binaryen-archive/esy.lock/opam/{dune.2.9.3 → dune.3.3.1}/opam +6 -9
- binaryen-archive/esy.lock/opam/dyn.3.3.1/opam +40 -0
- binaryen-archive/esy.lock/opam/fiber.3.3.1/opam +41 -0
- binaryen-archive/esy.lock/opam/{js_of_ocaml-compiler.3.11.0 → js_of_ocaml-compiler.4.0.0}/opam +13 -11
- binaryen-archive/esy.lock/opam/{menhir.20211128 → menhir.20220210}/opam +4 -4
- binaryen-archive/esy.lock/opam/{menhirLib.20211128 → menhirLib.20220210}/opam +3 -3
- binaryen-archive/esy.lock/opam/{menhirSdk.20211128 → menhirSdk.20220210}/opam +3 -3
- binaryen-archive/esy.lock/opam/{ocaml-lsp-server.1.10.3 → ocaml-lsp-server.1.12.2}/opam +16 -8
- binaryen-archive/esy.lock/opam/{ocamlfind.1.9.3 → ocamlfind.1.9.5}/opam +4 -3
- binaryen-archive/esy.lock/opam/{ocamlformat-rpc-lib.0.19.0 → ocamlformat-rpc-lib.0.22.4}/opam +6 -7
- binaryen-archive/esy.lock/opam/octavius.1.2.2/opam +33 -0
- binaryen-archive/esy.lock/opam/odoc-parser.1.0.0/opam +1 -1
- binaryen-archive/esy.lock/opam/omd.1.3.1/opam +39 -0
- binaryen-archive/esy.lock/opam/ordering.3.3.1/opam +38 -0
- binaryen-archive/esy.lock/opam/{ppxlib.0.26.0 → ppxlib.0.27.0}/opam +6 -6
- binaryen-archive/esy.lock/opam/sexplib0.v0.14.0/opam +1 -1
- binaryen-archive/esy.lock/opam/stdune.3.3.1/opam +44 -0
- binaryen-archive/esy.lock/opam/xdg.3.3.1/opam +39 -0
- binaryen-archive/esy.lock/opam/{yojson.1.7.0 → yojson.2.0.0}/opam +13 -13
- binaryen-archive/esy.lock/overrides/opam__s__js__of__ocaml_compiler_opam__c__4.0.0_opam_override/package.json +3 -0
- binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.3_opam_override → opam__s__ocamlfind_opam__c__1.9.5_opam_override}/files/findlib.patch +0 -0
- binaryen-archive/esy.lock/overrides/{opam__s__ocamlfind_opam__c__1.9.3_opam_override → opam__s__ocamlfind_opam__c__1.9.5_opam_override}/package.json +0 -0
- binaryen-archive/package.json +6 -6
- binaryen-archive/src/binaryen_stubs_exports.js +36 -20
- binaryen-archive/src/binaryen_stubs_expressions.c +101 -0
- binaryen-archive/src/binaryen_stubs_expressions.js +543 -508
- binaryen-archive/src/binaryen_stubs_features.c +6 -0
- binaryen-archive/src/binaryen_stubs_features.js +38 -32
- binaryen-archive/src/binaryen_stubs_functions.js +45 -19
- binaryen-archive/src/binaryen_stubs_globals.js +8 -8
- binaryen-archive/src/binaryen_stubs_imports.js +53 -14
- binaryen-archive/src/binaryen_stubs_memory.js +4 -2
- binaryen-archive/src/binaryen_stubs_modules.js +9 -8
- binaryen-archive/src/binaryen_stubs_ops.c +2 -2
- binaryen-archive/src/binaryen_stubs_ops.js +632 -632
- binaryen-archive/src/binaryen_stubs_settings.js +36 -38
- binaryen-archive/src/binaryen_stubs_tables.js +18 -12
- binaryen-archive/src/binaryen_stubs_types.c +23 -2
- binaryen-archive/src/binaryen_stubs_types.js +44 -26
- binaryen-archive/src/expression.ml +27 -0
- binaryen-archive/src/expression.mli +18 -0
- binaryen-archive/src/memory.ml +15 -12
- binaryen-archive/src/memory.mli +2 -6
- binaryen-archive/src/module.ml +4 -0
- binaryen-archive/src/module.mli +1 -0
- binaryen-archive/src/passes.ml +6 -0
- binaryen-archive/src/passes.mli +6 -0
- binaryen-archive/src/type.ml +14 -2
- binaryen-archive/src/type.mli +4 -1
- binaryen-archive/test/test.expected +13 -12
- binaryen-archive/test/test.ml +26 -11
- binaryen-archive/esy.lock/opam/biniou.1.2.1/opam +0 -45
- binaryen-archive/esy.lock/opam/easy-format.1.3.3/opam +0 -58
- binaryen-archive/esy.lock/overrides/opam__s__easy_format_opam__c__1.3.3_opam_override/package.json +0 -3
binaryen-archive/test/test.ml
CHANGED
|
@@ -123,28 +123,39 @@ let _ =
|
|
|
123
123
|
let _ = Function.set_start wasm_mod start
|
|
124
124
|
|
|
125
125
|
let segment : Binaryen.Memory.segment =
|
|
126
|
-
let data = "hello" in
|
|
127
|
-
let
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
126
|
+
let data = Bytes.of_string "hello" in
|
|
127
|
+
let kind =
|
|
128
|
+
Binaryen.Memory.Active
|
|
129
|
+
{ offset = Expression.Const.make wasm_mod (Literal.int32 0l) }
|
|
130
|
+
in
|
|
131
|
+
let size = Bytes.length data in
|
|
132
|
+
{ data; kind; size }
|
|
133
|
+
|
|
134
|
+
let passive_segment : Binaryen.Memory.segment =
|
|
135
|
+
let data = Bytes.of_string "world" in
|
|
136
|
+
let kind = Binaryen.Memory.Passive in
|
|
137
|
+
let size = Bytes.length data in
|
|
138
|
+
{ data; kind; size }
|
|
131
139
|
|
|
132
|
-
let _ =
|
|
140
|
+
let _ =
|
|
141
|
+
Memory.set_memory wasm_mod 1 Memory.unlimited "memory"
|
|
142
|
+
[ segment; passive_segment ]
|
|
143
|
+
false
|
|
133
144
|
|
|
134
|
-
(* Create an imported "write" function i32 (
|
|
145
|
+
(* Create an imported "write" function i32 (anyref, i32, i32) *)
|
|
135
146
|
(* Similar to the example here: https://bytecodealliance.org/articles/reference-types-in-wasmtime *)
|
|
136
147
|
|
|
137
148
|
let _ =
|
|
138
149
|
Import.add_function_import wasm_mod "write" "future-wasi" "write"
|
|
139
|
-
(Type.create [| Type.
|
|
150
|
+
(Type.create [| Type.anyref; Type.int32; Type.int32 |])
|
|
140
151
|
Type.int32
|
|
141
152
|
|
|
142
153
|
(* Create a function that calls the imported write function *)
|
|
143
154
|
let _ =
|
|
144
|
-
Function.add_function wasm_mod "hello" Type.
|
|
155
|
+
Function.add_function wasm_mod "hello" Type.anyref Type.int32 [||]
|
|
145
156
|
(Expression.Call.make wasm_mod "write"
|
|
146
157
|
[
|
|
147
|
-
Expression.Local_get.make wasm_mod 0 Type.
|
|
158
|
+
Expression.Local_get.make wasm_mod 0 Type.anyref;
|
|
148
159
|
Expression.Const.make wasm_mod (Literal.int32 0l);
|
|
149
160
|
Expression.Const.make wasm_mod (Literal.int32 1l);
|
|
150
161
|
]
|
|
@@ -177,7 +188,10 @@ let _ =
|
|
|
177
188
|
sourcemap = Some {|{"version":3,"sources":[],"names":[],"mappings":""}|})
|
|
178
189
|
|
|
179
190
|
let new_mod = Module.read byts
|
|
180
|
-
|
|
191
|
+
|
|
192
|
+
let _ =
|
|
193
|
+
Module.run_passes new_mod
|
|
194
|
+
[ Passes.name_types; Passes.merge_similar_functions ]
|
|
181
195
|
|
|
182
196
|
let _ =
|
|
183
197
|
Module.set_features new_mod
|
|
@@ -197,6 +211,7 @@ let _ =
|
|
|
197
211
|
Module.Feature.memory64;
|
|
198
212
|
Module.Feature.typed_function_references;
|
|
199
213
|
Module.Feature.relaxed_simd;
|
|
214
|
+
Module.Feature.extended_const;
|
|
200
215
|
Module.Feature.all;
|
|
201
216
|
]
|
|
202
217
|
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
opam-version: "2.0"
|
|
2
|
-
build: [
|
|
3
|
-
["dune" "subst"] {dev}
|
|
4
|
-
["dune" "build" "-p" name "-j" jobs]
|
|
5
|
-
["dune" "runtest" "-p" name "-j" jobs] {with-test}
|
|
6
|
-
["dune" "build" "-p" name "@doc"] {with-doc}
|
|
7
|
-
]
|
|
8
|
-
maintainer: ["martin@mjambon.com"]
|
|
9
|
-
authors: ["Martin Jambon"]
|
|
10
|
-
bug-reports: "https://github.com/mjambon/biniou/issues"
|
|
11
|
-
homepage: "https://github.com/mjambon/biniou"
|
|
12
|
-
doc: "https://mjambon.github.io/biniou/"
|
|
13
|
-
license: "BSD-3-Clause"
|
|
14
|
-
dev-repo: "git+https://github.com/mjambon/biniou.git"
|
|
15
|
-
synopsis:
|
|
16
|
-
"Binary data format designed for speed, safety, ease of use and backward compatibility as protocols evolve"
|
|
17
|
-
description: """
|
|
18
|
-
|
|
19
|
-
Biniou (pronounced "be new") is a binary data format designed for speed, safety,
|
|
20
|
-
ease of use and backward compatibility as protocols evolve. Biniou is vastly
|
|
21
|
-
equivalent to JSON in terms of functionality but allows implementations several
|
|
22
|
-
times faster (4 times faster than yojson), with 25-35% space savings.
|
|
23
|
-
|
|
24
|
-
Biniou data can be decoded into human-readable form without knowledge of type
|
|
25
|
-
definitions except for field and variant names which are represented by 31-bit
|
|
26
|
-
hashes. A program named bdump is provided for routine visualization of biniou
|
|
27
|
-
data files.
|
|
28
|
-
|
|
29
|
-
The program atdgen is used to derive OCaml-Biniou serializers and deserializers
|
|
30
|
-
from type definitions.
|
|
31
|
-
|
|
32
|
-
Biniou format specification: mjambon.github.io/atdgen-doc/biniou-format.txt"""
|
|
33
|
-
depends: [
|
|
34
|
-
"easy-format"
|
|
35
|
-
"dune" {>= "1.10"}
|
|
36
|
-
"ocaml" {>= "4.02.3"}
|
|
37
|
-
]
|
|
38
|
-
url {
|
|
39
|
-
src:
|
|
40
|
-
"https://github.com/mjambon/biniou/releases/download/1.2.1/biniou-1.2.1.tbz"
|
|
41
|
-
checksum: [
|
|
42
|
-
"sha256=35546c68b1929a8e6d27a3b39ecd17b38303a0d47e65eb9d1480c2061ea84335"
|
|
43
|
-
"sha512=82670cc77bf3e869ee26e5fbe5a5affa45a22bc8b6c4bd7e85473912780e0111baca59b34a2c14feae3543ce6e239d7fddaeab24b686a65bfe642cdb91d27ebf"
|
|
44
|
-
]
|
|
45
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
opam-version: "2.0"
|
|
2
|
-
synopsis:
|
|
3
|
-
"High-level and functional interface to the Format module of the OCaml standard library"
|
|
4
|
-
description: """
|
|
5
|
-
|
|
6
|
-
This module offers a high-level and functional interface to the Format module of
|
|
7
|
-
the OCaml standard library. It is a pretty-printing facility, i.e. it takes as
|
|
8
|
-
input some code represented as a tree and formats this code into the most
|
|
9
|
-
visually satisfying result, breaking and indenting lines of code where
|
|
10
|
-
appropriate.
|
|
11
|
-
|
|
12
|
-
Input data must be first modelled and converted into a tree using 3 kinds of
|
|
13
|
-
nodes:
|
|
14
|
-
|
|
15
|
-
* atoms
|
|
16
|
-
* lists
|
|
17
|
-
* labelled nodes
|
|
18
|
-
|
|
19
|
-
Atoms represent any text that is guaranteed to be printed as-is. Lists can model
|
|
20
|
-
any sequence of items such as arrays of data or lists of definitions that are
|
|
21
|
-
labelled with something like "int main", "let x =" or "x:"."""
|
|
22
|
-
maintainer: ["martin@mjambon.com" "rudi.grinberg@gmail.com"]
|
|
23
|
-
authors: ["Martin Jambon"]
|
|
24
|
-
license: "BSD-3-Clause"
|
|
25
|
-
homepage: "https://github.com/mjambon/easy-format"
|
|
26
|
-
doc: "https://mjambon.github.io/easy-format/"
|
|
27
|
-
bug-reports: "https://github.com/mjambon/easy-format/issues"
|
|
28
|
-
depends: [
|
|
29
|
-
"dune" {>= "2.9"}
|
|
30
|
-
"ocaml" {>= "4.08"}
|
|
31
|
-
"odoc" {with-doc}
|
|
32
|
-
]
|
|
33
|
-
build: [
|
|
34
|
-
["dune" "subst"] {dev}
|
|
35
|
-
[
|
|
36
|
-
"dune"
|
|
37
|
-
"build"
|
|
38
|
-
"-p"
|
|
39
|
-
name
|
|
40
|
-
"-j"
|
|
41
|
-
jobs
|
|
42
|
-
"--promote-install-files=false"
|
|
43
|
-
"@install"
|
|
44
|
-
"@runtest" {with-test}
|
|
45
|
-
"@doc" {with-doc}
|
|
46
|
-
]
|
|
47
|
-
["dune" "install" "-p" name "--create-install-files" name]
|
|
48
|
-
]
|
|
49
|
-
dev-repo: "git+https://github.com/mjambon/easy-format.git"
|
|
50
|
-
url {
|
|
51
|
-
src:
|
|
52
|
-
"https://github.com/mjambon/easy-format/releases/download/1.3.3/easy-format-1.3.3.tbz"
|
|
53
|
-
checksum: [
|
|
54
|
-
"sha256=eafccae911c26ca23e4ddacee3eaa54654d20f973b8680f84b708cef43adc416"
|
|
55
|
-
"sha512=611b3124f6a0ec6406b7bda8018a94c9c4a9da9d22495a5c34a6312bf7f0f0607a9529b276f7039ce3f3b15a955dac413d6d1229a55d5ac291302a3ddd5807e5"
|
|
56
|
-
]
|
|
57
|
-
}
|
|
58
|
-
x-commit-hash: "56c57e69ef067d1cc4e31029d31e77e55b46be95"
|