Git Product home page Git Product logo

reflexive's Introduction

reflexive

A magical meta function that evaluate (at compile-time if used inside a macro which is the point of taking a TokenStream input) any Rust expr!

Example

use reflexive::Sandbox;
use quote::quote;

let test = Sandbox::new("calc").unwrap();
let x: u32 = test.eval(quote! { 2 + 2 }).unwrap();
assert!(x == 4);

This library indeed is not what would benefit the most your crate build time, but it was still design in mind with the will of caching sandbox compilation.

Acknowledgments

โš ๏ธ This is still a working experiment, not yet production ready.

This project was part of a work assignment as an IOG contractor.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

reflexive's People

Contributors

yvan-sraka avatar silver-ymz avatar

Watchers

 avatar James Cloos avatar  avatar

reflexive's Issues

Sandbox panic when using in the workspace

When creating a sandbox with dependency in a workspace, the sandbox package thinks it's in a workspace so that cargo add will run failed with

error: current package believes it's in a workspace when it's not:
current:   /Volumes/haha/code/project/incubator-opendal/target/debug/build/antlion-abe6d02b16f05469/out/hs-bindgen/sandbox/Cargo.toml
workspace: /Volumes/haha/code/project/incubator-opendal/Cargo.toml

this may be fixable by adding `target/debug/build/antlion-abe6d02b16f05469/out/hs-bindgen/sandbox` to the `workspace.members` array of the manifest located at: /Volumes/haha/code/project/incubator-opendal/Cargo.toml
Alternatively, to keep it out of the workspace, add the package to the `workspace.exclude` array, or add an empty `[workspace]` table to the package's manifest.

We can always add an empty [workspace] in the sandbox's Cargo.toml to fix it.

If possible, I can help open a pull request about it.

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.