
Ask HN: Is it a good idea to combine Racket and Rust? - jnxx
I am wondering whether it is a good idea to program in Racket, and use extensions in Rust.<p>What I am specially interested in are programs which both use very computing-intensive integer and floating point arithmetic (for example, backtracking algorithms, signal processing, and numerical optimization), and interactive &#x2F; exploratory programming with easy visualization.<p>I am quite interested in using a combination of a Lisp and Rust in the long term for algorithm development. Here is why I think the combination of Racket and Rust might be a good idea:<p>* It seems easy to call into Rust functions from Racket.<p>* Both Racket and Rust favor a functional programming style, while allowing for local mutation of vector data where needed. Currently, I think this is essential to write high-performance numerical codes.<p>* If one accepts the toy programs in the computer language benchmarks game as evidence, Racket seems to allow for very compact and easy-to-read expression of algorithms. For complex numerical stuff, this is very important.<p>* By all accounts, Rust is speed-wise comparable to C. Racket is, according to my impression, usually about 5 - 10 times slower than C.<p>* Racket seems to have a good math and vector library and good support for plotting.<p>* Racket seems excellent for scripting: Quick start-up time and concise notation.<p>* It is possible to pack together everything which is needed to run a program in a single executable. That makes deployment easier.<p>* A gray area for me is how both language&#x27;s concurrency paradigms would interact. Racket seems to rather avoid shared-memory concurrency. I think however that the paradigm used by Rust is easy to understand from the calling function&#x27;s po\
int of view. I guess the match between Racket and Rust is much better than it would be with, for example, SBCL&#x2F;Rust.<p>But my view might be too optimistic. Any experiences and thoughts to share? I&#x27;d love to learn more.
======
gus_massa
Try sending the question to the mailing list, perhaps there is someone that
tried something similar before. (I don't remember a case with Rust, but I'm
sure someone did something similar with C.)

It would be nice to see a blog post of your results with the integration of
Racket+Rust preferably with some examples and benchmarks.

