Regular Memory

An Embedded Language

I came across an interesting program that at first appeared to be Javascript, but inside the program was a string. Strings were common, but this string interesting in particular was interesting because it contained the code for a second program written in a second language, and it appeared that natively, by default, Javascript was able to interpret the contents of this string as a turing complete programing language. Stranger still, several functions were exported from the string, I assume they were generated from the embedded program, and these functions were used as if they were Javascript programs.

I could see from the context that this internal program was capable of computing anything. However, it could not escape a defined execution boundary. This was, or should have been, quite a relevatory discovery, but there was noise around it’s introduction, and something to do with syntax highlighting appeared to be the reason why it didn’t have more impact.

A program that could run other programs without the threat of escape; could anything else possibly add value after that.