or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
Component Model Async Implementation Overview
Current status
debug-context.{new|debug-string}
not yet implemented, but should be easyImplementation details:
wasm-tools
wit-component
Implementation details:
wit-bindgen
wit_bindgen_rt::async_support
moduleasync_support::spawn
for spawning futures to run post-returnasync_support::block_on
for running futures from sync-lifted exportsstream<T>
->StreamReader<T>
andStreamWriter<T>
whereT: StreamPayload
impl<T> futures::Stream for StreamReader<T>
impl<T> futures::Sink for StreamWriter<T>
future<T>
->FutureReader<T>
andFutureWriter<T>
whereT: FuturePayload
impl<T> IntoFuture for FutureReader<T>
(means you can.await
it)StreamPayload
andFuturePayload
implementations generated automatically based on target worldImplementation details:
wasmtime
Promise
: likeFuture
, but requires aStoreContextMut<T>
to make progressLinkerInstance::func_wrap_concurrent
andfunc_new_concurrent
{Typed}Func::call_concurrent
StreamReader<T>
andStreamWriter<T>
FutureReader<T>
andFutureWriter<T>
wasmtime::component::bindgen
optionsconcurrent_imports
: generate code usingfunc_wrap_concurrent
instead offunc_wrap_async
concurrent_exports
: generate code usingcall_concurrent
instead ofcall_async
task.return
,task.wait
,stream.new
, etc.Implementation headaches:
wasmtime
T
inStore<T>
might not be'static
StoreContextMut<T>
rustc
gets confused about lifetimes*mut dyn VMStore
and unsafe cast toStoreContextMut<T>
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →Store
is tricky&mut
aliasing&mut
to*mut
must also return&mut
&mut
again