ABSTRACT
Declarative dataflow values are single assignment variables such that all operations needing their values wait automatically until the values are available. Adding threads and declarative dataflow values to a functional language gives declarative concurrency, a model in which concurrency is deterministic and explicit synchronization is not needed. In our experience, this greatly simplifies the writing of concurrent programs (as explained in several chapters of CTM [20]). We complete this model with lazy execution and message-passing concurrency. Both extensions are tightly integrated with the declarative dataflow core. Lazy execution is provided by extending declarative dataflow with a by-need synchronization operation. Message passing is provided by adding streams equipped with a send operation, where a stream is a list with an unbound single-assignment variable. This paper presents the Ozma language, a conservative extension of Scala that supports all these concepts. We have made a complete implementation of Ozma by combining the implementations of Scala and Oz. Evaluation shows that this implementation supports the full semantics of Scala with concurrent programs based on the new concurrency model. In particular, within the functional subset of Scala the new concurrency model fully supports deterministic concurrency.
- Arvind and Thomas R. E.: I-Structures: An efficient data type for functional languages. Technical Report 210, MIT, Laboratory for Computer Science, Cambridge, MA (1980)Google Scholar
- Collet, R.: The Limits of Network Transparency in a Distributed Programming Language. PhD thesis, Université catholique de Louvain (2007)Google Scholar
- Doeraene S.: Ozma: Extending Scala with Oz Concurrency. Master's thesis, Université catholique de Louvain. Full source code available at https://github.com/sjrd/ozma (2011)Google Scholar
- Doeraene, S.: Ozma: Extending Scala with Oz Concurrency. Invited talk, Strange Loop, St Louis, MI, URL: thestrangeloop.com, (Sep. 2012)Google Scholar
- Drejhammar, F., Schulte, C., Haridi, S., Brand, P.: Flow Java: Declarative concurrency for Java. In Proceedings of the Nineteenth International Conference on Logic Programming, Springer LNCS, vol. 2916, pp. 346--360. (2003)Google ScholarCross Ref
- Halstead, R. H. Jr.: MultiLisp: A language for concurrent symbolic computation. In ACM Transactions on Programming Languages and Systems, 7(4), pp. 501--538 (Oct. 1985) Google ScholarDigital Library
- Hewitt, C., Bishop P., Steiger, R.: A universal modular ACTOR formalism for artificial intelligence. In 3rd International Joint Conference on Artificial Intelligence (IJCAI), pp. 235--245 (Aug. 1973) Google ScholarDigital Library
- Imam, S., Sarkar, V.: Habanero-Scala: Async-Finish Programming in Scala.Google Scholar
- Janson, S., Montelius, J., Haridi, S.: Ports for objects in concurrent logic programs. In Research Directions in Concurrent Object-Oriented Programming, pp. 211--231 (1993) Google ScholarDigital Library
- Kahn, G.: The semantics of a simple language for parallel programming. In IFIP Congress, pp. 471--475 (1974)Google Scholar
- Odersky M.: Scala By Example. École Polytechnique Fédérale de Lausanne (2010)Google Scholar
- Odersky M.: The Scala language specification, version 2.9. École Polytechnique Fédérale de Lausanne (2011)Google Scholar
- Mozart Consortium: Mozart Programming System. URL: www.mozart-oz.org (2011)Google Scholar
- Programming Methods Laboratory: The Scala Programming Language. URL: www.scala-lang.org (2011)Google Scholar
- Rossberg, A.: Typed Open Programming: A Higher-Order, Typed Approach to Dynamic Modularity and Distribution. PhD thesis, Universität des Saarlandes (2007)Google Scholar
- Saraswat, V. A.: Concurrent Constraint Programming. MIT Press, Cambridge, MA (1993) Google ScholarDigital Library
- Shapiro, E.: The family of concurrent logic programming languages. In ACM Computing Surveys, 21(3), pp. 413--510 (Sept. 1989) Google ScholarDigital Library
- Smolka, G.: The Oz programming model. In Computer Science Today, Springer LNCS, vol. 1000, pp. 324--343 (1995)Google ScholarCross Ref
- Spiessens, A., Collet, R., Van Roy, R.: Declarative Laziness in a Concurrent Constraint Language. In 2nd International Workshop on Multiparadigm Constraint Programming Languages, part of 9th International Conference on Principles and Practice of Constraint Programming (CP2003) (Sep. 2003)Google Scholar
- Van Roy, P., Haridi, S.: Concepts, Techniques, and Models of Computer Programming. MIT Press, Cambridge MA (2004) Google ScholarDigital Library
- Van Roy, P.: Ozma: Extending Scala with Oz Concurrency. Invited talk, QCon International Software Development Conference, San Francisco, CA, URL: qconsf.com, (Nov. 2011)Google Scholar
Index Terms
- A new concurrency model for Scala based on a declarative dataflow core
Recommendations
Reactive Async: expressive deterministic concurrency
SCALA 2016: Proceedings of the 2016 7th ACM SIGPLAN Symposium on ScalaConcurrent programming is infamous for its difficulty. An important source of difficulty is non-determinism, stemming from unpredictable interleavings of concurrent activities. Futures and promises are widely-used abstractions that help designing ...
Scala macros: let our powers combine!: on how rich syntax and static types work with metaprogramming
SCALA '13: Proceedings of the 4th Workshop on ScalaCompile-time metaprogramming has been proven immensely useful enabling programming techniques such as language virtualization, embedding of external domain-specific languages, self-optimization, and boilerplate generation among many others.
In the ...
Comments