Skip to content

Commit

Permalink
Add features/anti-features to project readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalIcing committed Jan 21, 2025
1 parent 0e6a886 commit f493fdc
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,31 @@

<p dir="ltr" align="center"><a href="https://livebook.dev/run?url=https%3A%2F%2Fgithub.com%2FRoyalIcing%2FOrb%2Fblob%2Fmain%2Fexamples%2Ftemperature-converter.livemd" rel="nofollow"><img src="https://livebook.dev/badge/v1/black.svg" alt="Livebook: Temperature Converter"></a></p>

## Features

Write WebAssembly with the power of Elixir as your compiler:

- Use Elixir’s **module system** to break problems down and then compose them together.
- Allow access to nearly all WebAssembly 1.0 instructions.
- Produce tiny `.wasm` executables: kilobytes not megabytes.
- Use Elixir modules to organize and reuse code.
- Use Elixir functions and macros to create composable abstractions.
- Chain function calls together with the **pipe `|>` operator**.
- Publish reusable code with the [**Hex package manager**](https://hex.pm).
- Run any Elixir code at compile time, including [Hex packages](https://hex.pm). e.g. talk to the rest of your Elixir application, call out to an Elixir library, or make network requests.
- **Write unit tests** using [Elixir’s built-in ExUnit](https://hexdocs.pm/ex_unit/ExUnit.html).
- Reduce boilerplate with Elixir’s **powerful macro system**.
- **Run dynamic Elixir code at compile time** e.g. talk to the rest of your Elixir application, call out to an Elixir library, or make network requests.
- **Compile modules on-the-fly** e.g. use feature flags to conditionally compile code paths or enable particular WebAssembly instructions, creating a custom “tree shaken” WebAssembly module per user.
- Define your own WebAssembly instructions that output to `wat` and `wasm` formats.

## Status

Orb is alpha in active development. My aim is to refine the current feature set and complete a `.wasm` compiler (current it compiles to WebAssembly’s `.wat` text format) in order to get to beta.

## Anti-Features

- Allow executing any Elixir code in WebAssembly runtime. It’s not a goal of Orb to take a piece of everyday Elixir code and have it run in WebAssembly. However, because you can use macros you could decide to build that functionality on top of Orb.
- Allow access to the DOM. I believe the DOM is a poor fit for WebAssembly with its big object graph.
- WASI support. It’s not stabilized yet and for now I’d rather it be a library built on top of Orb.
- Produce the most optimized code possible through deep analysis. I recommend using `wasm-opt` if you really need to squeeze every byte possible.

## Libraries

- **Orb** (alpha): Write WebAssembly 1.0 in Elixir.
Expand Down

0 comments on commit f493fdc

Please sign in to comment.