You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `wasmer` package brings the required API to execute WebAssembly
27
-
modules. In a nutshell, `wasmer` compiles the WebAssembly module into
28
-
compiled code, and then executes it. `wasmer` is designed to work in
29
-
various environments and platforms: From nano single-board computers
30
-
to large and powerful servers, including more exotic ones. To address
31
-
those requirements, Wasmer provides 2 engines and 3 compilers.
32
-
33
-
Succinctly, an _engine_ is responsible to drive the _compilation_ and
34
-
the _execution_ of a WebAssembly module. By extension, a _headless_
35
-
engine can only execute a WebAssembly module, i.e. a module that has
36
-
previously been compiled, or compiled, serialized and deserialized. By
37
-
default, the `wasmer` package comes with 2 headless engines:
38
-
39
-
1.`wasmer.engine.JIT`, the compiled machine code lives in memory,
40
-
2.`wasmer.engine.Native`, the compiled machine code lives in a shared
41
-
object file (`.so`, `.dylib`, or `.dll`), and is natively executed.
42
-
43
-
Because `wasmer` does not embed compilers in its package, engines are
44
-
headless, i.e. they can't compile WebAssembly module; they can only
45
-
execute them. Compilers live in their own standalone packages. Let's
46
-
briefly introduce them:
47
-
48
-
| Compiler package | Description | PyPi |
49
-
|-|-|-|
50
-
|`wasmer_compiler_singlepass`| Super fast compilation times, slower execution times. Not prone to JIT-bombs. *Ideal for blockchains*|[](https://pypi.org/project/wasmer_compiler_singlepass/)[](https://pypi.org/project/wasmer_compiler_singlepass/)|
51
-
|`wasmer_compiler_cranelift`| Fast compilation times, fast execution times. *Ideal for development*|[](https://pypi.org/project/wasmer_compiler_cranelift/)[](https://pypi.org/project/wasmer_compiler_cranelift/)|
52
-
|`wasmer_compiler_llvm`| Slow compilation times, very fast execution times (close to native, sometimes faster). *Ideal for Production*|[](https://pypi.org/project/wasmer_compiler_llvm/)[](https://pypi.org/project/wasmer_compiler_llvm/)|
53
-
54
-
We generally recommend `wasmer_compiler_cranelift` for development
55
-
purposes and `wasmer_compiler_llvm` in production.
56
-
57
-
Learn more by reading [the documentation of the `wasmer.engine`
directory, which contains a sequence of examples/tutorials. It's the
68
+
best place to learn by reading examples.
123
69
124
-
The Python extension is written in [Rust], with [`pyo3`] and
125
-
[`maturin`].
126
70
127
-
First, you need to install Rust and Python. We will not make you the
128
-
affront to explain to you how to install Python (if you really need,
129
-
check [`pyenv`](https://github.com/pyenv/pyenv/)). For Rust though, we
130
-
advise to use [`rustup`](https://rustup.rs/), then:
71
+
## Quick Introduction
131
72
132
-
```sh
133
-
$ rustup install stable
134
-
```
73
+
The `wasmer` package brings the required API to execute WebAssembly
74
+
modules. In a nutshell, `wasmer` compiles the WebAssembly module into
75
+
compiled code, and then executes it. `wasmer` is designed to work in
76
+
various environments and platforms: From nano single-board computers
77
+
to large and powerful servers, including more exotic ones. To address
78
+
those requirements, Wasmer provides 2 engines and 3 compilers.
135
79
136
-
To set up your environment, you'll need [`just`], and then, install
137
-
the prelude of this project:
80
+
Succinctly, an _engine_ is responsible to drive the _compilation_ and
81
+
the _execution_ of a WebAssembly module. By extension, a _headless_
82
+
engine can only execute a WebAssembly module, i.e. a module that has
83
+
previously been compiled, or compiled, serialized and deserialized. By
84
+
default, the `wasmer` package comes with 2 headless engines:
138
85
139
-
```sh
140
-
$ cargo install just
141
-
$ just --list # to learn about all the available recipes
142
-
$ just prelude
143
-
```
86
+
1.`wasmer.engine.Universal`, the compiled machine code lives in memory,
87
+
2.`wasmer.engine.Native`, the compiled machine code lives in a shared
88
+
object file (`.so`, `.dylib`, or `.dll`), and is natively executed.
144
89
145
-
It will install `pyo3` and `maturin` for Python and for Rust. It will
146
-
also install [`virtualenv`].
90
+
Because `wasmer` does not embed compilers in its package, engines are
91
+
headless, i.e. they can't compile WebAssembly module; they can only
92
+
execute them. Compilers live in their own standalone packages. Let's
93
+
briefly introduce them:
147
94
148
-
Then, simply run:
95
+
| Compiler package | Description | PyPi |
96
+
|-|-|-|
97
+
|`wasmer_compiler_singlepass`| Super fast compilation times, slower execution times. Not prone to JIT-bombs. *Ideal for blockchains*|[](https://pypi.org/project/wasmer_compiler_singlepass/)[](https://pypi.org/project/wasmer_compiler_singlepass/)|
98
+
|`wasmer_compiler_cranelift`| Fast compilation times, fast execution times. *Ideal for development*|[](https://pypi.org/project/wasmer_compiler_cranelift/)[](https://pypi.org/project/wasmer_compiler_cranelift/)|
99
+
|`wasmer_compiler_llvm`| Slow compilation times, very fast execution times (close to native, sometimes faster). *Ideal for Production*|[](https://pypi.org/project/wasmer_compiler_llvm/)[](https://pypi.org/project/wasmer_compiler_llvm/)|
100
+
101
+
We generally recommend `wasmer_compiler_cranelift` for development
102
+
purposes and `wasmer_compiler_llvm` in production.
103
+
104
+
Learn more by reading [the documentation of the `wasmer.engine`
0 commit comments