Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Dynamic dispatch
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Go, Rust and Nim implementation==== In [[Go (programming language)|Go]], [[Rust (programming language)|Rust]] and [[Nim (programming language)|Nim]], a more versatile variation of early binding is used. {{anchor|Fat pointer}}Vtable pointers are carried with object references as 'fat pointers' ('interfaces' in Go, or 'trait objects' in Rust<ref name="Klabnik-Nichols_2023"/><ref>{{cite web |title=Trait objects |url=https://doc.rust-lang.org/reference/types/trait-object.html |website=The Rust Reference |access-date=27 April 2023}}</ref>). This decouples the supported interfaces from the underlying data structures. Each compiled library needn't know the full range of interfaces supported in order to correctly use a type, just the specific vtable layout that they require. Code can pass around different interfaces to the same piece of data to different functions. This versatility comes at the expense of extra data with each object reference, which is problematic if many such references are stored persistently. The term ''fat pointer'' simply refers to a [[pointer (computer programming)|pointer]] with additional associated information. The additional information may be a vtable pointer for dynamic dispatch described above, but is more commonly the associated object's size to describe e.g. a ''slice''.{{cn|date=July 2022}} {{See also|Smart pointer}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)