# Elimination of (unnecessary) runtime dispatch allocations

**URL:** <https://discourse.julialang.org/t/elimination-of-unnecessary-runtime-dispatch-allocations/113475>\
**Category:** Internals & Design\
**Tags:** box, allocations, runtime-dispatch\
**Created:** [April 24, 2024, 8:13pm UTC](https://discourse.julialang.org/t/elimination-of-unnecessary-runtime-dispatch-allocations/113475 "2024-04-24T20:13:32Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![mrufsvold](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mrufsvold/32/31600_2.png) [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Post date:** [May 4, 2024, 10:11pm UTC](https://discourse.julialang.org/t/elimination-of-unnecessary-runtime-dispatch-allocations/113475/10 "2024-05-04T22:11:36Z")

</div>

Check out this conversation

> [@Specifying Function Contract](https://discourse.julialang.org/t/specifying-function-contract/108983):
>
> There is lots of good work around specifying the interface of types, their traits, etc. I was curious if I’m missing conversation around declaring the behavior of a function in terms of its arguments somewhat like the signatures of generic functions in static languages. What I’m thinking about is a syntax something like: @declare function sum(::T)::E where {T, E = eltype(T)} end @implement function sum(x) reduce(+, x) end # expands to: @generated function sum(x::T) where {T} E = elty…

---

_[View the full topic](https://discourse.julialang.org/t/elimination-of-unnecessary-runtime-dispatch-allocations/113475)._
