<i>&gt;Of course, since these are internal DSLs, it&#x27;s often hard or impossible to isolate the code written in the DSL from the rest of the program</i><p>Exactly, but that is also why you lose basically all advantages of DSLs. I don&#x27;t think internal DSLs deserve to be called DSLs at all. They are simply libraries that tend to use a lot of operator overloading.<p>The whole point of DSLs is to formally restrict what a given expression could possibly mean. That&#x27;s what allows inference, optimization and sensible error messages that use the terminology of the DSL and not that of some underlying much more general language.