Are functional programming languages (such as Haskell, F#, Scala, and OCaml) memory safe like Rust? What about their embedded domain-specific languages (DSLs)?
I am not interested in discussion of programming languages that do not support functional programming with the style of Haskell, F#, Scala, and OCaml. E.g., I am not interested in C++, Python, nor Lisp-based programming languages.
I am designing DSLs for domain-specific computing, particularly for machine learning hardware acceleration and domain-specific architectures (DSAs).
Hence, I would like to embedded DSLs within functional programming languages, such as Haskell, F#, Scala, and OCaml. This is because I am exploring alternatives to embedding DSLs in Python, and would like to tap into functional programming to reduce the need for boilerplate code.
If Haskell, F#, Scala, and OCaml are memory safe programming languages, would any DSL embedded in these functional programming languages also be considered memory safe? Or, must I prove this mathematically for each DSL?
Additional contextual information provided to Dr. @Alexis King.
One of the category of DSLs that I am interested in is the set of hardware description/construction languages (HDLs/HCLs), such as Clash (based on Haskell), Chisel HDL (based on Scala), and Hardcaml (based on OCaml). Hence, I was dubious if most DSLs would be memory safe, as if memory safety are relevant for HDLs/HCLs, unless they run programs in the "host" programming language.
E.g., models of computer systems across the hardware/software stack that run Haskell code in Clash models, Scala code in Chisel HDL models, OCaml code in Hardcaml models. The reasoning for this is SystemC models can run C++ and C code, and a complete model across the hardware/software stack.
The other category of DSLs that I am interested in are (quasi-) programming languages like Mojo from Modula, TensorFlow and PyTorch for programmable machine learning hardware accelerators (or domain-specific architectures).
Thank you so much again for your wisdom and answer. I currently cannot upvote this, since I do not have enough reputation points.