Global Information Lookup Global Information

Static dispatch information


In computing, static dispatch is a form of polymorphism fully resolved during compile time. It is a form of method dispatch, which describes how a language or environment will select which implementation of a method or function to use.[1]

Examples are templates in C++, and generic programming in Fortran and other languages, in conjunction with function overloading (including operator overloading). Code is said to be monomorphised, with specific data types deduced and traced through the call graph, in order to instantiate specific versions of generic functions, and select specific function calls based on the supplied definitions.

This contrasts with dynamic dispatch, which is based on runtime information (such as vtable pointers and other forms of run time type information).

Static dispatch is possible because there is a guarantee of there only ever being a single implementation of the method in question. Static dispatch is typically faster than dynamic dispatch which by nature has higher overhead.

  1. ^ Elements of Clojure. Lulu.com. 2019. p. 68. ISBN 9780359360581. Retrieved 17 July 2022.

and 16 Related for: Static dispatch information

Request time (Page generated in 0.8164 seconds.)

Static dispatch

Last Update:

In computing, static dispatch is a form of polymorphism fully resolved during compile time. It is a form of method dispatch, which describes how a language...

Word Count : 240

Dynamic dispatch

Last Update:

binding and offers both dynamic and static dispatch. The default form of dispatch is static. To get dynamic dispatch the programmer must declare a method...

Word Count : 2611

Multiple dispatch

Last Update:

Dynamic dispatch to CollideWith method class ColliderLibrary { public static string CollideWith(Asteroid x, Asteroid y) => "a/a"; public static string...

Word Count : 5881

Virtual inheritance

Last Update:

uniform syntax for both pointers and objects but also allows for static dispatch, so it would arguably be the preferable method. In this case, the double...

Word Count : 1649

Generic function

Last Update:

In statically typed languages (such as C++ and Java), the term generic functions refers to a mechanism for compile-time polymorphism (static dispatch),...

Word Count : 628

Fragile base class

Last Update:

recursion (dynamic dispatch of methods on this), with the suggestion that invoking methods on this default to closed recursion (static dispatch, early binding)...

Word Count : 738

Virtual function

Last Update:

contexts, the situation can be more complex, particularly in relation to static dispatch. If an object of type Wolf is created but pointed to by an Animal pointer...

Word Count : 1653

Type system

Last Update:

provides dynamic typing of 'static types. The choice between static and dynamic typing requires certain trade-offs. Static typing can find type errors...

Word Count : 7252

Class variable

Last Update:

either statically resolved, not via dynamic dispatch, or their memory statically allocated at compile time (once for the entire class, as static variables)...

Word Count : 460

Extension method

Last Update:

with virtual method dispatching. This is why these languages strictly implement extension methods statically and use static dispatching to invoke them. Extension...

Word Count : 2526

Static line

Last Update:

A static line is a fixed cord attached to a large, stable object. It is used to open parachutes automatically for paratroopers and novice parachutists...

Word Count : 615

Name binding

Last Update:

class A { public static $word = "hello"; public static function hello() { print static::$word; } } class B extends A { public static $word = "bye"; }...

Word Count : 713

Double dispatch

Last Update:

the object's method table and so can statically calculate the offset. In a language supporting double dispatch, this is slightly more costly, because...

Word Count : 4333

Programming language

Last Update:

strongly, statically typed, or, even more confusingly, to mean simply statically typed. Thus C has been called both strongly typed and weakly, statically typed...

Word Count : 8516

Visitor pattern

Last Update:

the instance reference as input, and implements the goal through double dispatch. Programming languages with sum types and pattern matching obviate many...

Word Count : 3974

Inversion of control

Last Update:

loop and dispatch of events/messages is handled by the framework or the runtime environment. In web server application frameworks, dispatch is usually...

Word Count : 1474

PDF Search Engine © AllGlobal.net