A simple ping implement by zig.
ohpm install @ohos-rs/zig-pingimport{ping}from"@ohos-rs/zig-ping";consthandlePing=async()=>{constret=awaitping("www.baidu.com");console.log(ret);};Previously, we had a fully functional ping tool built using ohos-rs.However, its release build size exceeded 900KB which is quite large for such a lightweight utility.
By re-implementing the same functionality in Zig, we successfully reduced the release build size to just 35KB—over four times smaller than the original version.