Code Monkey home page Code Monkey logo

mexe's People

Contributors

mhfan avatar yds12 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mexe's Issues

Do profiling

Use perf or flamegraph or any other profiling methods such as the ones here to find what needs optimisation.

Improve documentation

Although we have a minimal API, it's good to improve the crate-wide docs (//!), and also document the ancillary types (error types, etc).

Integer return types

We are considering all numbers to be f64. Some users might want to calculate everything with integers, so we should add support for that.

Check impact of `smallvec`

Run benchmarks replacing Vec by the one in the smallvec crate, and see if it's worth it to add a dependency.

Add a `check` function

This function would receive an expression and return a boolean indicating whether the expression is valid.

The use case for this is that it should be significantly faster than eval since we don't have to evaluate anything. In particular, we wouldn't need to call parse which is the slowest part of eval.

We can try to use something like the Mode pattern described here to avoid code duplication between eval and check.

Investigate if `eval_binary` is needed

This function does not contribute much to the library, the only justification for its existence is performance, but we should first make some benchmarks on it (vs eval). If the difference is not big enough to justify complicating the API, we should deprecate it.

Use the `glc` crate to generate expressions for tests

Using the glc crate we can generate random expressions based on a context-free grammar. With this we are able to randomly and programatically generate the arithmetic expressions that are accepted by mexe in bulk for more comprehensive testing. Can help with issue #4.

Comprehensive correctness tests

We are just testing a few examples so far, with unit tests. This approach is not enough to guarantee that eval is 99.99% bug-free. Use something more thorough like quickcheck for that. If necessary, we can check the results of eval against other libraries such as meval.

Investigate possibility of parallelism

It might be worth trying to parallelize the parsing of numbers (str::parse). Whenever we find a number token, we can call a thread to do the str::parse.

Before implementing this, write a proof of concept to check if it's worth the benefit.

This would be under a feature, since it would probably require some dependency (tokio, rayon,...?).

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.