#janet #low-level #api-bindings #embedding

sys no-std evil-janet

Low level bindings to the janet language c api

40 stable releases

new 1.37.1 Dec 6, 2024
1.36.0 Sep 21, 2024
1.33.0 Feb 3, 2024
1.32.1 Dec 9, 2023
1.11.0 Jul 19, 2020

#104 in FFI

Download history 4/week @ 2024-08-26 7/week @ 2024-09-09 149/week @ 2024-09-16 80/week @ 2024-09-23 15/week @ 2024-09-30 1/week @ 2024-10-07 6/week @ 2024-10-14 4/week @ 2024-10-28 5/week @ 2024-11-04 23/week @ 2024-11-18 21/week @ 2024-11-25 222/week @ 2024-12-02

266 downloads per month
Used in 3 crates (2 directly)

Custom license

3MB
50K SLoC

C 50K SLoC // 0.1% comments Rust 120 SLoC // 0.1% comments

evil-janet

This is a rust crate providing low level bindings to the janet C API.

Versioning scheme

The package major and minor versions follow the janet releases the bundled headers are compatible with. The patch version may, but does not necessarily match the janet release.

Feature flags

  • link-amalg: The crate will link the compiled Janet amalgamation
  • link-system: Link to the libjanet library from the system (not recommended generally)
  • system: Use Janet header from the system
  • debug-symbols: Compile with max debug symbols

if the feature link-amalg is enabled, the crate will link the compiled janet amalgamation, otherwise this crate is header only, which is useful for building standalone janet modules.

Environment variables

These variables are only used when using the feature link-amalg

This crate uses environment variables to overwrite some Janet definitions.

  • JANET_RECURSION_GUARD=<integer>
  • JANET_MAX_PROTO_DEPTH=<integer>
  • JANET_MAX_MACRO_EXPAND=<integer>
  • JANET_STACK_MAX=<integer>

Safety

This crate makes no attempt memory safety. It is the bare minimum required to use the Janet API from Rust. For a higher level crate you can look for JanetRS.

Dependencies

~0–2.2MB
~46K SLoC