Giter Club home page Giter Club logo

continuation's Introduction

Continuation

Pure safe Rust implementations of continuation-based control flow

This crate exports two functions, call_with_repeat_continuation and call_with_escape_continuation. The former behaves similarly to C's setjmp/longjmp, and the latter gives access to C++-style exceptions within a local scope.

Why?

Honestly, I wanted to see if this was possible in safe Rust. It turns out, in the presence of std and panic = "unwind", it is, by using catch_unwind and resume_unwind! As per The Rustonomicon, unwinding via the panic mechanism is likely to be wildly inefficient compared to exceptions in languages like C++ or Java. As a result, this crate is not suitable for high-performance use, and is frankly not useful for anything in particular. It's kinda cool, though.

License

This code is released under the MIT license, as it appears in LICENSE.md or at the Open Source Initiative. In my mind, that means I don't care what you do with the code and that I don't have any obligation to support you in so doing. That said, if you do something cool, I'd love to hear about it!

continuation's People

Contributors

gefjon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

chaosstudygroup

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.