You're welcome. It's not a matter of not being able to, it is a matter of Julia being slower than Fortran. I needed performant real-time Bayesian Blocks histograms, no ifs no buts. Here is the original Julia package: https://github.com/francescoalemanno/BayesHistogram.jl And here is the develop branch of my Julia XWEBQL application that calls Fortran (the fast Fortran stuff hasn't been merged into master yet): https://github.com/jvo203/XWEBQL/tree/develop Inside you will find a "Fortran" folder with the source code "fbh.f90". Then in the "Julia" folder there is a glue Julia code for compiling and linking Fortran automatically at startup: https://github.com/jvo203/XWEBQL/blob/develop/Julia/fortran_toolchain.jl and then https://github.com/jvo203/XWEBQL/blob/develop/Julia/FORTRAN.jl . Finally a Fortran-Julia interface inside xevent.jl. The memory is dynamically allocated in Fortran via C-style pointers, then dereferenced inside Julia, plus released by calling a Fortran subroutine to delete blocks (release the Fortran memory) after use. include("FORTRAN.jl") struct FastBayesHistogram edges::Ptr{Float32} centers::Ptr{Float32} widths::Ptr{Float32} heights::Ptr{Float32} n::Cint end FastBayesHistogram(hist::Ptr{FastBayesHistogram}) = unsafe_load(hist) function FastBayesianBinning(x::Vector{Float32}, n::Integer, resolution::Integer=512) return ccall( fast_bayesian_binning_fptr, Ptr{FastBayesHistogram}, (Ref{Float32}, Ref{Clonglong}, Ref{Cint}), x, Int64(n), Int32(resolution), ) end function ParallelBayesianBinning(x::Vector{Float32}, n::Integer, resolution::Integer=512) return ccall( parallel_bayesian_binning_fptr, Ptr{FastBayesHistogram}, (Ref{Float32}, Ref{Clonglong}, Ref{Cint}), x, Int64(n), Int32(resolution), ) end function FastBayesianBinningEnergyRange( x::Vector{Float32}, n::Integer, emin::Float32, emax::Float32, resolution::Integer=512, ) return ccall( fast_bayesian_binning_energy_range_fptr, Ptr{FastBayesHistogram}, (Ref{Float32}, Ref{Clonglong}, Ref{Cfloat}, Ref{Cfloat}, Ref{Cint}), x, Int64(n), emin, emax, Int32(resolution), ) end function DeleteBlocks(ptr::Ptr{FastBayesHistogram}) return ccall(delete_blocks_fptr, Nothing, (Ref{FastBayesHistogram},), ptr) end