NetLogo / Tortoise

Compiler and runtime engine for NetLogo models that runs in JavaScript 🐢
https://netlogoweb.org
Other
56 stars 27 forks source link

The compiler should implement the desktop compiler's optimizations #176

Closed TheBizzle closed 4 years ago

TheBizzle commented 8 years ago

The NetLogo Web compiler does not yet reproduce any of the desktop compiler's optimizations. This has two negative effects:

  1. Some primitives are much slower than they need to be
  2. It causes divergent RNG states

I think that item (2) is honestly the bigger problem right now. Sure, I welcome any speedup that NetLogo Web gets, but (2) causes legitimate problems. First of all, it means that some of our language tests cannot be run, because the tests error when they detect divergent RNG states. Secondly, it means that random-seed does not always guarantee reproducible results between desktop NetLogo and NLW, which is unpleasant, and it's not easy for users to predict when divergence will occur and when it won't.

LaCuneta commented 4 years ago

I did a quick review here and there are only a couple remaining unimplemented optimizations that I see. Updated our wiki page as well.

LaCuneta commented 4 years ago

I went ahead and completed the last two, so we can close this and not worry about compiler optimization parity for a while!