jwagner / simplex-noise.js

A fast simplex noise implementation in Javascript / Typescript.
MIT License
1.61k stars 130 forks source link

simplify interface #21

Closed semibran closed 6 years ago

semibran commented 6 years ago

Addresses #16 and #20.

jwagner commented 6 years ago

Hello semibran,

While the interface you propose is elegant it has significant drawbacks:

The interface of simplex-noise.js has been designed in this way for a reason, monomorphic code is nearly always faster in javascript. See [https://mrale.ph/blog/2015/01/11/whats-up-with-monomorphism.html](What's up with monomorphism?) for some more details on that.

So while I appreciate your effort this is not the direction I want to take this library in.

There are places where elegance trumps performance and practicality so it could be a great idea to create a javascript library based on simplex-noise that just implements the simplified interface on top of it.