Description
For Python, there is a library called pyo3
which can develop Python packages with Rust language.
Haskell has very similar typing system with Rust. And for system programming, Haskell with Monad is not so efficient as Rust. And when a Haskell package has dependency on C library, This Haskell package is difficult to maintain.
Rust is a memory-safe language, compared with C language.
So I would recommend that let Haskell do what it best and leave all the other system interaction, imperative stuff to Rust.
In <hackage.haskell.org> there are many Haskell packages which is inactive and broken but is necessary as dependency.
Measure
The following support of Rust in Haskell toolchain is necessary:
- support from
ghc
: Add support inghc
to invoke Haskell zero-overhead and well typing support. - support from
stack
orcabal
: support a Haskell package with some of its sub-module written in Rust withCargo.toml
. Or support a Haskell package which is entirely written in Rust.
Benefit
- Compared with Haskell, Rust has a larger and more robust ecosystem.
- When for system programming, Haskell’s monad is difficult to understand and inefficient in execution. Rust is best for doing system programming.
- Reproducible build: Haskell cannot ensure reproducible build when it has C library dependencies. But if these dependencies are written in Rust, or Rust-bindings of C library, It can easily ensure reproductive build.