diff --git a/README.md b/README.md index b5cd1a27e..fdca7dc39 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ to compile Wasm or HIR modules/programs to Miden Assembly and test them. > [!TIP] > We've published initial [documentation](https://0xpolygonmiden.github.io/compiler) -> in mdBook format for easier reading, also accesible in the `docs` directory. This documentation +> in mdBook format for easier reading, also accessible in the `docs` directory. This documentation > covers how to get started with the compiler, provides a couple guides for currently supported > use cases, and contains appendices that go into detail about various design aspects of the > toolchain. diff --git a/docs/src/appendix/calling_conventions.md b/docs/src/appendix/calling_conventions.md index 9f4df13d1..e89d48228 100644 --- a/docs/src/appendix/calling_conventions.md +++ b/docs/src/appendix/calling_conventions.md @@ -113,7 +113,7 @@ Interacting with memory in Miden is quite similar to WebAssembly in some ways: * The address space is linear, with addresses starting at zero, and ranging up to 2^32-1 * There is no memory protection per se, you either have full read/write access, or no access to a specific memory context -* How memory is used is completely up the program being executed +* How memory is used is completely up to the program being executed This is where it begins to differ though, and takes on qualities unique to Miden (in part, or whole): @@ -194,10 +194,10 @@ are allocated space in a reserved region of linear memory in a single consecutiv and because Miden is a Harvard architecture machine, there are no return addresses. Instead, languages (such as C) which have the concept of a stack frame with implications for the semantics of say, taking the address of a local variable, will need to emit code in function prologues and epilogues to maintain a shadow stack in Miden's linear memory. If all you need is local variables, you can get away with -leaning on Miden's notion of local variables without implenting a shadow stack. +leaning on Miden's notion of local variables without implementing a shadow stack. Because there are no registers, the notion of callee-saved or caller-saved registers does not have a direct equivalent in Miden. However, -in its place, a somewhat equivalent set of rules defines the contract betweeen caller and callee in terms of the state of the operand stack, +in its place, a somewhat equivalent set of rules defines the contract between caller and callee in terms of the state of the operand stack, those are described below in the section covering the operand stack. ### The shadow stack @@ -257,7 +257,7 @@ Functions in Miden IR always have a signature, which specify the following: * The calling convention required to call the function * The number and types of the function arguments -* The type of value, if any, returned by by the function, and whether it is returned by value or reference +* The type of value, if any, returned by the function, and whether it is returned by value or reference The following table relates IR types to how they are expected to be passed from the caller to the callee, and vice versa: diff --git a/docs/src/guides/rust_to_wasm.md b/docs/src/guides/rust_to_wasm.md index 268e6325e..c1309ce75 100644 --- a/docs/src/guides/rust_to_wasm.md +++ b/docs/src/guides/rust_to_wasm.md @@ -7,7 +7,7 @@ modules and compile them on to Miden Assembly, which will be covered in the next ## Setup First, let's set up a simple Rust project that contains an implementation of the Fibonacci -function (I know, its overdone, but we're trying to keep things as simple as possible to +function (I know, it's overdone, but we're trying to keep things as simple as possible to make it easier to show the results at each step, so bear with me): Start by creating a new library crate: @@ -41,7 +41,7 @@ crate-type = ["cdylib"] [dependencies] # Use a tiny allocator in place of the default one, if we want # to make use of types in the `alloc` crate, e.g. String. We -# don't need that now, but its good information to have in hand. +# don't need that now, but it's good information to have in hand. #wee_alloc = "0.4" # When we build for Wasm, we'll use the release profile diff --git a/docs/src/guides/wasm_to_masm.md b/docs/src/guides/wasm_to_masm.md index 0192ce75d..c07be88ef 100644 --- a/docs/src/guides/wasm_to_masm.md +++ b/docs/src/guides/wasm_to_masm.md @@ -1,7 +1,7 @@ # Compiling WebAssembly to Miden Assembly This chapter will walk you through compiling a WebAssembly (Wasm) module, in binary form -(i.e. a `.wasm` file), to an corresponding Miden Assembly (Masm) module (i.e. a `.masm` file). +(i.e. a `.wasm` file), to a corresponding Miden Assembly (Masm) module (i.e. a `.masm` file). ## Setup @@ -80,7 +80,7 @@ the code we generate will match what you would write by hand. > [!NOTE] > This example is more complicated than it needs to be at the moment, bear with us! -Assuming you have followed the instruction for installing the Miden VM locally, +Assuming you have followed the instructions for installing the Miden VM locally, we can test this program out as follows: First, we need to define a program to link our `wasm_fib.masm` module into, since