# Distributions.jl interop for probprog

**URL:** <https://discourse.julialang.org/t/distributions-jl-interop-for-probprog/26912>\
**Category:** Probabilistic Programming\
**Created:** [July 28, 2019, 4:20pm UTC](https://discourse.julialang.org/t/distributions-jl-interop-for-probprog/26912 "2019-07-28T16:20:59Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [July 29, 2019, 5:56am UTC](https://discourse.julialang.org/t/distributions-jl-interop-for-probprog/26912/13 "2019-07-29T05:56:10Z")

</div>

The first official release of Distributions.jl was in 2013, 6 years ago, before the actual release of Julia 0.3. IMO a lot of its design reflects that, eg

1. it is full of ostensibly performance-enhancing checks and conversions which may not needed anymore, as the compiler got way smarter,

2. the idiomatic Julia style for writing generic code has matured a lot since these days, using traits instead of elaborate type hierarchies, and duck typing where one can get away with it.

This is natural — code ages, and needs to be dusted off occasionally.

A complete, breaking rewrite & refactor by a small team of experienced Julia programmers would probably be the best way to remedy this, but I am not sure how to engineer the consensus necessary for that. It may come to a complete rewrite in a parallel package.

A lot of the checks could probably be removed and the code would just error anyway for incompatible dimensions. All subtypes of `Real`, and vectors with elements `::Real` (not necessarily `Vector{<:Real}`, for well-known reasons, eg `Any[1.0, 1]`) should just work.

But for other types, eg symbolic, you may have to provide your own methods if they cannot trickle through an interface designed for numbers. Eg I am not sure what `ApproxFun.Fun` should do as an argument.

---

_[View the full topic](https://discourse.julialang.org/t/distributions-jl-interop-for-probprog/26912)._
