DSL框架的选择
我正在从事一个需要我定义 DSL 的项目。 由于提出正确的 DSL 对我的项目至关重要,因此我决定评估有助于定义 DSL、解析它和代码生成(必须采用基于 .NET 的语言)的现有框架。我考虑的框架是:
- Boo 语言它具有可定制的编译器和 Python 语法,非常适合定义 DSL。
- 支持可扩展命令行开关的 Windows powershell。
- 支持可视化建模的 Microsoft DSL 工具,但不太灵活(在我看来)
- ANTLR 是经过验证的
- C# 流畅接口工具。(对此不太满意)
- Oslo 框架(在生产中使用成熟吗?)
有优点和缺点对于上述每个框架,我无法做出决定。如果在上述框架之间进行选择,您会选择哪一个?为什么?
是否还有其他如此基础而我可能错过的框架?
任何帮助或指导将不胜感激。
I am working on a project that requires me to define a DSL. Since coming up with the right DSL is critical for my project, I decided to evaluate existing frameworks that help in defining DSLs,parsing it and code generation(which has to be in a .NET based language) The frameworks I considered are :
- Boo language that has a customizable compiler and pythonish syntax ideal for defining a DSL.
- Windows powershell that supports extensible commandlets.
- Microsoft DSL tools that support visual modeling,but less flexible(in my opinion)
- ANTLR which is proven tool
- C# fluent interfaces.(Not so happy with this)
- Oslo framework (Is it mature to be used in production?)
There are pros and cons of each of the framework mentioned above and I am unable to make a decision.Given a choice between the above frameworks, which one would you choose and why?
Is there any other framework so fundamental that I might have missed out?
Any help or guidance would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
Xtext:http://www.eclipse.org/Xtext/
Xtext: http://www.eclipse.org/Xtext/
在我的问题中,涉及以下主题: DSL,建议我使用 Irony 和 DLR。 但我不知道它们是否稳定。 Irony 是 Alpha 版本,DLR 虽然稳定,但仍处于 v0.9 版本。 我的目标是在一两周内开始使用 Irony,这样我就能够提供一些反馈。 然而好的一面是——它们都是开源的,所以你可以自己修复错误。
In a question of mine that touched the subject of DSL's, it was suggested to me to use a combination of Irony and DLR. I don't know stable they are however. Irony is an Alpha, and DLR, although stable, is still in v0.9. I'm aiming to start using Irony myself in a week or two, so then I will be able to provide some feedback. On the bright side however - they are both opensource, so you can fix bugs yourself.
如果您计划实现外部 DSL,Spoofax (http://strategoxt.org/Spoofax) 是一个不错的选择语言工作台可以做到这一点。 它是一个基于解析器的文本语言工作台,利用了 SDF 、 Stratego 等多种最先进的技术。 除了 DSL 实现之外,您还可以获得非常丰富的编辑器服务,例如代码完成、大纲视图、智能感知等。
它附带了一个很好的示例 DSL 实现和 Java 代码生成。 它也可以作为开始使用这些工具的起点。
以下教程详细介绍了此语言工作台的用法:http://strategoxt.org/Spoofax/Tour。
希望能帮助到你!
编辑-1:
以下是使用此语言工作台实现的语言示例:http://mobl-lang.org/< /a>.
If you are planning to implement an external DSLs , Spoofax ( http://strategoxt.org/Spoofax )is a nice Language Workbench to do this. It is a parser-based textual Langauge Workbench that leverage several state-of-art technology such as SDF , Stratego. Besides the DSL implemenation , you could get a very rich editor services such as, code completion , outline view , intellisense etc.
It comes with a nice sample DSL implementation and code generation to Java. It might also work as a starting point to get started with the tools.
Following tutorial details about the usage this langauge workbench : http://strategoxt.org/Spoofax/Tour .
Hope it helps!
Edit -1 :
Following is an example of a language implemented using this Langauge Workbench : http://mobl-lang.org/.
Jetbrains 有一个可视化工具来帮助语言开发,忘记了名字,但他们的首页上有它。 我相信它是免费的并且部分开源的。
Jetbrains have a visual tool to aid in language development, forgotten the name but their front page has it on it. I believe its free and partially open sourced.
DMS 软件再工程工具包是一套用于定义任意语言的集成工具,包括 DSL,为定义的语言自动构建解析器、分析器和代码生成器。
The DMS Software Reengineering Toolkit is an integrated set of tools for defining arbitrary langauges, including DSLs, automating the construction of parsers, analyzers, and code generators for the defined languages.