# How does the Simulator work?

**URL:** https://forum.xod.io/t/how-does-the-simulator-work/2528
**Category:** Uncategorized
**Created:** [August 26, 2019, 2:19pm UTC](https://forum.xod.io/t/how-does-the-simulator-work/2528 "2019-08-26T14:19:35Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![vcbz](https://avatars.discourse-cdn.com/v4/letter/v/439d5e/32.png) [@vcbz](https://forum.xod.io/u/vcbz)
#### Post date: [August 26, 2019, 2:19pm UTC](https://forum.xod.io/t/how-does-the-simulator-work/2528/1 "2019-08-26T14:19:35Z")

</div>

Hi guys, I would like to check how the simulator works. which source files should I read first to understand how its being called and updating the values on the xod-client. Im still a little clueless since the repository has a lot of different modules.

---

<div class="post-metadata">

### Author: ![nkrkv](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.xod.io/nkrkv/32/8_2.png) [@nkrkv](https://forum.xod.io/u/nkrkv)
#### Post date: [August 28, 2019, 12:14pm UTC](https://forum.xod.io/t/how-does-the-simulator-work/2528/2 "2019-08-28T12:14:58Z")

</div>

Hello! The simulator works as follows:

- The program is transpiled to C++ (the `xod-arduino` package)
- The resulting code is sent to the XOD cloud compiler service (`xod-cloud-compile`)
- The service compiles it using Emscripten and sends WASM-binary back
- The binary is being run in a sandbox (`xod-client-electron`)
- The binary sends debug protocol lines as any physical Arduino would
- XOD IDE parses the messages (`xod-client`) and reacts accordingly
