What is the relationship between the Minsc language and Policy language? Quoting from the Minsc website &quot;Minsc is a high-level scripting language...based on the Miniscript Policy language with additional features and syntactic sugar sprinkled on top including variables, functions, infix notation and more.&quot;
This question describes the relationship between Policy, Miniscript and Script. Sanket Kanjalkar explains how Policy compiles down to Miniscript whilst Miniscript is encoded to Bitcoin Script. So what about the relationship between Minsc and Policy? How best to describe this?
This is a work in progress in answer based on a conversation between the creator of Minsc (shesek) and me. I am paraphrasing so any errors are my own.
Minsc has a runtime environment with a Policy data type that gets constructed as the result of evaluating the program. The program evaluation could be considered part of the compilation process, in which case you could say that Minsc compiles to Policy but it is also possible to consider this evaluation as the runtime and say that Minsc doesn't compile at all, but is rather an interpreted scripting language with a runtime Policy datatype that could be produced by it. Functions/programs can return different data types too, but the high-level API catches when the main program does that and considers it an error.