2023-03-19 00:05:57 +00:00
# WebAssembly Micro Runtime
2019-11-21 02:30:57 +00:00
**A [Bytecode Alliance][BA] project**
[BA]: https://bytecodealliance.org/
2022-11-21 10:02:02 +00:00
**[Guide](https://wamr.gitbook.io/)**    **[Website](https://bytecodealliance.github.io/wamr.dev)**    **[Chat](https://bytecodealliance.zulipchat.com/#narrow/stream/290350-wamr)**
2022-10-20 11:12:21 +00:00
2023-05-03 06:21:34 +00:00
[Build WAMR ](./doc/build_wamr.md ) | [Build AOT Compiler ](./wamr-compiler/README.md ) | [Embed WAMR ](./doc/embed_wamr.md ) | [Export Native API ](./doc/export_native_api.md ) | [Build Wasm Apps ](./doc/build_wasm_app.md ) | [Samples ](./samples/README.md )
2022-01-25 08:37:31 +00:00
2023-03-19 00:05:57 +00:00
WebAssembly Micro Runtime (WAMR) is a lightweight standalone WebAssembly (Wasm) runtime with small footprint, high performance and highly configurable features for applications cross from embedded, IoT, edge to Trusted Execution Environment (TEE), smart contract, cloud native and so on. It includes a few parts as below:
2024-04-22 06:34:52 +00:00
- [**VMcore** ](./core/iwasm/ ): A set of runtime libraries for loading and running Wasm modules. It supports rich running modes including interpreter, Ahead-of-Time compilation(AoT) and Just-in-Time compilation (JIT). WAMR supports two JIT tiers - Fast JIT, LLVM JIT, and dynamic tier-up from Fast JIT to LLVM JIT.
- [**iwasm** ](./product-mini/ ): The executable binary built with WAMR VMcore which supports WASI and command line interface.
2023-03-19 00:05:57 +00:00
- [**wamrc** ](./wamr-compiler/ ): The AOT compiler to compile Wasm file into AOT file
- Useful components and tools for building real solutions with WAMR vmcore:
2024-02-20 10:12:36 +00:00
- [App-framework ](https://github.com/bytecodealliance/wamr-app-framework/blob/main/app-framework/README.md ): A framework for supporting APIs for the Wasm applications
2024-04-22 06:34:52 +00:00
- [App-manager ](https://github.com/bytecodealliance/wamr-app-framework/blob/main/app-mgr/README.md ): A framework for dynamical loading the Wasm module remotely
2023-03-19 00:05:57 +00:00
- [WAMR-IDE ](./test-tools/wamr-ide ): An experimental VSCode extension for developping WebAssembly applications with C/C++
2022-06-02 06:33:03 +00:00
2019-05-08 10:05:36 +00:00
2022-01-25 08:37:31 +00:00
### Key features
2023-03-19 00:05:57 +00:00
- Full compliant to the W3C Wasm MVP
2024-04-23 09:15:53 +00:00
- Small runtime binary size (core vmlib on cortex-m4f with tail-call/bulk memroy/shared memroy support, text size from bloaty)
* ~58.9K for fast interpreter
* ~56.3K for classic interpreter
* ~29.4K for aot runtime
* ~21.4K for libc-wasi library
* ~3.7K for libc-builtin library
2022-01-25 08:37:31 +00:00
- Near to native speed by AOT and JIT
- Self-implemented AOT module loader to enable AOT working on Linux, Windows, MacOS, Android, SGX and MCU systems
2023-03-19 00:05:57 +00:00
- Choices of Wasm application libc support: the built-in libc subset for the embedded environment or [WASI ](https://github.com/WebAssembly/WASI ) for the standard libc
2022-01-25 08:37:31 +00:00
- [The simple C APIs to embed WAMR into host environment ](./doc/embed_wamr.md ), see [how to integrate WAMR ](./doc/embed_wamr.md ) and the [API list ](./core/iwasm/include/wasm_export.h )
2023-03-19 00:05:57 +00:00
- [The mechanism to export native APIs to Wasm applications ](./doc/export_native_api.md ), see [how to register native APIs ](./doc/export_native_api.md )
2022-01-25 08:37:31 +00:00
- [Multiple modules as dependencies ](./doc/multi_module.md ), ref to [document ](./doc/multi_module.md ) and [sample ](samples/multi-module )
- [Multi-thread, pthread APIs and thread management ](./doc/pthread_library.md ), ref to [document ](./doc/pthread_library.md ) and [sample ](samples/multi-thread )
2023-04-04 09:22:54 +00:00
- [wasi-threads ](./doc/pthread_impls.md#wasi-threads-new ), ref to [document ](./doc/pthread_impls.md#wasi-threads-new ) and [sample ](samples/wasi-threads )
2022-01-25 08:37:31 +00:00
- [Linux SGX (Intel Software Guard Extension) support ](./doc/linux_sgx.md ), ref to [document ](./doc/linux_sgx.md )
- [Source debugging support ](./doc/source_debugging.md ), ref to [document ](./doc/source_debugging.md )
- [XIP (Execution In Place) support ](./doc/xip.md ), ref to [document ](./doc/xip.md )
2022-03-10 07:13:38 +00:00
- [Berkeley/Posix Socket support ](./doc/socket_api.md ), ref to [document ](./doc/socket_api.md ) and [sample ](./samples/socket-api )
2023-04-03 07:54:44 +00:00
- [Multi-tier JIT ](./product-mini#linux ) and [Running mode control ](https://bytecodealliance.github.io/wamr.dev/blog/introduction-to-wamr-running-modes/ )
2024-03-06 01:29:40 +00:00
- Language bindings: [Go ](./language-bindings/go/README.md ), [Python ](./language-bindings/python/README.md ), [Rust ](./language-bindings/rust/README.md )
2022-01-25 08:37:31 +00:00
2023-03-19 00:05:57 +00:00
### Wasm post-MVP features
2021-04-15 03:29:20 +00:00
- [wasm-c-api ](https://github.com/WebAssembly/wasm-c-api ), ref to [document ](doc/wasm_c_api.md ) and [sample ](samples/wasm-c-api )
- [128-bit SIMD ](https://github.com/WebAssembly/simd ), ref to [samples/workload ](samples/workload )
- [Reference Types ](https://github.com/WebAssembly/reference-types ), ref to [document ](doc/ref_types.md ) and [sample ](samples/ref-types )
2024-04-07 06:54:02 +00:00
- [Bulk memory operations ](https://github.com/WebAssembly/bulk-memory-operations ), [Shared memory ](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md#shared-linear-memory ), [Memory64 ](https://github.com/WebAssembly/memory64 )
- [Tail-call ](https://github.com/WebAssembly/tail-call ), [Garbage Collection ](https://github.com/WebAssembly/gc ), [Exception Handling ](https://github.com/WebAssembly/exception-handling )
2019-05-08 06:04:35 +00:00
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
### Supported architectures and platforms
2024-03-06 01:29:40 +00:00
The WAMR VMcore supports the following architectures:
Enable AoT and wamr-sdk, and change arguments of call wasm API (#157)
* Implement memory profiler, optimize memory usage, modify code indent
* Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default
* Add a new extension library: connection
* Fix bug of reading magic number and version in big endian platform
* Re-org platform APIs: move most platform APIs from iwasm to shared-lib
* Enhance wasm loader to fix some security issues
* Fix issue about illegal load of EXC_RETURN into PC on stm32 board
* Updates that let a restricted version of the interpreter run in SGX
* Enable native/app address validation and conversion for wasm app
* Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused
* Refine binary size and fix several minor issues
Optimize interpreter LOAD/STORE opcodes to decrease the binary size
Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found
Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper
Add macros of global heap size, stack size, heap size for Zephyr main.c
Clear compile warning of wasm_application.c
* Add more strict security checks for libc wrapper API's
* Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files
* Enhance security of libc strcpy/sprintf wrapper function
* Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions
* Remove get_module_inst() and fix issue of call native
* Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate
* Refine interpreter call native process, refine memory boudary check
* Fix issues of invokeNative function of arm/mips/general version
* Add a switch to build simple sample without gui support
* Add BUILD_TARGET setting in makefile to replace cpu compiler flags in source code
* Re-org shared lib header files, remove unused info; fix compile issues of vxworks
* Add build target general
* Remove unused files
* Update license header
* test push
* Restore file
* Sync up with internal/feature
* Sync up with internal/feature
* Rename build_wamr_app to build_wasm_app
* Fix small issues of README
* Enhance malformed wasm file checking
Fix issue of print hex int and implement utf8 string check
Fix wasi file read/write right issue
Fix minor issue of build wasm app doc
* Sync up with internal/feature
* Sync up with internal/feature: fix interpreter arm issue, fix read leb issue
* Sync up with internal/feature
* Fix bug of config.h and rename wasi config.h to ssp_config.h
* Sync up with internal/feature
* Import wamr aot
* update document
* update document
* Update document, disable WASI in 32bit
* update document
* remove files
* update document
* Update document
* update document
* update document
* update samples
* Sync up with internal repo
2020-01-21 05:26:14 +00:00
- X86-64, X86-32
2020-02-27 08:38:44 +00:00
- ARM, THUMB (ARMV7 Cortex-M7 and Cortex-A15 are tested)
2020-03-24 11:04:29 +00:00
- AArch64 (Cortex-A57 and Cortex-A53 are tested)
2021-07-22 05:52:48 +00:00
- RISCV64, RISCV32 (RISC-V LP64 and RISC-V LP64D are tested)
2022-01-25 08:37:31 +00:00
- XTENSA, MIPS, ARC
2019-11-25 15:16:40 +00:00
2024-03-06 01:29:40 +00:00
The following platforms are supported, click each link below for how to build iwasm on that platform. Refer to [WAMR porting guide ](./doc/port_wamr.md ) for how to port WAMR to a new platform.
2023-03-19 00:40:51 +00:00
- [Linux ](./product-mini/README.md#linux ), [Linux SGX (Intel Software Guard Extension) ](./doc/linux_sgx.md ), [MacOS ](./product-mini/README.md#macos ), [Android ](./product-mini/README.md#android ), [Windows ](./product-mini/README.md#windows ), [Windows (MinGW) ](./product-mini/README.md#mingw )
- [Zephyr ](./product-mini/README.md#zephyr ), [AliOS-Things ](./product-mini/README.md#alios-things ), [VxWorks ](./product-mini/README.md#vxworks ), [NuttX ](./product-mini/README.md#nuttx ), [RT-Thread ](./product-mini/README.md#RT-Thread ), [ESP-IDF ](./product-mini/README.md#esp-idf )
2019-05-08 06:04:35 +00:00
2023-03-19 00:05:57 +00:00
## Getting started
2023-03-19 00:40:51 +00:00
- [Build VM core ](./doc/build_wamr.md ) and [Build wamrc AOT compiler ](./wamr-compiler/README.md )
- [Build iwasm (mini product) ](./product-mini/README.md ): [Linux ](./product-mini/README.md#linux ), [SGX ](./doc/linux_sgx.md ), [MacOS ](./product-mini/README.md#macos ) and [Windows ](./product-mini/README.md#windows )
2024-04-22 06:34:52 +00:00
- [Embed into C/C++ ](./doc/embed_wamr.md ), [Embed into Python ](./language-bindings/python ), [Embed into Go ](./language-bindings/go ), [Embed in Rust ](./language-bindings/rust )
2023-03-19 00:05:57 +00:00
- [Register native APIs for Wasm applications ](./doc/export_native_api.md )
- [Build wamrc AOT compiler ](./wamr-compiler/README.md )
- [Build Wasm applications ](./doc/build_wasm_app.md )
- [Port WAMR to a new platform ](./doc/port_wamr.md )
- [VS Code development container ](./doc/devcontainer.md )
2024-03-06 01:29:40 +00:00
- [Samples ](./samples ) and [Benchmarks ](./tests/benchmarks )
2024-04-10 23:50:08 +00:00
- [End-user APIs documentation ](https://bytecodealliance.github.io/wamr.dev/apis/ )
2019-06-04 02:34:46 +00:00
2020-08-11 03:30:51 +00:00
2023-03-19 00:05:57 +00:00
### Performance and memory
2023-03-25 01:39:20 +00:00
- [Blog: The WAMR memory model ](https://bytecodealliance.github.io/wamr.dev/blog/the-wamr-memory-model/ )
- [Blog: Understand WAMR heaps ](https://bytecodealliance.github.io/wamr.dev/blog/understand-the-wamr-heaps/ ) and [stacks ](https://bytecodealliance.github.io/wamr.dev/blog/understand-the-wamr-stacks/ )
2023-03-19 00:05:57 +00:00
- [Blog: Introduction to WAMR running modes ](https://bytecodealliance.github.io/wamr.dev/blog/introduction-to-wamr-running-modes/ )
2024-01-24 07:35:45 +00:00
- [Memory usage tuning ](./doc/memory_tune.md ): the memory model and how to tune the memory usage
2023-03-19 00:05:57 +00:00
- [Memory usage profiling ](./doc/build_wamr.md#enable-memory-profiling-experiment ): how to profile the memory usage
2024-01-24 07:35:45 +00:00
- [Performance tuning ](./doc/perf_tune.md ): how to tune the performance
2022-01-25 08:37:31 +00:00
- [Benchmarks ](./tests/benchmarks ): checkout these links for how to run the benchmarks: [PolyBench ](./tests/benchmarks/polybench ), [CoreMark ](./tests/benchmarks/coremark ), [Sightglass ](./tests/benchmarks/sightglass ), [JetStream2 ](./tests/benchmarks/jetstream )
2023-03-19 00:05:57 +00:00
- [Performance and footprint data ](https://github.com/bytecodealliance/wasm-micro-runtime/wiki/Performance ): the performance and footprint data
2022-01-25 08:37:31 +00:00
2019-05-08 06:04:35 +00:00
2021-07-06 01:24:09 +00:00
Project Technical Steering Committee
====================================
2021-07-28 13:53:37 +00:00
The [WAMR PTSC Charter ](./TSC_Charter.md ) governs the operations of the project TSC.
2021-07-06 01:24:09 +00:00
The current TSC members:
2022-11-07 03:11:43 +00:00
- [dongsheng28849455 ](https://github.com/dongsheng28849455 ) - **Dongsheng Yan** , < dongsheng.yan @ sony . com >
- [loganek ](https://github.com/loganek ) - **Marcin Kolny** , < mkolny @ amazon . co . uk >
2021-07-06 01:24:09 +00:00
- [lum1n0us ](https://github.com/lum1n0us ) - **Liang He** , < liang.he @ intel . com >
2021-08-02 02:46:21 +00:00
- [no1wudi ](https://github.com/no1wudi ) **Qi Huang** , < huangqi3 @ xiaomi . com >
2021-07-06 01:24:09 +00:00
- [qinxk-inter ](https://github.com/qinxk-inter ) - **Xiaokang Qin** , < xiaokang.qxk @ antgroup . com >
2023-10-13 07:30:59 +00:00
- [ttrenner ](https://github.com/ttrenner ) - **Trenner, Thomas** , < trenner.thomas @ siemens . com >
2021-07-06 01:24:09 +00:00
- [wei-tang ](https://github.com/wei-tang ) - **Wei Tang** , < tangwei.tang @ antgroup . com >
- [wenyongh ](https://github.com/wenyongh ) - **Wenyong Huang** , < wenyong.huang @ intel . com >
2023-10-13 07:30:59 +00:00
- [woodsmc ](https://github.com/woodsmc ) - **Woods, Chris** , < chris.woods @ siemens . com >
2021-07-06 01:24:09 +00:00
- [xujuntwt95329 ](https://github.com/xujuntwt95329 ) - **Jun Xu** , < Jun1.Xu @ intel . com >
2021-08-02 02:46:21 +00:00
- [xwang98 ](https://github.com/xwang98 ) - **Xin Wang** , < xin.wang @ intel . com > (chair)
2022-11-07 03:11:43 +00:00
- [yamt ](https://github.com/yamt ) - **Takashi Yamamoto** , < yamamoto @ midokura . com >
2021-07-06 01:24:09 +00:00
2019-11-11 23:45:21 +00:00
License
=======
WAMR uses the same license as LLVM: the `Apache 2.0 license` with the LLVM
exception. See the LICENSE file for details. This license allows you to freely
use, modify, distribute and sell your own products based on WAMR.
Any contributions you make will be under the same license.
2019-08-01 08:57:54 +00:00
2020-09-30 00:30:58 +00:00
# More resources
2023-03-19 00:40:51 +00:00
- [Who use WAMR? ](https://github.com/bytecodealliance/wasm-micro-runtime/wiki )
2023-03-19 00:05:57 +00:00
- [WAMR Blogs ](https://bytecodealliance.github.io/wamr.dev/blog/ )
2023-03-19 00:40:51 +00:00
- [Community news and events ](https://bytecodealliance.github.io/wamr.dev/events/ )
2023-03-19 00:05:57 +00:00
- [WAMR TSC meetings ](https://github.com/bytecodealliance/wasm-micro-runtime/wiki/TSC-meeting-notes )
2019-05-18 15:39:12 +00:00