https://github.com/dcoles/adventureland-rs
Proof-of-concept Rust bindings for AdvetureLand
https://github.com/dcoles/adventureland-rs
Last synced: 11 months ago
JSON representation
Proof-of-concept Rust bindings for AdvetureLand
- Host: GitHub
- URL: https://github.com/dcoles/adventureland-rs
- Owner: dcoles
- License: mit
- Created: 2022-04-14T05:23:10.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-01-21T05:13:10.000Z (over 3 years ago)
- Last Synced: 2025-03-13T07:43:39.112Z (over 1 year ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AdventureLand.rs
A proof of concept showing how to use Rust code for [Adventure Land](https://adventure.land/).
## Building
```
wasm-pack build --target web --no-typescript
```
## Loader
```javascript
// Simple Loader
// ⚠️ IMPORTANT — Only use with URLs you control and trust
//
// Untrusted code may hijack your account, use it to mine crypto currency,
// steal personal data, cause your cat to run away and other nasty things.
(async () => {
try {
const { default: init } = await import('http://127.0.0.1:5500/adventureland_rs.js');
init();
} catch (e) {
set_message('Load Error', 'red');
safe_log(e.toString(), 'red')
}
})();
```
## Serving
The generated `.js` and `.wasm` files need to be served via a HTTP server
to be usable. The easiest way is to use the provided small HTTP server
that only listens on your computer's local IP (`127.0.0.1`).
```
cd pkg
python ../code_server.py
```