An internal DSL builds new languages atop a base language, whose syntax it borrows and stylizes.
一个内部DSL在基本语言基础之上构建新的语言,并借用和样式化基本语言的语法。
It is common in internal DSLs to stylize the use of the base language to make the DSL more readable.
样式化基本语言以使DSL更加可读的行为在内部DSLs中是很常见的。
Because I was creating an internal DSL, which in my case is a Ruby API, the creation of the DSL could be purely test driven.
由于我创建的是一个内部DSL,它在我这个例子里是一个RubyAPI,这套dsl的创建完全可以遵循测试驱动的实践。
If you intend to reuse your internal DSL, ensure that no application-specific business logic sneaks in, but provide a mechanism for capturing that business logic.
如果你打算重用你的内部DSL,那么请确定没有任何针对应用程序的业务逻辑掺杂其中,而是提供一个机制来俘获业务逻辑。
From the language design perspective, an external DSL provides the greatest flexibility, since internal DSLs must respect the parsing and language semantics of the host language.
从语言设计的角度来看,外部领域特定语言能够提供最大程度的灵活性,因为内部领域特定语言语言必须遵循宿主语言的解析和语言语义。
As byte code generated from JRuby will run in the JRE, the DSL is categorized as "internal" - which USES a general programming language to create a specific programming language.
因为由JRuby生成的字节码最终会在JRE上运行,所以这个DSL应该被视为“内部”DSL——使用一个通用编程语言来创建一个特定编程语言。
As byte code generated from JRuby will run in the JRE, the DSL is categorized as "internal" - which USES a general programming language to create a specific programming language.
因为由JRuby生成的字节码最终会在JRE上运行,所以这个DSL应该被视为“内部”DSL——使用一个通用编程语言来创建一个特定编程语言。
应用推荐