Skip to content

2024

Rust Async Brief

As I tried to write a demo by rust wasm, I was thinking about what should be a better signature to export by rust for wasm. In the demo, I exported the process function as a promise:

pub async fn process(input: &[u8]) -> js_sys::Promise

This blog discusses my understanding of async concept in rust and discussion whether returning a promise is a good choice.

Rust Wasm Trail

Recently, I got interested in the WASM as it enables you to write code by rust but run it in the browser. At the first glance, I feel it greatly benefits the case that could be done in the client side, but due to the implementation, it still runs on the server side. It has two big benefits:

  • save server resources
  • implement in a strong type language with many powerful libraries and run it in the browser
  • more portable and convenient

This especially for small tool sites as it usually requires some computation resource, but not many. This blog records my experience to trail the rust wasm for my small tool. It's not a blog about what is wasm and the technical designs/implementations of rust wasm.

Go Tool Pprof

Profile is a common concept among programming languages, it helps to access the program status like CPU, memory usage, and so forth. You may assume that only the languages with runtime could profile, but that's totally wrong. Languages without runtime like C, C++ could profile themselves as well by diverse approaches. For example, the compiler could insert some code instructions for profiling, or the profiler could interrupt the program to record its states periodically.

Half done as I don't have enough knowledge about Go runtime management.

Tracing System Keynotes

This is a keynote blog about the tracing system, including the tracing platform, sdk, the whole work flow, and the problem it wants to solve. It's not a manual or a very detail page to introduce how tracing works.