Skip to content

Commit

Permalink
add instruction for the wasocaml opam switch
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Jul 29, 2023
1 parent be53e2b commit 9dd47a9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ _build
/testsuite/tools/parsecmm.ml
/testsuite/tools/parsecmm.mli

/test_kb_wasm/*.wasm
/test_kb_wasm/*.wast

/tools/ocamldep
/tools/ocamldep.opt
/tools/ocamlprof
Expand Down
14 changes: 13 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,23 @@ $ sudo make install

#### Wasocaml

You can now build and install Wasocaml.
You can now build and install Wasocaml. You can either build the compiler locally or install a switch with the Wasocaml compiler.

##### Locally

```shell-session
$ ./configure
$ make
$ sudo make install
```

##### Opam switch


```shell-session
$ opam switch create wasocaml --repos default,wasocaml=git+https://github.com/ocamlpro/wasocaml-opam.git ocaml-variants.4.14.1+wasocaml
```

### Usage

Running the compiler will produce two files: `a.out.wasm` (the Wasm binary) and `a.out.wast` (the Wast text format).
Expand All @@ -41,7 +50,10 @@ $ ls
a.out a.out.wasm a.out.wast
```

For a complete example using the compiler installed as an opam switch, see [wasocaml-demo].

[Binaryen]: https://github.com/WebAssembly/binaryen
[OCaml]: https://ocaml.org
[Wasm]: https://webassembly.org
[Wasm-GC]: https://github.com/WebAssembly/gc
[wasocaml-demo]: https://github.com/ocamlpro/wasocaml-demo

0 comments on commit 9dd47a9

Please sign in to comment.