You can create an interpreter in the finally tagless style:
https://okmij.org/ftp/tagless-final/
This embeds the target language as combinators in a host language, so you can construct and evaluate programs.
https://okmij.org/ftp/tagless-final/
This embeds the target language as combinators in a host language, so you can construct and evaluate programs.
https://higherlogics.blogspot.com/search/label/tagless%20int...
The style of the construction is what matters most. If you're using JS then you're already giving up types, but the higher order abstract syntax is what lets you embed and play with language semantics.