# @aldea/compiler

> Compiles AssemblyScript code into Aldea-flavoured WASM packages.

Latest version **0.7.0** (published 2024-10-17) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @aldea/compiler
pnpm add @aldea/compiler
yarn add @aldea/compiler
bun add @aldea/compiler
```

## Health

**Score 40/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; large bundle; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.7.0 |
| Published | 2024-10-17 |
| First published | 2022-12-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 5 |
| Unpacked size | 10.2 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | calvo.generico, brentongunning, libitx |

## Links

- npm: https://www.npmjs.com/package/@aldea/compiler
- npm.io page: https://npm.io/package/@aldea/compiler

## Dependencies (5)

- [@aldea/core](https://npm.io/package/@aldea/core.md) ^0.7.2
- [wasm-metering](https://npm.io/package/wasm-metering.md) ^0.2.1
- [assemblyscript](https://npm.io/package/assemblyscript.md) npm:@aldea/assemblyscript@0.27.14-X
- [comment-parser](https://npm.io/package/comment-parser.md) ^1.3.1
- [@aldea/wasm-metering](https://npm.io/package/@aldea/wasm-metering.md) ^0.1.0

## Recent versions

- 0.7.0 (latest) — 2024-10-17
- 0.6.1 — 2023-12-11
- 0.5.0 — 2023-11-22
- 0.4.1 — 2023-10-09
- 0.4.0 — 2023-09-21
- 0.3.0 — 2023-07-19
- 0.2.8 — 2023-06-29
- 0.2.7 — 2023-06-05
- 0.2.6 — 2023-05-30
- 0.2.5 — 2023-05-30
- 0.2.4 — 2023-05-29
- 0.2.3 — 2023-05-29
- 0.2.2 — 2023-05-24
- 0.2.1 — 2023-05-19
- 0.2.0 — 2023-05-19
- … 12 more at https://npm.io/package/@aldea/compiler/versions

## README

#  Aldea Compiler

![Version](https://img.shields.io/npm/v/@aldea/compiler?style=flat-square)
![License](https://img.shields.io/npm/l/@aldea/compiler?style=flat-square)

> Compiles AssemblyScript code into Aldea-flavoured WASM packages.

The Aldea Compiler wraps around and enhances the functionality of the AssemblyScript compiler and generates WASM binaries that are compatible with and safe to execute in the Aldea Computer:

- Validates that the code is safe to be executed in the Aldea Computer.
- Applies various "transforms" and glue code to the source to ensure that compiled packages can safely interoperate.
- Compiles and outputs an optimized WASM binary.
- Generates and outputs the package ABI document.
- Optionally parses and generates source code documentation.

## Usage

There are currently two ways to interact with the compiler:

### 1. Compiler CLI

The CLI can be a useful way to quickly debug code and inspect the generated ABI or docs.

```shell
aldea compile <INPUT_FILE> -o <OUTPUT_PATH>
```

### 2. Programatically

If you are integrating the compiler into other tools, it can be invoked programatically.

```ts
import { compile } from '@aldea/compiler'

const { output, stats, stdout } = await compile(srcCode)
const { abi, docs, wasm, wat } = output
```

## License

Aldea is open source and released under the [Apache-2 License](https://github.com/aldeacomputer/aldea-js/blob/main/packages/compiler/LICENSE).

© Copyright 2023 Run Computer Company, inc.

---
_Source: https://npm.io/package/@aldea/compiler · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
