MCPcopy Index your code
hub / github.com/GrayJack/janetrs

github.com/GrayJack/janetrs @v0.8.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.8.0 ↗ · + Follow
878 symbols 1,976 edges 27 files 41 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

JanetRS

Hits-of-Code Build Status Crates.io Docs latest release Docs dev branch MIT license

A crate with high level bindings to Janet C API.

Goals

Provide a safe and ergonomic interface to the Janet C API to create Janet clients and Janet modules/libraries using Rust.

This project still are in it's early stages, so breaking changes may happen, there is no minimal supported Rust version (MSRV) yet.

Cargo Features

  • std: Enable some trait impl for types that only exist on the std and the Error trait
  • unicode: Enable more methods for JanetString and JanetBuffer
  • inline-more: More aggressive inlining
  • amalgation: Link the Janet runtime to the package, enabling to use the client module
  • unicode: Enable some unicode methods for JanetString and JanetBuffer
  • system: Use system header to get Janet functions
  • link-system: Link the Janet runtime to the package from the system, enabling to use the client module
  • nightly: Enable some parts of the crate that uses nightly features, to use this feature you must compile the crate using a nightly rust version

By default, the following features are enabled: std, unicode, amalgation.

Note: If you don't need the Janet runtime (eg. making a Janet Library), you can use disable the default features

janetrs = { version = "0.7.0", default-features = false, features = ["std", "unicode"] }

Environment variables

These variables are only used when the amalgation feature is enabled

It is possible to use 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>

Licensing

This software is licensed under the terms of the MIT Public License.

TODO: Types: Lacking or Incomplete

  • [ ] Marshaling

[ ]: Lacking [I]: Incomplete [X]: Done

Probably there is much more missing, for that you can use the lowlevel module to access the raw C API of Janet

TODO: Lib level

  • Better docs.
  • Marshalling mechanism

Acknowledgments

  • Calvin Rose for creating this amazing language called Janet
  • andrewchambers for janet_ll crate and discuss with us some ideas for the abstractions of this crate

Extension points exported contracts — how you extend this code

DeepEq (Interface)
A trait to express a deep equality. A deep equality is to check equality of the collections by value. That is needed be [11 …
src/types.rs
IsJanetAbstract (Interface)
The trait that encodes the information required to instantiate the implementer as [`JanetAbstract`]. # Safety Implement [7 …
src/types/abstract.rs
JanetExtend (Interface)
Trait that express the ability of a Janet collection to extend it with another collection. [7 implementers]
src/types.rs
JanetArgs (Interface)
Trait that only exist to extend methods over `[Janet]` so it's easier to get [`janet_fn`](crate::janet_fn) args. [2 implementers]
src/types.rs
JanetTypeName (Interface)
Trait defining the name of the type known to Janet
src/types.rs

Core symbols most depended-on inside this repo

as_bytes
called by 64
src/types/buffer.rs
as_bytes
called by 61
src/types/string.rs
len
called by 51
src/types/array.rs
as_ptr
called by 44
src/types/array.rs
unwrap
called by 39
src/types.rs
as_ref
called by 33
src/types/array.rs
is_nil
called by 31
src/types.rs
span
called by 30
janetrs_macros/src/utils.rs

Shape

Method 673
Function 129
Class 60
Enum 11
Interface 5

Languages

Rust100%

Modules by API surface

src/types/array.rs148 symbols
src/types/buffer.rs110 symbols
src/types/table.rs95 symbols
src/types/string.rs86 symbols
src/types.rs69 symbols
src/types/tuple.rs66 symbols
src/types/structs.rs47 symbols
src/types/io.rs39 symbols
src/types/abstract.rs31 symbols
src/types/function.rs24 symbols
src/types/fiber.rs20 symbols
src/env.rs20 symbols

For agents

$ claude mcp add janetrs \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page