|
3 | 3 | </p> |
4 | 4 |
|
5 | 5 | <p align="center"> |
6 | | - <a href="https://github.com/AssemblyScript/assemblyscript/actions/workflows/test.yml"><img src="https://img.shields.io/github/actions/workflow/status/AssemblyScript/assemblyscript/test.yml?branch=main&label=test&logo=github" alt="Test status" /></a> |
7 | | - <a href="https://github.com/AssemblyScript/assemblyscript/actions/workflows/publish.yml"><img src="https://img.shields.io/github/actions/workflow/status/AssemblyScript/assemblyscript/publish.yml?branch=main&label=publish&logo=github" alt="Publish status" /></a> |
8 | | - <a href="https://www.npmjs.com/package/assemblyscript"><img src="https://img.shields.io/npm/v/assemblyscript.svg?color=007acc&logo=npm" alt="npm compiler version" /></a> |
9 | | - <a href="https://discord.gg/assemblyscript"><img src="https://img.shields.io/discord/721472913886281818.svg?label=discord&logo=discord&logoColor=ffffff&color=7389D8" alt="Discord online" /></a> |
10 | | - <a href="https://stand-with-ukraine.pp.ua"><img src="https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg" alt="#StandWithUkraine" /></a> |
| 6 | + <a href="https://www.npmjs.com/package/@btc-vision/assemblyscript"><img src="https://img.shields.io/npm/v/@btc-vision/assemblyscript.svg?color=007acc&logo=npm" alt="npm version" /></a> |
| 7 | + <a href="https://github.com/btc-vision/assemblyscript/releases"><img src="https://img.shields.io/github/v/release/btc-vision/assemblyscript?color=green&logo=github" alt="GitHub release" /></a> |
11 | 8 | </p> |
12 | 9 |
|
| 10 | +--- |
| 11 | + |
| 12 | +## WARNING: EXPERIMENTAL FORK |
| 13 | + |
| 14 | +**This is an experimental fork of AssemblyScript maintained by [btc-vision](https://github.com/btc-vision).** It includes features that are not yet available in the official AssemblyScript release: |
| 15 | + |
| 16 | +### Experimental Features |
| 17 | + |
| 18 | +- **Closures** - Full closure support with captured variables |
| 19 | +- **Try-Catch-Finally** - Exception handling with try-catch-finally blocks |
| 20 | +- **Binaryen 125** - Updated to the latest Binaryen version (125.0.0) |
| 21 | +- **Enhanced Shadow Stack** - Improved shadow stack pass for better GC integration |
| 22 | + |
| 23 | +### Changes from Upstream |
| 24 | + |
| 25 | +1. **Closure Support** |
| 26 | + - Closure capture analysis and recompilation logic |
| 27 | + |
| 28 | +2. **Exception Handling** |
| 29 | + - Try-catch-finally statement support |
| 30 | + - Enforced Error type in throw statements |
| 31 | + |
| 32 | +3. **Binaryen Upgrade (123 → 125)** |
| 33 | + - Updated ExpressionId enum values to match Binaryen 125 |
| 34 | + - Fixed shadow stack pass timing to handle lazy function compilation |
| 35 | + - Moved `compileVisitGlobals`/`compileVisitMembers` after shadow stack pass |
| 36 | + - Added iterative shadow stack transformation for newly compiled functions |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +## Installation |
| 41 | + |
| 42 | +```sh |
| 43 | +npm install @btc-vision/assemblyscript |
| 44 | +``` |
| 45 | + |
| 46 | +### Usage |
| 47 | + |
| 48 | +This fork is a drop-in replacement for AssemblyScript. Simply replace your import: |
| 49 | + |
| 50 | +```json |
| 51 | +{ |
| 52 | + "dependencies": { |
| 53 | + "@btc-vision/assemblyscript": "^0.29.0" |
| 54 | + } |
| 55 | +} |
| 56 | +``` |
| 57 | + |
| 58 | +Or if migrating from official AssemblyScript: |
| 59 | + |
| 60 | +```sh |
| 61 | +npm uninstall assemblyscript |
| 62 | +npm install @btc-vision/assemblyscript |
| 63 | +``` |
| 64 | + |
| 65 | +The CLI commands remain the same: |
| 66 | + |
| 67 | +```sh |
| 68 | +npx asc your-file.ts --outFile output.wasm |
| 69 | +``` |
| 70 | + |
| 71 | +--- |
| 72 | + |
| 73 | +## Original README |
| 74 | + |
13 | 75 | <p align="justify"><strong>AssemblyScript</strong> compiles a variant of <a href="http://www.typescriptlang.org">TypeScript</a> (basically JavaScript with types) to <a href="http://webassembly.org">WebAssembly</a> using <a href="https://github.com/WebAssembly/binaryen">Binaryen</a>. It generates lean and mean WebAssembly modules while being just an <code>npm install</code> away.</p> |
14 | 76 |
|
15 | 77 | <h3 align="center"> |
|
39 | 101 | A development environment can be set up by cloning the repository: |
40 | 102 |
|
41 | 103 | ```sh |
42 | | -git clone https://github.com/AssemblyScript/assemblyscript.git |
| 104 | +git clone https://github.com/btc-vision/assemblyscript.git |
43 | 105 | cd assemblyscript |
44 | 106 | npm install |
45 | 107 | npm link |
|
0 commit comments