It&#x27;s not as impossible as it sounds.<p>There are many JS engines which are extremely small compared to the big guys used in browsers. Most of them tend to grab a subset of the language and implement that.<p>For example, the creators of nginx created their own specialized engine called nginScript that runs JS for their stuff <a href="https:&#x2F;&#x2F;www.nginx.com&#x2F;resources&#x2F;wiki&#x2F;nginScript&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.nginx.com&#x2F;resources&#x2F;wiki&#x2F;nginScript&#x2F;</a><p>There is even a javascript interpreter written in javascript which can be a good starting point to learn a bit how it works <a href="https:&#x2F;&#x2F;github.com&#x2F;jterrace&#x2F;js.js&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jterrace&#x2F;js.js&#x2F;</a>