-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initial stab at porting asm/stack.ts
to Rust
#752
Conversation
#![feature(link_llvm_intrinsics)] | ||
|
||
#[no_mangle] | ||
pub extern fn add(a: u32, b: u32) -> u32 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was this intended to be left in?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops yeah that was just leftover
f0e451c
to
3edb642
Compare
The three currently failing tests I believe are
|
Is the idea that you'll be able to have pluggable backends within |
@wycats ok I pushed up the extra commits we talked about here! I think I addressed most of the immediate feedback and left a few questions, but let me know if there's anything else that should be resolved! |
f04aa88
to
af48783
Compare
96784fa
to
164d730
Compare
@alexcrichton just in case, I can assure you that this table of wasm support by browsers is absolutely accurate https://caniuse.com/#feat=wasm |
@chicoxyzzy confirm! |
ac23a69
to
542ced3
Compare
Should hopefully get further on CI!
The QUnit tests should now properly only start when the framework is loaded, and otherwise an extra level of indirection was needed to ensure that once wasm bindings were loaded they propagated correctly throughout the system.
Hopefully high-paced development is now over!
We don't want to accidentally use libstd abstractions too unnecessarily just yet as they may bring in too much code size.
This is a helper defined in the `wasm_bindgen` crate for if we need it, which we may!
This moves the interface and various imports over to using the `wasm_bindgen!` macro. This enables a few nice features: * Less duplication all over the place when adding a method, now you just add it then call it from JS. * Ability to pass JS objects "through Rust" in a way that removes a bunch of globals/wrappers on the JS side of things. * Hopefully more type safety and type checking long-term heading off bugs before they start to arise.
This also removes the `asm/stack.ts` file in favor of just going through the original `LowLevelVM` itself
Due to recursive usage patterns it's not always possible, but if we can use it then it's more efficient
This way we should cros the JS <-> wasm boundary hopefully a little less often.
Hopefully that'll get it to optimize *even more*, or at least that's the idea
The wasm-bindgen pass may remove functions and modify data (currently), so be sure to run wasm-opt afterwards to get maximal optimizations and space savings. For example dropping the wasm-bindgen statics drops the file size from 48k to 21k with this!
…okenizer Upgrade simple-html-tokenizer
Typing cleanup
…izer-dep fix simple-html-tokenizer deps
add prettierrc
remove for of usage causing problems with upstream build
Switch one instance of zero-initialization to not zero-initializing as well to save some perf
is it alive? |
Any news here? |
It's somewhat alive, but we've been focusing our efforts on Ember integration lately. @chriskrycho is taking a stab at porting the compiler to Rust/wasm with some very promising results so far! |
Was this completed, or abandoned? Either way it would be interesting to hear some details of the experience here! |
Is there any update regarding the VM migration to Wasm? |
This commit is an initial stab at adding some Rust to glimmer, notably to
implement some bits-and-pieces of the
low-level
package for now. Specificallythis commit takes the
Stack
type in thelow-level
module and ports it toRust and then integrates it all back with WebAssembly.
Some notable points of this:
right just yet.
standard library's allocator is avoided) and internally a freelist is
maintained of free'd pages.
forever in use and usage will "grow without bound". Eventually a manual call
to "free this" will need to be inserted for the
Stack
type.