有没有面向上下文的编程语言,它们有什么用?
Are there any context-oriented programming language, and what's their use for?
我听到有人在谈论面向上下文的编程,所以我用谷歌搜索了一下它是什么意思,它似乎是一种新的编程范式,但我发现的也都是谈论这个概念的学术论文。
所以我想知道是否有任何语言实现了上下文导向,这有什么用?
COP 是一种支持软件适应执行上下文的编程范例。
它是使用散布在应用程序中的硬编码条件语句来编码依赖于上下文的行为的替代方法。
多年来,已经提出了多种语言的 COP 扩展:
- ContextJ and JCop 对于 Java
- Context Erlang 对于 Erlang
- ContextL Common Lisp(编程语言的第一个 COP 扩展)
- SubjectiveC 对于 Objective C
- Smalltalk 的上下文
- PyContext 对于 Python
- ContextR 对于 Ruby
- ContextJS 用于 Java脚本
可能还有很多其他人。
每种具体的语言设计和实现都伴随着 COP 范式特征的不同变体。有关更多详细信息,请参阅 A Comparison of Context-oriented
编程语言(Malte Appeltauer、Robert Hirschfeld、Michael Haupt、Jens Lincke、Michael Perscheid - 2010)。
另外一个很好的介绍/起点是 Context-oriented Programming (Robert Hirschfeld, Pascal Costanza, Oscar Nierstrasz) or Context-Oriented Programming: A Programming Paradigm for Autonomic Systems(Guido Salvaneschi、Carlo Ghezzi、Matteo Pradella - 2013)。
我听到有人在谈论面向上下文的编程,所以我用谷歌搜索了一下它是什么意思,它似乎是一种新的编程范式,但我发现的也都是谈论这个概念的学术论文。
所以我想知道是否有任何语言实现了上下文导向,这有什么用?
COP 是一种支持软件适应执行上下文的编程范例。
它是使用散布在应用程序中的硬编码条件语句来编码依赖于上下文的行为的替代方法。
多年来,已经提出了多种语言的 COP 扩展:
- ContextJ and JCop 对于 Java
- Context Erlang 对于 Erlang
- ContextL Common Lisp(编程语言的第一个 COP 扩展)
- SubjectiveC 对于 Objective C
- Smalltalk 的上下文
- PyContext 对于 Python
- ContextR 对于 Ruby
- ContextJS 用于 Java脚本
可能还有很多其他人。
每种具体的语言设计和实现都伴随着 COP 范式特征的不同变体。有关更多详细信息,请参阅 A Comparison of Context-oriented 编程语言(Malte Appeltauer、Robert Hirschfeld、Michael Haupt、Jens Lincke、Michael Perscheid - 2010)。
另外一个很好的介绍/起点是 Context-oriented Programming (Robert Hirschfeld, Pascal Costanza, Oscar Nierstrasz) or Context-Oriented Programming: A Programming Paradigm for Autonomic Systems(Guido Salvaneschi、Carlo Ghezzi、Matteo Pradella - 2013)。