This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* WIP/PROTOTYPE: Caveat emptor. If it breaks, you get to keep all the pieces. | |
* | |
* Compile with: | |
* | |
* clang -Wall -Wextra -fno-strict-aliasing --target=wasm32-wasi --sysroot=../wasi-sysroot -Wl,--no-entry,--export=__heap_base,--export=__data_end,--export=malloc,--export=free,--stack-first,-z,stack-size=$((8*1024*1024)),--initial-memory=$(((4096*1024*1024)-65536)) -mexec-model=reactor -o demo-unit.wasm demo-unit.c | |
* | |
* Download the wasi-sysroot tarball from https://github.com/WebAssembly/wasi-sdk/releases | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* SPDX-License-Identifier: Apache-2.0 */ | |
/* | |
* Copyright (C) Andrew Clayton | |
* Copyright (C) Timo Stark | |
* Copyright (C) F5, Inc. | |
*/ | |
// Include RAW FFI Bindings. | |
// @todo: Replace this with the new native Rust API |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This will compare the libunit-wasm luw-echo-request module with the same | |
implemented using wasi-http and built as a component. | |
You will notice we don't get all the same information with wasi-http. | |
I also hasten to add that I have somewhat sanitised the wasi-http API (which of | |
course is an autogenerated monstrosity) by removing `_0_2_0_rc_2023_11_10` and | |
`_0_2_0_RC_2023_11_10` from all the `wasi_` and `WASI_` function/type names. | |
I have also removed _all_ the error checking from the below pasted wasi-http |