Spelling suggestions: "subject:"cynamic dispatch"" "subject:"clynamic dispatch""
1 |
OOMatch: Pattern Matching as Dispatch in JavaRichard, Adam January 2007 (has links)
We present a new language feature, specified as an extension to Java. The feature is a form of dispatch, which includes and subsumes multimethods, but which is not as powerful as general predicate dispatch. It is, however, intended to be more practical and easier to use than the latter. The extension, dubbed OOMatch, allows method parameters to be specified as patterns, which are matched against the arguments to the method call. When matches occur, the method applies; if multiple methods apply, the method with the more specific pattern overrides the others.
The pattern matching is very similar to that found in the "case" constructs of many functional languages, with an important
difference: functional languages normally allow pattern matching over variant types (and other primitives such as tuples), while OOMatch allows pattern matching on Java ob jects. Indeed, the wider goal here is the study of the combination of
functional and ob ject-oriented programming paradigms.
Maintaining encapsulation while allowing pattern matching is of special importance. Class designers should have the control needed to prevent implementation details (such as private variables) from being exposed to clients of the class.
We here present both an informal "tutorial" description of OOMatch, as well as a formal specification of the language, and a proof that the conditions specified guarantee run-time safety.
|
2 |
OOMatch: Pattern Matching as Dispatch in JavaRichard, Adam January 2007 (has links)
We present a new language feature, specified as an extension to Java. The feature is a form of dispatch, which includes and subsumes multimethods, but which is not as powerful as general predicate dispatch. It is, however, intended to be more practical and easier to use than the latter. The extension, dubbed OOMatch, allows method parameters to be specified as patterns, which are matched against the arguments to the method call. When matches occur, the method applies; if multiple methods apply, the method with the more specific pattern overrides the others.
The pattern matching is very similar to that found in the "case" constructs of many functional languages, with an important
difference: functional languages normally allow pattern matching over variant types (and other primitives such as tuples), while OOMatch allows pattern matching on Java ob jects. Indeed, the wider goal here is the study of the combination of
functional and ob ject-oriented programming paradigms.
Maintaining encapsulation while allowing pattern matching is of special importance. Class designers should have the control needed to prevent implementation details (such as private variables) from being exposed to clients of the class.
We here present both an informal "tutorial" description of OOMatch, as well as a formal specification of the language, and a proof that the conditions specified guarantee run-time safety.
|
3 |
Utilizing ATCS Data to Inform a Dynamic Reassignment System for Muni Metro Light Rail Vehicles Departing Embarcadero StationHickey, April M 01 August 2013 (has links) (PDF)
This is a report of a professional project intended to act as an informational tool for the evaluation of a dynamic dispatch system at Embarcadero Station for the San Francisco Municipal Transportation Agency (SFMTA). Systems that operate dispatch algorithms do so in response to on-time performance and reliability. The optimization problem is documented in many transportation contexts including airline networks, bus dispatch, and freight routing. According to the research, optimizing available options and re-routing based on available options can create a more efficient system that would minimize operating costs and improving service reliability for customers.
The methodology presented here uses current headway information to dynamically change dispatch assignment between J, L, and M lines. The reassignment program was applied to randomly selected weekdays in March of 2012. After analysis it was determined that the application has the potential to decrease mean operating headways by up to 3% (or approximately 15 seconds).
|
4 |
Performance-Aware Code Size Optimization of Generic Functions through Automatic Implementation of Dynamic Dispatch / Prestandamedveten kodstorleksoptimering av generiska funktioner genom automatisk tillämpning av dynamic dispatchHärnqvist, Ivar January 2022 (has links)
Monomorphization and dynamic dispatch are two common techniques for implementing polymorphism in statically typed programming languages. Function templates in C++ use the former technique to enable algorithms written as generic functions to be efficiently reused with multiple different data types by producing a separate function instantiation for each invocation that uses a unique permutation of argument types. This avoids the overhead of indirection associated with dynamic dispatch and allows the generated code of each instantiation to be optimized by the compiler for its specific concrete types, which typically yields great improvements in runtime performance over any dynamic approach. The disadvantage of this implementation, compared to the type-erased generics found in many other programming languages, is that careless over-use of templates with many different argument types can lead to an excessive amount of redundant code being generated for the same function. This increase in code size may increase the binary size of the final program and reduce the amount of useful code that can fit into the processor's instruction cache during execution, reducing code locality and thereby potentially reducing performance. Monomorphization can also increase compilation time due to the increase in generated code that needs to be compiled and optimized. This thesis presents a heuristic-based approach to generic programming that allows function templates to be automatically converted to use dynamic dispatch in scenarios where the resulting negative impact on runtime performance is predicted to be low. The thesis project includes the development of a proof of concept plugin for the Clang compiler frontend that can be used to compile existing C++ projects with the conversions applied. The design of a heuristic function for determining whether a given function template should use monomorphization or dynamic dispatch based on statically known metrics is proposed based on the results of an experiment. This heuristic is shown to achieve a small general improvement in program size across a set of open-source C++ projects when they are compiled using the plugin. The key findings from the experiment and from the development of the plugin are summarized with a general strategy for how the approach can be integrated into the design of future programming languages to promote more extensive use of generic programming in performance-sensitive code while avoiding regressions in program size and compilation time.
|
Page generated in 0.04 seconds