Giter Site home page Giter Site logo

dmz's Introduction

"GC bugs combine two nasty properties: they cannot be studied in isolation and they trigger depending on a complex set of conditions that cannot be inferred by solely looking at the buggy code." - Frédéric Bour CAMLroot

DMZ is a foreign function interface between Rust and OCaml that eliminates the need for packing and unpacking buffers in order to avoid memory corruption. It does so by modeling the OCaml garbage collector in Rust so that the borrow checker ensures values aren't referenced at points when they would have been collected.

Rust functions are provided to allocate OCaml values, e.g. alloc_string, which must be called inside the call! macro in order to register them with the garbage collector. In addition, Rust functions can be wrapped in the printmod! macro to automatically generate corresponding OCaml externals. Code on the OCaml side requires no special stylistic conventions.

To use you need to build allocpair.c and printmod.ml with ocamlopt. Dune stanzas are provided for both in example/src/dune.

This library was originally written by Stephen Dolan. The name has been changed to avoid collision. For more information see his paper and talk at ICFP 2018.

dmz's People

Contributors

sophia-gold avatar stedolan avatar

Stargazers

Tomas Sedlak avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.