Skip to content

Commit

Permalink
Heading improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
thewtex committed Jun 4, 2024
1 parent 4fbe4d8 commit d13d9c8
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 28 deletions.
39 changes: 21 additions & 18 deletions papers/matt_mccormick/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,15 @@ abstract: |

## Introduction

### Motivation

In the quest for **enhanced interoperability and sustainability in scientific computing**, _WebAssembly (Wasm)_ emerges as a transformative technology.
Wasm offers a universal, efficient compilation target, enabling high-performance computing across varied programming languages and hardware architectures [@WebAssemblyCoreSpecification1; @WebAssemblyCoreSpecification2; @doi:10.1145/3140587.3062363].
This innovation is pivotal for scientific research, where analytical interoperability, tool sustainability, and computational efficiency are paramount.
Wasm's journey began with asm.js and evolved through Wasm and the WebAssembly System Interface (WASI).

### Brief history of Wasm

Asm.js was introduced by Alon Zakai via the Emscripten toolchain as a subset of JavaScript designed for high performance [@doi:10.1145/2048147.2048224].
It allowed developers to write code in languages like C and C++, compile it to asm.js, and run it in the browser with near-native performance.
Asm.js achieved this by using a statically-typed subset of JavaScript that enabled optimizations by the JavaScript engine.
Expand Down Expand Up @@ -76,6 +80,8 @@ Key features of WASI include:
With WASI, WebAssembly can be used to develop portable, high-performance applications that run anywhere.
A plethora of WASI runtimes are available that vary in their focus, such as embedding in programming languages, specialized hardware such as field-programmable gate arrays (FPGAs), embedded devices, security, speed, or high performance computing (HPC) environments [@WasiDev; @doi:10.1145/3572848.3577436; @Zhang2024-su].

### Wasm and scientific computing

Throughout its evolution, WebAssembly has focused on performance improvements. Some notable advancements relevant to scientific computing include:

- **Bulk memory operations**: efficient copy and movement of data in memory
Expand All @@ -86,22 +92,25 @@ The evolution of WebAssembly from asm.js to Wasm to WASI has been marked by cont

Wasm has been embraced in commercial and industrial contexts for web applications, game development, edge computing, and server-side computing. However, its adoption in scientific computing has been more limited. This is partly due to the established reliance specialized software stacks in the scientific community. Additionally, the integration of Wasm into existing scientific workflows requires overcoming challenges related to data interoperability, toolchain compatibility, and the inertia of entrenched computational practices.

Enter **ITK-Wasm**, a pioneering integration that marries the Insight Toolkit (ITK) and Wasm to enable high-performance scientific spatial analysis in a web browser or system-level environments [@doi:10.5281/zenodo.3688880; @doi:10.3389/fninf.2014.00013; @doi:10.5281/zenodo.889843].
ITK-Wasm is crafted to adhere to Wasm community standards, thereby facilitating the creation of Wasm modules that are _simple, performant, portable, modular, and interoperable_.
Enter **ITK-Wasm**, a pioneering resource that marries the Insight Toolkit (ITK) and open standards to seemlessly integrate Wasm for high-performance scientific spatial analysis or visualization[@doi:10.5281/zenodo.3688880; @doi:10.3389/fninf.2014.00013; @doi:10.5281/zenodo.889843].
ITK-Wasm supports both Emscripten-based Wasm in a web browser or WASI-SDK Wasm for system-level environments.
ITK-Wasm is crafted to adhere to Wasm community standards, thereby facilitating the creation of Wasm modules that are **simple, performant, portable, modular, and interoperable**.

ITK-Wasm provides infrastructure that empowers research software engineers to:

- Build scientific C/C++ codes to Wasm
- Bridge Wasm with
- Local filesystems
- Canonical scientific programming data interfaces such as NumPy arrays
- Traditional scientific file formats with an emphasis on multi-dimensional spatial data
- Generate idiomatic programming language bindings, packages, and documentation
- Transfer data efficiently in and out of the Wasm runtime
- Support asynchronous and parallel execution of processing pipelines in way that is easy to understand and implement
- _Build scientific C/C++ codes to Wasm_
- _Generate idiomatic programming language bindings, packages, and documentation_
- _Bridge Wasm with_
- _Local filesystems_
- _Canonical scientific programming data interfaces such as NumPy arrays_
- _Traditional scientific file formats with an emphasis on multi-dimensional spatial data_
- _Transfer data efficiently in and out of the Wasm runtime_
- _Support asynchronous and parallel execution of processing pipelines in way that is easy to understand and implement_

## Methods

### Overview

ITK-Wasm provides powerful, joyful tooling for scientific computation in Wasm through a number of distinct but related parts.

1. C++ core tooling
Expand Down Expand Up @@ -166,13 +175,7 @@ An `itk-wasm` Node.js _command line interface (CLI)_ drives
- Generation of language bindings and language package configurations
- Testing for Wasm binaries

The CLI can be installed via Node.js / NPM:

```sh
npm install -g itk-wasm
```

However, new projects are typically created with the `create-itk-wasm` CLI:
New projects are typically created with the `create-itk-wasm` CLI:

```sh
npx create-itk-wasm
Expand Down Expand Up @@ -205,7 +208,7 @@ When GPU-accelerated implementations of functions are available in other package
Cross-platform, cross-environment support with optional non-Wasm accelerator packages is made possible by a generated environment dispatch Python package, a WASI-based Python package, and a Pyodide package. The Pyodide package does not have typical Pyodide-Emscripten ABI limitations due to the application of principals from the Wasm Component Model.
:::

### Browser and system APIs
#### Browser and system APIs

While synchronous functions are available in system packages, browser packages provide asynchronous functions for non-blocking, performant execution in the JavaScript runtime event loop. These functions are called with modern Python's [async / await support](https://docs.python.org/3/library/asyncio-task.html).

Expand Down
1 change: 1 addition & 0 deletions papers/matt_mccormick/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"author": "",
"license": "Apache-2.0",
"devDependencies": {
"unist-builder": "^4.0.0"
}
}
22 changes: 21 additions & 1 deletion papers/matt_mccormick/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 12 additions & 9 deletions papers/matt_mccormick/unsplash.mjs
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
const unsplashDirective = {
name: 'unsplash',
doc: 'An example directive for showing a nice random image at a custom size.',
alias: ['random-pic'],
arg: { type: String, doc: 'The kinds of images to search for, e.g., `fruit`' },
name: "unsplash",
doc: "An example directive for showing a nice random image at a custom size.",
alias: ["random-pic"],
arg: {
type: String,
doc: "The kinds of images to search for, e.g., `fruit`",
},
options: {
size: { type: String, doc: 'Size of the image, for example, `500x200`.' },
size: { type: String, doc: "Size of the image, for example, `500x200`." },
},
run(data) {
console.log(data)
console.log("unsplash data", data);
const query = data.arg;
const size = data.options.size || '500x200';
const size = data.options.size || "500x200";
const url = `https://source.unsplash.com/random/${size}/?${query}`;
const img = { type: 'image', url };
const img = { type: "image", url };
return [img];
},
};

const plugin = { name: 'Unsplash Images', directives: [unsplashDirective] };
const plugin = { name: "Unsplash Images", directives: [unsplashDirective] };

export default plugin;

0 comments on commit d13d9c8

Please sign in to comment.