AI prompts
base on Toolchain for compiling TypeScript to WasmGC <div align="center">
<h1><code>Wasmnizer-ts</code></h1>
<p>
<strong>Toolchain for compiling TypeScript to WasmGC</strong>
</p>
<p>
<a href="https://github.com/WebAssembly/gc"><img src="https://img.shields.io/badge/-WasmGC-brightgreen"></a>
</p>
</div>
## Overview
`Wasmnizer-ts` utilizes [WasmGC](https://github.com/WebAssembly/gc) to compile TypeScript source code into WebAssembly bytecode, and support dynamic type (such as any) through host APIs. The `Wasmnizer-ts` now supports a strict subset of TypeScript and continuously strives to accommodate more semantics.
There are three components in `Wasmnizer-ts`:
- `ts2wasm-compiler`: a compiler for compiling TypeScript source code into WasmGC bytecode.
- `ts2wasm-stdlib`: standard library implemented in ts source code, will be compiled with application together. See [standard library](./doc/standard-library/index.md).
- `ts2wasm-runtime-library`: runtime libraries for exposing host APIs required for running the generated wasm module, including:
1. `libdyntype`: support dynamic objects, see API spec [here](./doc/libdyntype_api_spec.md). We have proposed a [WASI proposal](https://github.com/WebAssembly/WASI/issues/552).
2. `libstruct-indirect`: access WasmGC struct fields through index calculated during runtime, see API spec [here](./doc/libstruct_indirect_api_spec.md). These APIs are used to emulate the behaviour of the [proposed struct.get/set_indirect opcode](https://github.com/WebAssembly/gc/issues/397).
3. `libstd`: standard library implemented in native, such as `console.log`, see [standard library](./doc/standard-library/index.md).
> **Note**: **This project is highly experimental and under active development, DO NOT use in production**
## Features
- **garbage collection**. `ts2wasm-compiler` leverage WebAssembly GC proposal, which can benefit from runtime's GC capability.
- **optimization**. `ts2wasm-compiler` uses binaryen as backend, which can benefit from binaryen's powerful optimization capabilities.
- **small footprint**. Data structures in source code is represented as WasmGC types, which avoids the requirement for `memory allocator` and `garbage collector` inside wasm module.
- **static compilation**. Type information in TypeScript source code is used to create static WasmGC types, which avoids the overhead of dynamic type checking.
- **dynamic typing**. `any` and other dynamic types in TypeScript source code are supported by host APIs.
## Execution environment
The wasm module generated by `ts2wasm-compiler` is designed to be executed in a WasmGC runtime environment. The runtime should provide the following capabilities:
- **WebAssembly proposals:**
- **[WasmGC](https://github.com/WebAssembly/gc) (mandatory)**: WasmGC proposal, which is a garbage collection mechanism for WebAssembly.
> Note: the GC opcode generated by binaryen is slightly different than [GC MVP](https://github.com/WebAssembly/gc/blob/main/proposals/gc/MVP.md), please see [here](https://docs.google.com/document/d/1DklC3qVuOdLHSXB5UXghM_syCh-4cMinQ50ICiXnK3Q/edit#heading=h.9dwoku9340md) for details.
- **[Exception handling](https://github.com/WebAssembly/exception-handling) (required by try-catch statements)**: exception handling proposal, which adds exception handling mechanism to WebAssembly.
- **[stringref](https://github.com/WebAssembly/stringref) (required by stringref feature)**: reference-typed strings proposal, provide a language independent string representation.
- **APIs:**
- **[libdyntype API](./doc/libdyntype_api_spec.md) (required by dynamic typing)**: APIs for supporting dynamic objects.
- **[libstruct-indirect API](./doc/libstruct_indirect_api_spec.md) (required by `interface` type)**: APIs for accessing WasmGC struct fields through index calculated during runtime.
- **libstd API (required by standard libraries)**: APIs for providing standard libraries from host environment.
`Wasmnizer-ts` currently implemented host APIs on multiple environments:
- [WebAssembly Micro Runtime (WAMR)](https://github.com/bytecodealliance/wasm-micro-runtime/tree/dev/gc_refactor): `libdyntype API`, `libstruct-indirect API` and `libstd API`
- chrome browser and nodejs (20.6.1+): part of `libdyntype API` implemented with JavaScript
Please see [feature list](./doc/developer-guide/feature_list.md) for supporting status of each feature.
Please goto [Getting Started](./doc/getting_started.md) for how to use the project and [Introduction](./doc/developer-guide/index.md) for more details.
## Contributing
We welcome contributions to Wasmnizer-ts. You can find more details in
[CONTRIBUTING.md](CONTRIBUTING.md) .
## License
`Wasmnizer-ts` uses the same license as LLVM: the Apache 2.0 license with the LLVM exception. See the [LICENSE](./LICENSE) file for details. Any contributions you make will be under the same license.
", Assign "at most 3 tags" to the expected json: {"id":"2682","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"