Skip to content
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

Consistently capitalize “Wasm” #4094

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ Released 2023-11-01
[#3537](https://github.com/rustwasm/wasm-bindgen/pull/3537)

* Changed behavior when compiling to `wasm32-wasi` to match `wasm32-emscripten` and
non-WASM targets, generating a stub that panics when called rather than a wasm-
non-Wasm targets, generating a stub that panics when called rather than a wasm-
bindgen placeholder.
[#3233](https://github.com/rustwasm/wasm-bindgen/pull/3233)

Expand Down Expand Up @@ -936,7 +936,7 @@ Released 2020-04-29.
[#2099](https://github.com/rustwasm/wasm-bindgen/pull/2099)

* The output of `wasm-bindgen` is now compatible with Webpack 5 and the updated
version of the wasm ESM integration specification.
version of the Wasm ESM integration specification.
[#2110](https://github.com/rustwasm/wasm-bindgen/pull/2099)

--------------------------------------------------------------------------------
Expand Down Expand Up @@ -1119,7 +1119,7 @@ Released 2019-11-19.
* Running `wasm-bindgen` over empty anyref modules now works again.
[#1861](https://github.com/rustwasm/wasm-bindgen/pull/1861)

* Support for multi-value JS engines has been fixed as a wasm interface types
* Support for multi-value JS engines has been fixed as a Wasm interface types
polyfill.
[#1863](https://github.com/rustwasm/wasm-bindgen/pull/1863)

Expand Down Expand Up @@ -1342,8 +1342,8 @@ Released 2019-07-11.
slices.
[#1639](https://github.com/rustwasm/wasm-bindgen/pull/1639)

* When using the `bundler` target the import of the wasm file now uses the
`.wasm` extension to ensure a wasm file is loaded.
* When using the `bundler` target the import of the Wasm file now uses the
`.wasm` extension to ensure a Wasm file is loaded.
[#1646](https://github.com/rustwasm/wasm-bindgen/pull/1646)

* The old internal `Stack` trait has been removed since it is no longer used.
Expand Down Expand Up @@ -1471,7 +1471,7 @@ Released 2019-05-16.
* A utility for counting the size of the `anyref` heap has been added.
[#1521](https://github.com/rustwasm/wasm-bindgen/pull/1521)

* Passing ASCII-only strings to WASM should now be significantly faster.
* Passing ASCII-only strings to Wasm should now be significantly faster.
[#1470](https://github.com/rustwasm/wasm-bindgen/pull/1470)

* The `selectionStart` and `selectionEnd` APIs of text areas have been enabled.
Expand Down Expand Up @@ -1611,7 +1611,7 @@ Released 2019-04-10.
[#1416](https://github.com/rustwasm/wasm-bindgen/pull/1416)

* A `wasm_bindgen::function_table()` function has been added to expose the
`WebAssembly.Table` and get access to it in wasm code.
`WebAssembly.Table` and get access to it in Wasm code.
[#1431](https://github.com/rustwasm/wasm-bindgen/pull/1431)

### Fixed
Expand Down Expand Up @@ -1774,7 +1774,7 @@ Released 2019-02-15.
[#1225](https://github.com/rustwasm/wasm-bindgen/pull/1225).

* A `--remove-producers-section` flag has been added to the CLI tool to, well,
remove the `producers` section from the final wasm file.
remove the `producers` section from the final Wasm file.
[#1256](https://github.com/rustwasm/wasm-bindgen/pull/1256).

### Fixed
Expand Down Expand Up @@ -1812,7 +1812,7 @@ Released 2019-02-12.
### Changed

* `wasm-bindgen` now internally uses the `walrus` crate to perform its
transformations of the wasm that rustc/LLVM emits. See
transformations of the Wasm that rustc/LLVM emits. See
[#1237](https://github.com/rustwasm/wasm-bindgen/pull/1237).

### Fixed
Expand Down Expand Up @@ -1964,17 +1964,17 @@ Released 2018-12-04.
### Added

* Add a `#[wasm_bindgen(start)]` attribute to customize the `start` section of
the wasm module.
the Wasm module.
[#1057](https://github.com/rustwasm/wasm-bindgen/pull/1057)

* Add support for producing the new "producers" section of wasm binaries
* Add support for producing the new "producers" section of Wasm binaries
[#1041](https://github.com/rustwasm/wasm-bindgen/pull/1041)

* Add support a `typescript_custom_section` attribute for producing custom
typescript abstractions
[#1048](https://github.com/rustwasm/wasm-bindgen/pull/1048)

* Generate `*.d.ts` files for wasm files in addition to the JS bindings
* Generate `*.d.ts` files for Wasm files in addition to the JS bindings
[#1053](https://github.com/rustwasm/wasm-bindgen/pull/1053)

* Add a feature to assert that all attributes in `#[wasm_bindgen]` are used to
Expand Down Expand Up @@ -2251,7 +2251,7 @@ Released 2018-09-07

### Fixed

* The "names" section of the wasm binary is now correctly preserved by
* The "names" section of the Wasm binary is now correctly preserved by
wasm-bindgen.

--------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ greet("World!");

* **Designed with the ["Web IDL bindings" proposal][webidl-bindings] in mind.**
Eventually, there won't be any JavaScript shims between Rust-generated wasm
functions and native DOM methods. Because the wasm functions are statically
functions and native DOM methods. Because the Wasm functions are statically
type checked, some of those native methods' dynamic type checks should become
unnecessary, promising to unlock even-faster-than-JavaScript DOM access.

Expand Down
6 changes: 3 additions & 3 deletions benchmarks/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h1>JS / wasm-bindgen comparison</h1>
<p class='about'>
This benchmarks tests out how long it take JS to call a thunk in
the given language. For example JS will call a JS thunk or
JS will call a wasm function that does nothing.
JS will call a Wasm function that does nothing.
</p>
</td>

Expand Down Expand Up @@ -131,7 +131,7 @@ <h1>JS / wasm-bindgen comparison</h1>

<p class='about'>
This benchmarks calculates the 40th fibonacci number. It in
theory should favor wasm since wasm is "better a compute", but
theory should favor Wasm since Wasm is "better a compute", but
a good JIT will probably make the code roughly equivalent.
</p>
</td>
Expand Down Expand Up @@ -296,7 +296,7 @@ <h1>wasm-bindgen benchmarks</h1>
<a class='about-open' href='#'>(?)</a>

<p class='about'>
This benchmarks the overhead of passing strings to wasm and
This benchmarks the overhead of passing strings to Wasm and
also receiving them from wasm.
</p>
</td>
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function executeBenchmark(name, bm) {
});
}

// Load wasm files and when they're done (plus the DOM) then we initialize
// Load Wasm files and when they're done (plus the DOM) then we initialize
// everything
const wasms = [];
wasms.push(wbindgen_init('./pkg/wasm_bindgen_benchmark_bg.wasm'));
Expand Down
4 changes: 2 additions & 2 deletions crates/backend/src/ast.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! A representation of the Abstract Syntax Tree of a Rust program,
//! with all the added metadata necessary to generate WASM bindings
//! with all the added metadata necessary to generate Wasm bindings
//! for it.

use crate::{util::ShortHash, Diagnostic};
Expand Down Expand Up @@ -100,7 +100,7 @@ pub struct Export {
pub rust_class: Option<Ident>,
/// The name of the rust function/method on the rust side.
pub rust_name: Ident,
/// Whether or not this function should be flagged as the wasm start
/// Whether or not this function should be flagged as the Wasm start
/// function.
pub start: bool,
/// Path to wasm_bindgen
Expand Down
6 changes: 3 additions & 3 deletions crates/backend/src/codegen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl TryToTokens for ast::Program {
Diagnostic::from_vec(errors)?;

// Generate a static which will eventually be what lives in a custom section
// of the wasm executable. For now it's just a plain old static, but we'll
// of the Wasm executable. For now it's just a plain old static, but we'll
// eventually have it actually in its own section.

// See comments in `crates/cli-support/src/lib.rs` about what this
Expand Down Expand Up @@ -278,7 +278,7 @@ impl ToTokens for ast::Struct {

#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
unsafe fn #new_fn(_: u32) -> u32 {
panic!("cannot convert to JsValue outside of the wasm target")
panic!("cannot convert to JsValue outside of the Wasm target")
}

unsafe {
Expand Down Expand Up @@ -384,7 +384,7 @@ impl ToTokens for ast::Struct {

#[cfg(not(all(target_arch = "wasm32", target_os = "unknown")))]
unsafe fn #unwrap_fn(_: u32) -> u32 {
panic!("cannot convert from JsValue outside of the wasm target")
panic!("cannot convert from JsValue outside of the Wasm target")
}

let ptr = unsafe { #unwrap_fn(idx) };
Expand Down
10 changes: 5 additions & 5 deletions crates/cli-support/src/externref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub fn process(module: &mut Module) -> Result<()> {
for instr in instrs {
match instr.instr {
// Calls to the heap live count intrinsic are now routed to the
// actual wasm function which keeps track of this.
// actual Wasm function which keeps track of this.
Instruction::CallAdapter(adapter) => {
let id = match meta.live_count {
Some(id) => id,
Expand All @@ -103,7 +103,7 @@ pub fn process(module: &mut Module) -> Result<()> {
instr.instr = Instruction::CallCore(id);
}

// Optional externref values are now managed in the wasm module, so
// Optional externref values are now managed in the Wasm module, so
// we need to store where they're managed.
Instruction::I32FromOptionExternref {
ref mut table_and_alloc,
Expand Down Expand Up @@ -333,7 +333,7 @@ fn export_xform(cx: &mut Context, export: Export, instrs: &mut Vec<InstructionDa
}

// Delete all unnecessary externref management instructions. We're going to
// sink these instructions into the wasm module itself.
// sink these instructions into the Wasm module itself.
for idx in to_delete.into_iter().rev() {
instrs.remove(idx);
}
Expand All @@ -344,7 +344,7 @@ fn module_needs_externref_metadata(aux: &WasmBindgenAux, section: &NonstandardWi
use Instruction::*;

// our `handleError` intrinsic uses a few pieces of metadata to store
// indices directly into the wasm module.
// indices directly into the Wasm module.
if !aux.imports_with_catch.is_empty() {
return true;
}
Expand Down Expand Up @@ -387,7 +387,7 @@ fn module_needs_externref_metadata(aux: &WasmBindgenAux, section: &NonstandardWi
})
}

/// In MVP wasm all element segments must be contiguous lists of function
/// In MVP Wasm all element segments must be contiguous lists of function
/// indices. Post-MVP with reference types element segments can have holes.
/// While `walrus` will select the encoding that fits, this function forces the
/// listing of segments to be MVP-compatible.
Expand Down
8 changes: 4 additions & 4 deletions crates/cli-support/src/js/binding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct JsBuilder<'a, 'b> {
/// use to translate the `arg.get` instruction.
args: Vec<String>,

/// The wasm interface types "stack". The expressions pushed onto this stack
/// The Wasm interface types "stack". The expressions pushed onto this stack
/// are intended to be *pure*, and if they're not, they should be pushed
/// into the `prelude`, assigned to a variable, and the variable should be
/// pushed to the stack. We're not super principled about this though, so
Expand Down Expand Up @@ -164,7 +164,7 @@ impl<'a, 'b> Builder<'a, 'b> {
// We don't actually manage a literal stack at runtime, but instead we
// act as more of a compiler to generate straight-line code to make it
// more JIT-friendly. The generated code should be equivalent to the
// wasm interface types stack machine, however.
// Wasm interface types stack machine, however.
for instr in instructions {
instruction(
&mut js,
Expand Down Expand Up @@ -1103,8 +1103,8 @@ fn instruction(
// Then pass it the pointer and the length of where we copied it.
js.push(format!("ptr{}", i));
js.push(format!("len{}", i));
// Then we give wasm a reference to the original typed array, so that it can
// update it with modifications made on the wasm side before returning.
// Then we give Wasm a reference to the original typed array, so that it can
// update it with modifications made on the Wasm side before returning.
js.push(val);
}

Expand Down
34 changes: 17 additions & 17 deletions crates/cli-support/src/js/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct Context<'a> {
/// renames for each identifier.
js_imports: HashMap<String, Vec<(String, Option<String>)>>,

/// A map of each wasm import and what JS to hook up to it.
/// A map of each Wasm import and what JS to hook up to it.
wasm_import_definitions: HashMap<ImportId, String>,

/// A map from an import to the name we've locally imported it as.
Expand Down Expand Up @@ -377,7 +377,7 @@ impl<'a> Context<'a> {
}

// Depending on the output mode, generate necessary glue to actually
// import the wasm file in one way or another.
// import the Wasm file in one way or another.
let mut init = (String::new(), String::new());
let mut footer = String::new();
let mut imports = self.js_import_header()?;
Expand Down Expand Up @@ -445,9 +445,9 @@ impl<'a> Context<'a> {
}
}

// With Bundlers we can simply import the wasm file as if it were an ES module
// With Bundlers we can simply import the Wasm file as if it were an ES module
// and let the bundler/runtime take care of it.
// With Node we manually read the wasm file from the filesystem and instantiate it.
// With Node we manually read the Wasm file from the filesystem and instantiate it.
OutputMode::Bundler { .. } | OutputMode::Node { module: true } => {
for (id, js) in crate::sorted_iter(&self.wasm_import_definitions) {
let import = self.module.imports.get_mut(*id);
Expand Down Expand Up @@ -491,7 +491,7 @@ impl<'a> Context<'a> {
}

// With a browser-native output we're generating an ES module, but
// browsers don't support natively importing wasm right now so we
// browsers don't support natively importing Wasm right now so we
// expose the same initialization function as `--target no-modules`
// as the default export of the module.
OutputMode::Web => {
Expand Down Expand Up @@ -821,7 +821,7 @@ impl<'a> Context<'a> {
}} catch (e) {{
if (module.headers.get('Content-Type') != 'application/wasm') {{
console.warn(\"`WebAssembly.instantiateStreaming` failed \
because your server does not serve wasm with \
because your server does not serve Wasm with \
`application/wasm` MIME type. Falling back to \
`WebAssembly.instantiate` which is slower. Original \
error:\\n\", e);
Expand Down Expand Up @@ -1307,7 +1307,7 @@ impl<'a> Context<'a> {
}
}

// A fast path that directly writes char codes into WASM memory as long
// A fast path that directly writes char codes into Wasm memory as long
// as it finds only ASCII characters.
//
// This is much faster for common ASCII strings because it can avoid
Expand Down Expand Up @@ -1836,7 +1836,7 @@ impl<'a> Context<'a> {

let cache = format!("cached{}Memory{}", kind, view.num);
let resized_check = if self.module.memories.get(memory).shared {
// When it's backed by a `SharedArrayBuffer`, growing the wasm module's memory
// When it's backed by a `SharedArrayBuffer`, growing the Wasm module's memory
// doesn't detach old references; instead, it just leaves them pointing to a
// slice of the up-to-date memory. So in order to check if it's been grown, we
// have to compare it to the up-to-date buffer.
Expand Down Expand Up @@ -2393,7 +2393,7 @@ impl<'a> Context<'a> {
}

/// If a start function is present, it removes it from the `start` section
/// of the wasm module and then moves it to an exported function, named
/// of the Wasm module and then moves it to an exported function, named
/// `__wbindgen_start`.
fn unstart_start_function(&mut self) -> bool {
let start = match self.module.start.take() {
Expand Down Expand Up @@ -2780,7 +2780,7 @@ impl<'a> Context<'a> {
}
}

/// Attempts to directly hook up the `id` import in the wasm module with
/// Attempts to directly hook up the `id` import in the Wasm module with
/// the `instrs` specified.
///
/// If this succeeds it returns `Ok(true)`, otherwise if it cannot be
Expand Down Expand Up @@ -2845,15 +2845,15 @@ impl<'a> Context<'a> {

// If there's no field projection happening here and this is a direct
// import from an ES-looking module, then we can actually just hook this
// up directly in the wasm file itself. Note that this is covered in the
// up directly in the Wasm file itself. Note that this is covered in the
// various output formats as well:
//
// * `bundler` - they think wasm is an ES module anyway
// * `bundler` - they think Wasm is an ES module anyway
// * `web` - we're sure to emit more `import` directives during
// `gen_init` and we update the import object accordingly.
// * `nodejs` - the polyfill we have for requiring a wasm file as a node
// * `nodejs` - the polyfill we have for requiring a Wasm file as a node
// module will naturally emit `require` directives for the module
// listed on each wasm import.
// listed on each Wasm import.
// * `no-modules` - imports aren't allowed here anyway from other
// modules and an error is generated.
if js.fields.is_empty() {
Expand Down Expand Up @@ -2928,11 +2928,11 @@ impl<'a> Context<'a> {
// needed.
CallAdapter(_) => saw_call = true,

// Conversions to wasm integers are always supported since
// Conversions to Wasm integers are always supported since
// they're coerced into i32/f32/f64 appropriately.
IntToWasm { .. } => {}

// Converts from wasm to JS, however, only supports most
// Converts from Wasm to JS, however, only supports most
// integers. Converting into a u32 isn't supported because we
// need to generate glue to change the sign.
WasmToInt {
Expand Down Expand Up @@ -3993,7 +3993,7 @@ impl<'a> Context<'a> {
let stack_pointer = match self.aux.stack_pointer {
Some(s) => s,
// In theory this shouldn't happen since malloc is included in
// most wasm binaries (and may be gc'd out) and that almost
// most Wasm binaries (and may be gc'd out) and that almost
// always pulls in a stack pointer. We can try to synthesize
// something here later if necessary.
None => bail!("failed to find stack pointer"),
Expand Down
Loading
Loading