title: How does the web_sys crate works?
body: <p>So after extensive searching and reading, I get WHAT <code>web_sys</code> crate is for and WHAT it does, but I still have no idea HOW it does it.</p>
  
  <p>I had an impression, that WebAssembly code cannot directly call JS or access its objects/methods. Is my understanding wrong? And if not, how does <code>web_sys</code> do the calls to the WebGL/Canvas/DOM methods?</p>
  
  <p>Also, more practical question. What (if any) is the overhead of using <code>web_sys</code> in comparison to just JS calls?</p>