首页> 外文会议>Communicating process architectures 2009 >CSP as a Domain-Specific Language Embedded in Python and Jython
【24h】

CSP as a Domain-Specific Language Embedded in Python and Jython

机译:CSP作为Python和Jython中嵌入的领域特定语言

获取原文
获取原文并翻译 | 示例

摘要

Recently, much discussion has taken place within the Python programming community on how best to support concurrent programming. This paper describes a new Python library, python-csp, which implements synchronous, message-passing concurrency based on Hoare's Communicating Sequential Processes. Although other CSP libraries have been written for Python, python-csp has a number of novel features. The library is implemented both as an object hierarchy and as a domain-specific language, meaning that programmers can compose processes and guards using infix operators, similar to the original CSP syntax. The language design is intended to be idiomatic Python and is therefore quite different to other CSP libraries, python-csp targets the CPython interpreter and has variants which reify CSP process as Python threads and operating system processes. An equivalent library targets the Jython interpreter, where CSP processes are reified as Java threads, jython-csp also has Java wrappers which allow the library to be used from pure Java programs. We describe these aspects of python-csp, together with performance benchmarks and a formal analysis of channel synchronisation and choice, using the model checker SPIN.
机译:最近,Python编程社区内部就如何最好地支持并发编程进行了许多讨论。本文介绍了一个新的Python库python-csp,该库基于Hoare的通信顺序过程实现了同步的消息传递并发。尽管已经为Python编写了其他CSP库,但是python-csp具有许多新颖的功能。该库既可以作为对象层次结构实现,也可以作为特定领域的语言实现,这意味着程序员可以使用infix运算符(类似于原始CSP语法)来编写进程和防护。该语言设计旨在成为惯用的Python,因此与其他CSP库完全不同,python-csp面向CPython解释器,并具有将CSP进程归类为Python线程和操作系统进程的变体。一个等效的库以Jython解释器为目标,在Jython解释器中CSP进程被视为Java线程,jython-csp也具有Java包装器,允许从纯Java程序使用该库。我们使用模型检查器SPIN来描述python-csp的这些方面,以及性能基准以及对频道同步和选择的形式化分析。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号