Rust <-> Racket Interop?

I have been looking for a language to interop with Rust where:

  1. low-level performance intensive code = Rust

  2. repl-like development = other language

I've come to really like Racket for it's DSL support (, basic support of types (The Typed Racket Guide) and REPL development environment.

Unfortunately, I there seems to be no Rust <-> Racket interop crates ( ).

Is anyone working on this? Are there fundamental issues about Rust runtime vs Racket runtime that makes this impractical ?

1 Like

Don't forget that Rust extern functions are actually extern "C", and are therefore exposing a C-Api.
So, if you want to expose an api to racket, you can use a c-api package for racket.
If you want to expose racket to rust, make the racket api expose a c-api.

1 Like

Looking at it, I don't think there's anything fundamental stopping this from existing. As @OptimisticPeach stated, rust can easily expose C apis. It looks like racket has native functionality for consuming C apis as well: The Racket Foreign Interface.

There's some past work with a much older version of rust at Embedding Rust in Racket. The rust syntax is pre-1.0 and outdated, but I think the example could help.

The only piece missing in all this is a rust crate for easily constructing these bindings! And creating such a crate seems totally practical, it's just that no one has done it yet.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.