5 ms·
I'm wondering how this compares to Xtext[1], which is another framework for developing domain specific languages. Xtext feels more approachable to me, but maybe
by fohara 10y ago
I'm wondering how this compares to Xtext[1], which is another framework for developing domain specific languages. Xtext feels more approachable to me, but maybe that's because there appears to be a lot more documentation and tooling.
For example, the docs on Xtext's grammar language[2] seem very intuitive to me, even though I'm not experienced in compilers or language design. I don't have quite the same intuition when looking over the AnyDSL docs[3]. Maybe the Xtext docs are just more goal-oriented, i.e. "Five simple steps to your first language".
[1] https://eclipse.org/Xtext/index.html https://eclipse.org/Xtext/index.html
[2] https://eclipse.org/Xtext/documentation/301_grammarlanguage.html https://eclipse.org/Xtext/documentation/301_grammarlanguage....
[3] https://github.com/AnyDSL/anydsl/wiki/Tutorial https://github.com/AnyDSL/anydsl/wiki/Tutorial
- d--b 10y agoJetBrains' MPS also is in the same field
- deleted 10y ago[deleted]
- kagebe 10y agoXtext and AnyDSL have very different goals. Xtext is mostly about Syntax and IDE-Support, while AnyDSL is about compilation. With Xtext you'll get support for defining the grammar of your language, but you'll write your own compiler for your DSL - the DSL is "deeply-embedded" in the host language Java, that is: represented as a Java datastructure. In AnyDSL, you don't have any support for custom syntax - all your DSLs are basically just "libraries"/types/functions in the host language Impala - a "shallow" embedding. Java examples of shallow embedding are most "fluent interface" libraries, e.g. jOOQ[1]. This has the benefit that you don't need to know about compiler tech to implement your DSL. However, a domain-specific compiler can optimize using domain-specific knowledge and potentially generate faster code. For this reason AnyDSL/Impala provides online partial evaluation with the '@' operator, which aggressively specializes functions and evaluates at compile time. With the right DSL abstractions, this can result in generated code that is as fast as hand-tuned code. For a more complete view of the relation between partial evaluation and DSL embedding, have a look at the GPCE'15 paper[2]. We totally agree that the website and documentation (there is some in the github wikis) is lacking at the moment and we're working on them. However, AnyDSL is still a young research project. [1] http://www.jooq.org/doc/3.9/manual/sql-building/sql-statements/dsl-and-non-dsl/ http://www.jooq.org/doc/3.9/manual/sql-building/sql-statemen... [2] http://compilers.cs.uni-saarland.de/papers/gpce15.pdf http://compilers.cs.uni-saarland.de/papers/gpce15.pdf