logoalt Hacker News

An iroh powered smart fan

57 pointsby surprisetalklast Tuesday at 1:30 PM4 commentsview on HN

Comments

shermantanktoptoday at 2:19 AM

This is interesting as an example of just how complicated and elaborate a toolchain you can use to build something dead simple.

There’s a lot that comes for free by adding all these libraries and crates and steps. But from what I can tell it comes down to:

let _ = if fan_on { fan.set_high() } else { fan.set_low() };

show 1 reply
skybriantoday at 2:28 AM

It's unclear to me why they needed to compile Rust to WebAssembly to write a website. It looks like iroh has a JavaScript API:

https://docs.iroh.computer/languages/javascript

Edit: actually, that's a Node.js-specific API. For browsers, it seems like they should have a platform-independent JavaScript/TypeScript API that includes a WebAssembly file (if needed) instead of expecting you to compile WebAssembly yourself.

show 1 reply