Skip to content

Commit 7ea76ca

Browse files
committed
More README stuff
1 parent abec9f4 commit 7ea76ca

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

README.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Isomorphic library to handle passing high-level data structures between Assembly
1111
- Wraps around imported JavaScript functions, and exported AssemblyScript functions of the AssemblyScript Wasm Module. This allows high-level data types to be passed to AssemblyScript functions, without having to touch Wasm memory! 🤯
1212
- The library works at runtime, so no generated code that you have to maintain and try to get to work in your environment. 🏃
1313
- Maintains great performance (relative to generating the corresponding JavaScript code), by using [Speculative Execution](https://en.wikipedia.org/wiki/Speculative_execution), and caching types passed between functions. 🤔
14-
- The library is [< 5KB (minified and gzip'd)](https://bundlephobia.com/result?p=as-bind@0.0.2) and tree-shakeable! 📦🌲
14+
- The library is [< 5KB (minified and gzip'd)](https://bundlephobia.com/result?p=as-bind) and tree-shakeable! 📦🌲
1515
- This library is currently the [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) in the Rust/Wasm ecosystem, for AssemblyScript. 😀
1616

1717
## Installation
@@ -26,11 +26,11 @@ You can install as-bind in your project by running the following:
2626

2727
Export everything from the asbind assemblyscript library:
2828

29-
```
29+
```typescript
3030
// This should be in your entry point file for your Assemblyscript project
3131

3232
// '../node_modules/as-bind/*' should be the relative path to this directory in your project
33-
export * from '../node_modules/as-bind/lib/assembly/asbind.ts'
33+
export * from "../node_modules/as-bind/lib/assembly/asbind.ts";
3434
```
3535

3636
After this, let's export an example function we can try:
@@ -84,6 +84,14 @@ asyncTask();
8484

8585
## Motivation
8686

87+
This library was inspired by several chats I had with some awesome buddies of mine in the WebAssembly Communitty:
88+
89+
- Till Schneidereit and I had a chat about [WasmBoy](https://github.com/torch2424/wasmboy), and about how I had a really good experience writing the emulator, even though I had to do my own memory management. But they helped me realize, building something low level isn't that bad with manual memory management, but building something like a markdown parser would be very tedious since you have to manually write the string back and forth. Which then inspired this library, and it's [markdown parser demo](https://torch2424.github.io/as-bind/).
90+
91+
- While I was building [WasmByExample](https://wasmbyexample.dev/?programmingLanguage=assemblyscript) I wanted to start building the "High Level Data Structures" section. I then realized how much work it would be to maintain code for passing data between WebAssembly Linear memory would be for each data type, and how much work it would be to created each individual example. Then, my buddy [Ashley Williams](https://twitter.com/ag_dubs) helped me realize, if your docs are becoming too complex, it may be a good idea to write a tool. That way you have less docs to write, and users will have an easier time using your stuff!
92+
93+
Thus, this library was made to help AssemblyScript/JavaScript users build awesome things! 😄🎉
94+
8795
## Supported Data Types
8896

8997
**TL;DR:** Currently Numbers, Strings, and Typed Arrays are supported. Returning a high-level data type from an imported JavaScript function, and passing AssemblyScript Classes will be coming later.
@@ -97,11 +105,11 @@ asyncTask();
97105
| Imported JavaScript Function Paramters | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ ||
98106
| Imported JavaScript Function Return | ✔️ |||||||||||
99107

100-
## Supported AssemblyScript Runtime Modes
108+
## Supported AssemblyScript Runtime Variants
101109

102-
TODO
110+
as-bind only supports AssemblyScript modules compiled with the `--runtime full` (default), and `--runtime stub` flags. These should be the only supported modes, because these runtime variants specify that you would like types / objects to be created externally as well as internally. Other runtime variants would mean that you DO NOT want anything externally created for your wasm module.
103111

104-
Only supports the `--runtime full`, and `--runtime stub` flag. And should, because anything else would mean that you DO NOT want to create objects externally to your wasm module. Simply need to wrap the docs from: https://docs.assemblyscript.org/details/runtime and we should be good to go!
112+
Please see the [AssemblyScript Docs on runtime variants](https://docs.assemblyscript.org/details/runtime) for more information.
105113

106114
## Performance
107115

lib/lib.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import packageJson from "../package.json";
22
import AsbindInstance from "./asbind-instance";
33

4-
const asbind = {
4+
export const AsBind = {
55
// General asbind versionn
66
version: packageJson.version,
77

@@ -13,4 +13,4 @@ const asbind = {
1313
}
1414
};
1515

16-
export default asbind;
16+
export default AsBind;

0 commit comments

Comments
 (0)