https://github.com/fitzgen/wbgvm
Consumes WebIDL and TypeScript definition files and emits wasm-bindgen extern declarations
https://github.com/fitzgen/wbgvm
Last synced: 11 months ago
JSON representation
Consumes WebIDL and TypeScript definition files and emits wasm-bindgen extern declarations
- Host: GitHub
- URL: https://github.com/fitzgen/wbgvm
- Owner: fitzgen
- Created: 2018-03-29T09:17:00.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-29T10:04:11.000Z (over 8 years ago)
- Last Synced: 2025-03-17T11:59:47.504Z (over 1 year ago)
- Language: Rust
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
⚠ NOT YET IMPLEMENTED ⚠
# `wbgvm`
The `wasm-bindgen` virtual machine.
Consumes WebIDL and TypeScript definition files and emits `wasm-bindgen` `extern
type` and `extern fn` declarations.
## Architecture
### Frontends
There are two frontends:
1. TypeScript
2. WebIDL
Despite parsing and munging different input languages, both frontends translate
the input into the same IR.
#### TypeScript Frontend
Written in TypeScript and uses the TypeScript compiler API to parse `.d.ts`
definition files and emit the IR as JSON. This TypeScript frontend is run as a
subprocess.
https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API
#### WebIDL Frontend
This is pure Rust. We use the `webidl` crate to parse WebIDL interface
definitions and translate them into our IR.
### Intermediate Representation (IR)
The IR has a well-defined JSON encoding. It can describe any `wasm-bindgen`
extern declaration.
### Code Generation
The code generation serves as the shared backend for `wbgvm`. It takes the IR
and translates it into Rust source text defining `#[wasm_bindgen]` declarations.