The browser provides a lot of low level APIs. Unfortunately wanting to write JavaScript for hardware can be a hassle if the libraries only exist in certain languages. This can be solved by writing your own APIs, and wrappers. Write high level code to communicate with hardware.