Antlr 是 DSL 生成器并且是意向编程的替代品吗?
Charles Simonyi 首先在微软,然后在他自己的公司建立了意向编程领域,他的雄心和创造力让我印象深刻。
http://en.wikipedia.org/wiki/Intentional_programming
在这种软件方法中, 程序员首先构建一个工具箱 特定于给定的问题域 (例如人寿保险)。 领域 专家,在程序员的帮助下,然后 描述该计划的目的 所见即所得的行为 获得(WYSIWYG)般的方式。 一个 自动化系统使用程序 描述和工具箱 生成最终程序。 连续 更改仅在所见即所得中完成 级别。
这似乎是一种非常有用且实用的编程方法,有可能规避当前软件开发方法中的许多问题。
从本质上讲,它似乎促进了非程序员(业务/系统分析师)创建特定于领域的语言,但其阶段比 UML 更接近现实生活中的实现。 他说最终会完成,但目前还没有完成(差不多 15 年后)。
DSL 运行的范围从简单的 5 行规则引擎到复杂的应用程序(如 Ruby on Rails)。 因此,我认为发布他的产品的延迟与他正在处理简化更高级别的抽象这一事实有关,因为他本质上必须允许同时封装所有领域语言。
所以,我的问题是
(a) Antlr 是否可以替代意向编程- 尽管可能是一个不太用户友好的替代方案,它需要程序员的干预而不是允许业务分析师生成 DSL?输出 - 我认为不是)? 它不能做什么? 另外,我不明白为什么它被称为“语言解析器”而不是“语言生成器” - 因为后者描述了它的用途,而前者描述了它如何实现最终结果。
和
>(b) 如果 Antlr 与意向编程不同,那么是否有与意向编程类似的东西?
I am struck by the ambition and creativity of Charles Simonyi's efforts to establish the field of Intentional Programming, first at Microsoft and then with his own company.
What exactly is Intentional Programming
http://en.wikipedia.org/wiki/Intentional_programming
In this approach to software, a
programmer first builds a toolbox
specific to a given problem domain
(such as life insurance). Domain
experts, aided by the programmer, then
describe the program's intended
behavior in a What You See Is What You
Get (WYSIWYG)-like manner. An
automated system uses the program
description and the toolbox to
generate the final program. Successive
changes are only done at the WYSIWYG
level.
It seems to be such a useful and practical approach to programming, potentially circumventing many of the problems with current approaches to software development.
Essentially it seems to facilitate the creation of domain-specific languages by non-programmers (business/systems analysts) but at a stage much closer to real-life implementation than UML could provide. He says it will be completed eventually but that it is not there yet (almost 15 years later).
DSLs run the gamut from simple 5-line rule engines to complex applications like Ruby on Rails. So I imagine the delay in releasing his product has to do with the fact that he is dealing with simplifying a much higher level of abstraction because he has to essentially allow for the encapsulation of all domain languages at once.
So, my question is
(a) whether Antlr could be an alternative to Intentional Programming - although perhaps a less user-friendly alternative which requires the intervention of programmers rather than permitting business analysts to generate the DSL? Could you use Antlr to generate a DSL like Ruby on Rails (assuming it supported Ruby as an output - which I think it does not)? What can it not do? Also, I don't understand why it's called a "language parser" rather than a "language generator" - since the latter describes what it is used for while the former describes how it achieves its end result.
and
(b) if Antlr is different from Intentional Programming, is there anything similar to Intentional Programming?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在回答 b) 部分时,在类似空间中工作的三个系统是:
这些产品中的每一个都有不同的优点和缺点,但它们都属于该类别语言工作台。 Intentional Software 的 Intentional Workbench 可能是迄今为止该类别中最雄心勃勃的产品,但也尚未普遍上市。
MPS 和 xText 是免费的开源产品。 MetaCase是最成熟的,并且是一个商业产品。 他们都有一个陡峭的学习曲线。
In answer to part b), three systems that work in a similar space are:
Each of these products has different strengths and weaknesses, but all of them fall into the category of Language Workbenches. Intentional Software's Intentional Workbench is possibly the most ambitious product in this category to date, but is also not generally available.
MPS and xText are free, open-source products. MetaCase is the most mature, and is a commercial product. All of them have a steep learning curve.
我不是这方面的专家,所以用一大撮盐来对待。 然而...
ANTLR 本身并不是一个 DSL 生成器,尽管它可以用来创建解释 DSL 的代码。 它是一个解析器生成器 - 但 DSL 生成器必须创建 ANTLR 生成解析器的内容。
I am not an expert on this, so treat with a large pinch of salt. However...
ANTLR itself is not a DSL generator, though it can be used to create code that interprets DSLs. It is a parser generator - but the DSL generator would have to create what ANTLR generates a parser from.
ANTLR 只是一个解析器生成器。 在任何重要的 DSL 中,编写解析器所花费的精力都不到实现 DSL 所花费的工作量的 50%。 评估器/规则引擎/代码生成器/时间表或 DSL 执行的任何其他操作可能需要更多工作,并且无法像解析器一样生成。
ANTLR is just a parser generator. In any non-trivial DSL, writing the parser is less than 50% of the effort expended in implementing the DSL. The evaluator/rule engine/code generator/schedule or whatever else your DSL does, probably requires more work and can't be generated like a parser.