English 中文(简体)
项目-特殊性 [闭门]
原标题:Are Project-Specific DSLs a Liability? [closed]
Closed. This question is off-topic. It is not currently accepting answers.

我在我对我所听到的许多伟大答复之一的评论中提出了同样的问题。 最初,我问一下中东的宏观问题,这些宏观问题多半引起了利克斯人的非常详细和深思熟虑的反应。 感谢。

Lazy Evaluation vs Macros

我在评论中提出的问题是,具体项目的发展动态实际上是否是一个好的想法。 当然,这完全是主观的——毕竟,当你以真实的表述语言书写时,你在表达性反应器与实际的DSL之间如何划分? 例如,我认为,大多数鲁比主义者称之为DSLs,实际上只是设计精良的文稿,而且更不用说。

注 我不认为许多人会反对使用常规表达方式,或认为这样做是明智的。

但是,尽管如此,我认为我们都能够从APIC和DSL之间抽取一个高潮线。 当然,他们都改写了真正意义上的预报,但不管怎样。

有一个极端,你拥有利什,在那里,似乎通过宏观积极鼓励发展资源。 而另一方面,也有 Java一样的 Java,而瓦 Java则根本不可能。

外籍家庭佣工协会的支持者会认为,他们会增加灵活性、表达力和增强一致性(例如,使用与语言本身数量相同的操作者使用的习俗编号)。

Detractors会说,他们可以产生一种亚语,即除了发展与文化部的作者知道外,没有人会首先杀死有不同方案语言的人,导致没有人能够理解,因为使用APICA的interfacing的途径不同。

我大塔说,我以多种方式赞同双方。 部分 Java 由于缺乏明确性,因此抗体呈阳性才刚刚出现。 尽管如此,我通常可以不读文件就永远做什么——可以说是关于习俗的变迁。 Maybe DSL的支持者认为,应当将always改为AP文件。 我不同意,但我也有分歧。

但现在要看一些大语言。 C#和Java,即 这两者都没有真正地做DSLs,但是他们又大规模地受到欢迎。 之所以如此,正是因为它们是don t。 允许像DSLs这样的东西,允许药剂师chu掉仍然可以理解的代码?

育空区允许药剂师生产不可阻塞的垃圾,这难道是为什么没有像现在这样使用Lisp的,尽管有哪一种电离层楼可以看上去。

最佳回答

当然,有一些赞成DSL及其论点,当然在“图书馆”或“APIC”和“DSL”之间有模糊的界线。 你的这一部分很好地涉及了这个问题,因此,我回避了这些主观观点,只关注它们是否重新承担赔偿责任的问题。

考虑这一项目的一个良好项目是,Racket将语言建设作为其主要特征。 “语言”的任何定义很容易打上一种语言: DSL不是,由口译员或(通常)通过界定新语言的宏观方法组成,也可能是不同语种的教区。 因此,Racket源树有一根语言——其中一些语言具有根本不同的执行特性。 一些实例:

In fact, making up languages is so easy in Racket, that you easily slap up a language even if it s something that fits a very limited use, or even just a single one. For example, we have such "small languages" that are used to create our web pages, decide which files are included in distributed installers, and many many more. See this tutorial for a description of how to come up with a language.

It s true that there s a fine line between a useful DSL that many people can use and one that only one person uses -- but still, the kind of abstractions that you can get when you define a language rather than a library are substantial, to the point that it s a useful concept even when it s a "one-man s language". One hard problem in this are is considering interoperability -- Racket allows each module to be written in it s own language, which brings up issues of what happens when several of these modules are supposed to talk to each other. For example, how does evaluation proceeds when there s interaction of functions in the lazy language and in the default one; or how does the typed make sure that it can interact with the default untyped language and still get the usual benefits of a statically typed language.

问题回答

DSLs在 Java被广泛使用。 只是内部的DSLs。 Lisp与Java不同,有若干种方式来改变语言同学和语种,而不写新的外语。 在贾瓦,大多数DSLs要么是外部的(通常以XML为基础),要么是与加工前者一起执行。

If you write a new programming language, also a domain-specific programming language, you need to:

  • specify it
  • document it
  • test it
  • make it robust
  • make it debuggable
  • make it efficient ... and more

Lisp不是你要做的魔弹。 Lisp给你的东西是将一个或多个DSL直接纳入语言,使你能够重新利用或改变Lisp设施,以落实你新语言的部分内容。

Lisp had in its history a lot of languages implemented on top of it. Many of them were just research languages without too much effort to follow software engineering practices. Some of these languages had more effort put into them - for example because they were part of a product.

If you develop a language for your project, you need to make sure that you follow good software engineering practices and you have the resources to do so.





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签