What are the options of distributing a closed-source library in Rust?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/rust

Our great sponsors
  • SonarLint - Clean code begins in your IDE with SonarLint
  • Scout APM - Truly a developer’s best friend
  • talent.io - Download talent.io’s Tech Salary Report
  • abi_stable_crates

    Rust-to-Rust ffi,ffi-safe equivalents of std types,and creating libraries loaded at startup.

    There’s a crate for that: abi_stable

  • rfcs

    RFCs for changes to Rust

    That's the impression I get, which is a shame considering the discussions that happened in 2015 and then again last year (the latter being what I think /u/Koxiaet refers to) ... yet in both cases there was little follow up. I was just hoping I missed something.

  • SonarLint

    Clean code begins in your IDE with SonarLint. Up your coding game and discover issues early. SonarLint is a free plugin that helps you find & fix bugs and security issues from the moment you start writing code. Install from your favorite IDE marketplace today.

  • go-plugin

    Golang plugin system over RPC.

    Alternatively, you can go hashicorp path: https://github.com/hashicorp/go-plugin . I know thats not what you asked, but it is a way to let people use rust and maintain closed source. (each plugin is a process that communicate to parent via some form of RPC)

  • cglue

    Rust ABI safe code generator

    Depending on how big your API surface is (and how trait heavy it is), you may want to look into [shameless_plug] automatically generating it with cglue. That's what we did for memflow. [/shameless_plug] It's goals are not much different from abi_stable (in fact, rather a small subset of it focused on traits), but does create C-compatible code.

  • memflow

    physical memory introspection framework

    Depending on how big your API surface is (and how trait heavy it is), you may want to look into [shameless_plug] automatically generating it with cglue. That's what we did for memflow. [/shameless_plug] It's goals are not much different from abi_stable (in fact, rather a small subset of it focused on traits), but does create C-compatible code.

  • rust

    Empowering everyone to build reliable and efficient software.

    Additionally, this flag does not intend to enshrine the Rust ABI as forever unstable. It is a debugging tool for finding code that does not presently follow the rules. Which may or may not include liballoc.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts