Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Implement a basic Wasmtime demo #9

Merged
merged 1 commit into from
Aug 13, 2019

Conversation

mbestavros
Copy link
Contributor

This PR implements a simple demo of Wasmtime and how Enarx may use it.

The demo builds a basic WASM binary from either Rust or C source (selectable at compile time via a Cargo feature), loads it into Wasmtime, and runs it.

This work resolves both #3 and #7. Further WASM demo work will likely build on top of this base.

@npmccallum
Copy link
Contributor

@mbestavros Don't forget that our policy is to squash into logical commits before submitting the PR.

@mbestavros mbestavros force-pushed the wasmtime-basic-demo branch from 8ccaae4 to 6e5fa17 Compare August 9, 2019 20:12
@mbestavros
Copy link
Contributor Author

@npmccallum Right, apologies. Done.

Copy link
Contributor

@npmccallum npmccallum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Run this code through rustfmt. A simple cargo fmt should do.

  2. I think the abstractions (handle_module() and so on...) aren't holding their weight for this demo. I'd really like to see just the bare wasmtime API in a single main() function.

  3. We probably need to turn on optimization before benchmarks. For clang: -O3. For rustc: -C opt-level=3.

wasmtime-basic/Cargo.toml Outdated Show resolved Hide resolved
wasmtime-basic/README.md Outdated Show resolved Hide resolved
@mbestavros mbestavros force-pushed the wasmtime-basic-demo branch 4 times, most recently from 40ac56f to c4833f3 Compare August 12, 2019 17:39
@mbestavros
Copy link
Contributor Author

@npmccallum Addressed your points. main.rs is significantly refactored (and shorter) as a result.

Ready for re-review.

Copy link
Contributor

@npmccallum npmccallum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting really close!

wasmtime-basic/build.rs Show resolved Hide resolved
wasmtime-basic/src/main.rs Outdated Show resolved Hide resolved
wasmtime-basic/src/main.rs Outdated Show resolved Hide resolved
wasmtime-basic/src/main.rs Show resolved Hide resolved
@mbestavros mbestavros force-pushed the wasmtime-basic-demo branch 5 times, most recently from f065a46 to d6c9cf5 Compare August 12, 2019 20:49
wasmtime-basic/src/main.rs Outdated Show resolved Hide resolved
@mbestavros mbestavros force-pushed the wasmtime-basic-demo branch from d6c9cf5 to 26729d4 Compare August 13, 2019 18:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants