8
lorentz
1y

Today in Rust I defined a function that takes Any and returns Any specifically so that parametric types turned into trait objects of this trait can still receive commands without having to know their concrete type.

Bridging static and dynamic typing is one hell of an exercise.

Comments
  • 4
    Duck go quack!
  • 3
    I know that in many cases this can be bypassed by introducing an umbrella trait that does the operations not involving the type parameter and implements the specific trait, but that would cause double indirection in the regular operations exposed by the specific trait which are hot, whereas the "whatever port" is a cold path.
  • 2
  • 7
    @Lensflare I can explain it but it's gonna be a wall of text because every problem I'm working on is a wall of text. I haven't solved anything that could be explained in less than 2 paragraphs in the last two months of working on Orchid. It gets lonely so I drop out-of-context little blurbs on DevRant.
  • 3
    @Lensflare I don't understand either. But it sounds interesting and complicated. So I upvote it.
  • 3
  • 0
    Actually I realized that I can just implement the nightly Demand/Provider system which is way harder to screw up and somewhat faster.
  • 1
Add Comment