{"id":22588807,"url":"https://github.com/wolframresearch/wstp-rs","last_synced_at":"2025-04-10T21:45:09.448Z","repository":{"id":40250999,"uuid":"444532490","full_name":"WolframResearch/wstp-rs","owner":"WolframResearch","description":"Rust bindings to the Wolfram Symbolic Transport Protocol (WSTP)","archived":false,"fork":false,"pushed_at":"2023-10-07T20:24:18.000Z","size":303,"stargazers_count":22,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-10T21:44:56.499Z","etag":null,"topics":["rust","rust-crate","wolfram-language","wstp"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WolframResearch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-01-04T19:00:49.000Z","updated_at":"2025-04-09T08:12:20.000Z","dependencies_parsed_at":"2022-08-31T02:40:36.920Z","dependency_job_id":null,"html_url":"https://github.com/WolframResearch/wstp-rs","commit_stats":{"total_commits":233,"total_committers":5,"mean_commits":46.6,"dds":0.5278969957081545,"last_synced_commit":"07fb3996dd2040e9e0f5802301dae8b174af4a28"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwstp-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwstp-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwstp-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WolframResearch%2Fwstp-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WolframResearch","download_url":"https://codeload.github.com/WolframResearch/wstp-rs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248305881,"owners_count":21081562,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rust","rust-crate","wolfram-language","wstp"],"created_at":"2024-12-08T08:11:08.947Z","updated_at":"2025-04-10T21:45:09.419Z","avatar_url":"https://github.com/WolframResearch.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wstp\n\n[![Crates.io](https://img.shields.io/crates/v/wstp.svg)](https://crates.io/crates/wstp)\n![License](https://img.shields.io/crates/l/wstp.svg)\n[![Documentation](https://docs.rs/wstp/badge.svg)](https://docs.rs/wstp)\n\n#### [API Documentation](https://docs.rs/CRATE-NAME) | [Changelog](./docs/CHANGELOG.md) | [Contributing](./docs/CONTRIBUTING.md)\n\n\nBindings to the [Wolfram Symbolic Transfer Protocol (WSTP)](https://www.wolfram.com/wstp/).\n\nThis crate provides a set of safe and ergonomic bindings to the WSTP library, used to\ntransfer Wolfram Language expressions between programs.\n\n## Quick Examples\n\n#### Loopback links\n\nWrite an expression to a loopback [`Link`][Link], and then read it back from the same link\nobject:\n\n```rust\nuse wstp::Link;\n\nfn example() -\u003e Result\u003c(), wstp::Error\u003e {\n    let mut link = Link::new_loopback()?;\n\n    // Write the expression {\"a\", \"b\", \"c\"}\n    link.put_function(\"System`List\", 3)?;\n    link.put_str(\"a\")?;\n    link.put_str(\"b\")?;\n    link.put_str(\"c\")?;\n\n    // Read back the expression, concatenating the elements as we go:\n    let mut buffer = String::new();\n\n    for _ in 0 .. link.test_head(\"System`List\")? {\n        buffer.push_str(link.get_string_ref()?.as_str())\n    }\n\n    assert_eq!(buffer, \"abc\");\n\n    Ok(())\n}\n\nexample();\n```\n\n#### Full-duplex links\n\nTransfer the expression `\"hello!\"` from one [`Link`][Link] endpoint to another:\n\n```rust\nuse wstp::Protocol;\n\nlet (mut a, mut b) = wstp::channel(Protocol::SharedMemory).unwrap();\n\na.put_str(\"hello!\").unwrap();\na.flush().unwrap();\n\nassert_eq!(b.get_string().unwrap(), \"hello!\");\n```\n\nSee [`wolfram-library-link`][wolfram-library-link] for\n[examples of using WSTP links][wstp-wll-example] to transfer expressions to and from\nLibraryLink functions.\n\n[wstp-wll-example]: https://github.com/WolframResearch/wolfram-library-link-rs/blob/master/wolfram-library-link/examples/wstp.rs\n\n[Link]: https://docs.rs/wstp/latest/wstp/struct.Link.html\n\n## Building `wstp`\n\nThe `wstp` crate uses [`wolfram-app-discovery`][wolfram-app-discovery] to locate a local\ninstallation of the Wolfram Language that contains a suitable copy of the WSTP SDK. If the\nWSTP SDK cannot be located, `wstp` will fail to build.\n\nIf you have installed the Wolfram Language to a location unknown to `wolfram-app-discovery`,\nyou may specify the installed location manually by setting the `WOLFRAM_APP_DISCOVERY`\nenvironment variable. See [Configuring wolfram-app-discovery][wad-configuration] for details.\n\n[wad-configuration]: https://github.com/WolframResearch/wolfram-app-discovery-rs#configuration\n\n## Related Links\n\n#### Related crates\n\n* [`wolfram-library-link`][wolfram-library-link] — author libraries that can be\n  dynamically loaded by the Wolfram Language\n* [`wolfram-expr`][wolfram-expr] — efficient and ergonomic representation of Wolfram\n  expressions in Rust.\n* [`wolfram-app-discovery`][wolfram-app-discovery] — utility for locating local\n  installations of Wolfram applications and the Wolfram Language.\n\n\n[wolfram-app-discovery]: https://crates.io/crates/wolfram-app-discovery\n[wolfram-library-link]: https://crates.io/crates/wolfram-library-link\n[wolfram-expr]: https://crates.io/crates/wolfram-expr\n\n#### Related documentation\n\n* [WSTP and External Program Communication](https://reference.wolfram.com/language/tutorial/WSTPAndExternalProgramCommunicationOverview.html)\n* [How WSTP Is Used](https://reference.wolfram.com/language/tutorial/HowWSTPIsUsed.html)\n\n### Developer Notes\n\nSee [**Development.md**](./docs/Development.md) for instructions on how to perform common\ndevelopment tasks when contributing to the `wstp` crate.\n\nSee [**Maintenance.md**](./docs/Maintenance.md) for instructions on how to keep `wstp`\nup to date as new versions of the Wolfram Language are released.\n\n## License\n\nLicensed under either of\n\n * Apache License, Version 2.0\n   ([LICENSE-APACHE](LICENSE-APACHE) or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n * MIT license\n   ([LICENSE-MIT](LICENSE-MIT) or \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\nNote: Licensing of the WSTP library linked by the [wstp](https://crates.io/crates/wstp)\ncrate is covered by the terms of the\n[MathLink License Agreement](https://www.wolfram.com/legal/agreements/mathlink.html).\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolframresearch%2Fwstp-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwolframresearch%2Fwstp-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwolframresearch%2Fwstp-rs/lists"}