scispace - formally typeset
Search or ask a question

Showing papers on "Multiple dispatch published in 2014"


Posted Content
TL;DR: The Julia programming language as discussed by the authors combines expertise from the diverse fields of computer science and computational science to create a new approach to numerical computing, which is designed to be easy and fast.
Abstract: Bridging cultures that have often been distant, Julia combines expertise from the diverse fields of computer science and computational science to create a new approach to numerical computing. Julia is designed to be easy and fast. Julia questions notions generally held as "laws of nature" by practitioners of numerical computing: 1. High-level dynamic programs have to be slow. 2. One must prototype in one language and then rewrite in another language for speed or deployment, and 3. There are parts of a system for the programmer, and other parts best left untouched as they are built by the experts. We introduce the Julia programming language and its design --- a dance between specialization and abstraction. Specialization allows for custom treatment. Multiple dispatch, a technique from computer science, picks the right algorithm for the right circumstance. Abstraction, what good computation is really about, recognizes what remains the same after differences are stripped away. Abstractions in mathematics are captured as code through another technique from computer science, generic programming. Julia shows that one can have machine performance without sacrificing human convenience.

1,318 citations


Proceedings ArticleDOI
09 Jun 2014
TL;DR: The Julia language as mentioned in this paper provides a trade-off between flexibility and compile-time analysis by expressing key functions such as array indexing using multi-method signatures, in a way that is both relatively easy to write and amenable to compiler analysis.
Abstract: Arrays are such a rich and fundamental data type that they tend to be built into a language, either in the compiler or in a large low-level library. Defining this functionality at the user level instead provides greater flexibility for application domains not envisioned by the language designer. Only a few languages, such as C++ and Haskell, provide the necessary power to define n-dimensional arrays, but these systems rely on compile-time abstraction, sacrificing some flexibility. In contrast, dynamic languages make it straightforward for the user to define any behavior they might want, but at the possible expense of performance.As part of the Julia language project, we have developed an approach that yields a novel trade-off between flexibility and compile-time analysis. The core abstraction we use is multiple dispatch. We have come to believe that while multiple dispatch has not been especially popular in most kinds of programming, technical computing is its killer application. By expressing key functions such as array indexing using multi-method signatures, a surprising range of behaviors can be obtained, in a way that is both relatively easy to write and amenable to compiler analysis. The compact factoring of concerns provided by these methods makes it easier for user-defined types to behave consistently with types in the standard library.

29 citations


Proceedings ArticleDOI
TL;DR: This work has come to believe that while multiple dispatch has not been especially popular in most kinds of programming, technical computing is its killer application, and has developed an approach that yields a novel trade-off between flexibility and compile-time analysis.
Abstract: Arrays are such a rich and fundamental data type that they tend to be built into a language, either in the compiler or in a large low-level library. Defining this functionality at the user level instead provides greater flexibility for application domains not envisioned by the language designer. Only a few languages, such as C++ and Haskell, provide the necessary power to define $n$-dimensional arrays, but these systems rely on compile-time abstraction, sacrificing some flexibility. In contrast, dynamic languages make it straightforward for the user to define any behavior they might want, but at the possible expense of performance. As part of the Julia language project, we have developed an approach that yields a novel trade-off between flexibility and compile-time analysis. The core abstraction we use is multiple dispatch. We have come to believe that while multiple dispatch has not been especially popular in most kinds of programming, technical computing is its killer application. By expressing key functions such as array indexing using multi-method signatures, a surprising range of behaviors can be obtained, in a way that is both relatively easy to write and amenable to compiler analysis. The compact factoring of concerns provided by these methods makes it easier for user-defined types to behave consistently with types in the standard library.

26 citations


Proceedings ArticleDOI
David Ungar1, Harold Ossher1, Doug Kimelman1
14 Oct 2014
TL;DR: Korz is a new computational model that provides for context-oriented programming by combining implicit arguments and multiple dispatch in a slot-based model that enables the writing of software that supports contextual variation along multiple dimensions, and graceful evolution of that software to support new, unexpected dimensions of variability, without the need for additional mechanism such as layers or aspects.
Abstract: Korz is a new computational model that provides for context-oriented programming by combining implicit arguments and multiple dispatch in a slot-based model. This synthesis enables the writing of software that supports contextual variation along multiple dimensions, and graceful evolution of that software to support new, unexpected dimensions of variability, without the need for additional mechanism such as layers or aspects. With Korz, a system consists of a sea of method and data slots in a multidimensional space. There is no fixed organization of slots into objects - a slot pertains to a number of objects instead of being contained by a single object - and slots can come together according to the implicit context in any given situation, yielding subjective objects. There is no dominant decomposition, and no dimension holds sway over any other. IDE support is essential for managing complexity when working with the slot space and with subjectivity, allowing the task at hand to dictate what subspaces to isolate and what dominance of dimensions to use when presenting nested views to the user. We have implemented a prototype interpreter and IDE, and used it on several examples. This early experience has revealed much that needs to be done, but has also shown considerable promise. It seems that Korz's particular combination of concepts, each well-known from the past, is indeed more powerful than the sum of its parts.

14 citations


Journal ArticleDOI
01 Jul 2014-Dyna
TL;DR: A new approach based on hybrid dynamic and static typing is presented, considering factors such as software maintainability and readability, code size, parameter generalization, and compile-time type checking, and runtime performance and memory consumption.
Abstract: Multiple dispatch allows determining the actual method to be executed, depending on the dynamic types of its arguments. Although some programming languages provide multiple dispatch, most widespread object-oriented languages lack this feature. Therefore, different implementation techniques are commonly used to obtain multiple dispatch in these languages. We evaluate the existing approaches, presenting a new one based on hybrid dynamic and static typing. A qualitative evaluation is presented, considering factors such as software maintainability and readability, code size, parameter generalization, and compile-time type checking. We also perform a quantitative assessment of runtime performance and memory consumption.

12 citations


Proceedings ArticleDOI
28 Jul 2014
TL;DR: This work proposes to specify program execution environments as contextual values in separate units as well as translate such specifications into C++ classes usable in the rest of the program.
Abstract: Context-oriented programming (COP) provides a very intuitive way to handle run-time behavior varying in several dimensions. However, COP usually requires major language extensions and implies a considerable performance loss. To avoid language extensions we propose to specify program execution environments as contextual values in separate units. A tool translates such specifications into C++ classes usable in the rest of the program. Without the need of multiple dispatch, the performance can largely profit from simple caching. Furthermore, it is easy to support debugging and store contextual values in configuration files.

10 citations


Proceedings ArticleDOI
14 Aug 2014
TL;DR: While the implementation (SICL) is not yet in a state where it is able to get exact performance figures, a conservative simulation suggests that this technique for generic dispatch is significantly faster than the one used in SBCL, which uses PCL, and indeed slower than the technique used by most high-performance Common Lisp implementations.
Abstract: We describe a technique for generic dispatch that is adapted to modern computers where accessing memory is potentially quite expensive. Instead of the traditional hashing scheme used by PCL [6], we assign a unique number to each class, and the dispatch consists of comparisons of the number assigned to an instance with a certain number of (usually small) constant integers. While our implementation (SICL) is not yet in a state where we are able to get exact performance figures, a conservative simulation suggests that our technique is significantly faster than the one used in SBCL, which uses PCL, and indeed faster than the technique used by most high-performance Common Lisp implementations. Furthermore, existing work [7] using a similar technique in the context of static languages suggests that perfomance can improve significantly compared to table-based techniques.

1 citations