GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.82k stars 412 forks source link

Fully-featured math expression parser and calculator #2026

Open Keavon opened 20 hours ago

Keavon commented 20 hours ago

This should be built as a library (in our /libraries directory) that uses a parsing framework such as nom or pest that takes a string at runtime and calculates its result, including units and dimensional analysis.

This would make a great solo contribution for somebody interested in developing a robust solution for this problem without needing to learn any of Graphite's code base. It would also make a good university team/solo "capstone" project, which our organization can serve as an "industry sponsor" for.

Here's the spec:

Operators

Constants

Variables

Functions

Number representations:

Units:

Unit list:

Unit metric prefixes:

Implicit multiplication:

API features

abueno19 commented 13 hours ago

I'm interested in this issue. I'm a bit new, but I hope to do my best and make progress in this field.

Keavon commented 10 hours ago

@abueno19 that would be great, thanks for volunteering! We'd ideally like to get a reasonably functional version of this working in the next month or so, with progress towards the full functionality outlined here over the next couple months. My plan was to post this issue on /r/rust to find interested collaborators. Multiple people could probably work on it together, like writing tests, figuring out the correct formal grammar, handling the AST, working with the dimensional analysis, calculating the values, implementing the functions, etc. What's your level of experience with software engineering or computer science in general, and grammar parsing in particular, and would you like to work with others on this?