Crates.io | racket-sys |
lib.rs | racket-sys |
version | 0.3.3 |
source | src |
created_at | 2024-06-22 22:57:03.073566 |
updated_at | 2024-11-23 19:57:14.995904 |
description | Rust bindings to Racket C API |
homepage | |
repository | https://github.com/rn7s2/racket-sys |
max_upload_size | |
id | 1280851 |
size | 146,649 |
Rust bindings to Racket C API
About Racket: https://racket-lang.org/.
Rust
toolchain, Clang
toolchain and Racket
installationVisual Studio
Xcode CommandLine tools
, iconv
, ncurses
sudo apt install racket libncurses-dev
, liblz4-dev
, libzstd-dev
This crate includes a prebuilt Racket runtime for Windows, MacOS, and Linux.
Set environment variables (see below):
RACKET_CS_VERSION
: Only for MacOS. If not set, default to 8.15
.
RACKET_CS_HOME
: Racket installation directory. If not set, default to:
C:\Program Files\Racket
/Applications/Racket v{RACKET_CS_VERSION}
/usr
helloworld examples/helloworld.rs:
cargo run --example helloworld
screenshot on Windows:
factorial examples/factorial.rs and examples/factorial.rkt:
This example demos how to require Racket module from Rust code.
cargo run --example factorial
screenshot on Windows:
Note: set env variable RKT_COLLECTS_DIR
to racket installation/collects
. For example, on MacOS:
RKT_COLLECTS_DIR=/Applications/Racket\ v8.13/collects cargo run --example factorial
https://rn7s2.github.io/racket-sys/racket_sys/
Read https://docs.racket-lang.org/inside/cs-embedding.html for more information on how to embed Racket in your application.