fivemoreminix / rsc

A handwritten scientific calculator for interpreting equations.
https://crates.io/crates/rsc
MIT License
37 stars 9 forks source link

Thank you for writing this. #13

Closed jymchng closed 5 months ago

jymchng commented 5 months ago

Hi @fivemoreminix (Luke)

I am going to publish typenum-consts, which consists of 4 procedural macros that converts a literal integer to type-level integers provided by the typenum crate.

Within it, I allow for evaluation of simple mathematical expressions, like so:

use typenum_consts::uconst;
use typenum::{U15, assert_type_eq);

type A = uconst![{
    a = 5;
    b = 10;
    a + b; // a + b = 5 + 10 = 15 => `A` is `U15`
}];
assert_type_eq!(U15, A);

I used your crate rsc as the evaluator. Thank you for building this.

I vendored your crate because you didn't put it on crates.io and I needed your crate to support implementing Num for isize.

Thank you.

fivemoreminix commented 5 months ago

Awesome, thank you for letting me know. I need to do some maintenance on this crate to improve stability and push out the latest version, 3.0.0 which you’re using. Let me know if you’d like to see any other features with issues. 👍

On Mar 29, 2024, at 10:16 AM, Jim Chng @.***> wrote:

Hi @fivemoreminix https://github.com/fivemoreminix (Luke)

I am going to publish typenum-consts https://github.com/jymchng/typenum-consts, which consists of 4 procedural macros that converts a literal integer to type-level integers provided by the typenum https://github.com/paholg/typenum/tree/main/src crate.

Within it, I allow for evaluation of simple mathematical expressions, like so:

use typenum_consts::uconst; use typenum::{U15, assert_type_eq);

type A = uconst![{ a = 5; b = 10; a + b; // a + b = 5 + 10 = 15 => A is U15 }]; assert_type_eq!(U15, A); I used your crate rsc as the evaluator. Thank you for building this.

I vendored your crate because you didn't put it on crates.io and I needed your crate to support implementing Num for isize.

Thank you.

— Reply to this email directly, view it on GitHub https://github.com/fivemoreminix/rsc/issues/13, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIJLS4M4AS7K4J7LZOA5YLY2WATHAVCNFSM6AAAAABFORW7RWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTKNJVG43DGMI. You are receiving this because you were mentioned.

jymchng commented 5 months ago

Awesome, thank you for letting me know. I need to do some maintenance on this crate to improve stability and push out the latest version, 3.0.0 which you’re using. Let me know if you’d like to see any other features with issues. 👍 On Mar 29, 2024, at 10:16 AM, Jim Chng @.***> wrote: Hi @fivemoreminix https://github.com/fivemoreminix (Luke) I am going to publish typenum-consts https://github.com/jymchng/typenum-consts, which consists of 4 procedural macros that converts a literal integer to type-level integers provided by the typenum https://github.com/paholg/typenum/tree/main/src crate. Within it, I allow for evaluation of simple mathematical expressions, like so: use typenum_consts::uconst; use typenum::{U15, assert_type_eq); type A = uconst![{ a = 5; b = 10; a + b; // a + b = 5 + 10 = 15 => A is U15 }]; assert_type_eq!(U15, A); I used your crate rsc as the evaluator. Thank you for building this. I vendored your crate because you didn't put it on crates.io and I needed your crate to support implementing Num for isize. Thank you. — Reply to this email directly, view it on GitHub <#13>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIJLS4M4AS7K4J7LZOA5YLY2WATHAVCNFSM6AAAAABFORW7RWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTKNJVG43DGMI. You are receiving this because you were mentioned.

Thank you for your prompt reply. I am sorry to hear of your need to do some maintenance on the crate. I am looking forward to using it once you have stabilized what you need to stabilize.

With regards to features, there are mainly two:

  1. Would you mind helping to implement your Num trait to isize minimally? It is only implemented for f64, which is awesome, but I need it for isize for purely integer-based evaluation of mathematical expressions.
  2. If you don't mind my imprudence, would you also mind running through your codes with cargo clippy? Because I have a pre-commit hook that runs cargo clippy and it flagged out several suggestions on your codes with respective to lifetime annotations. I disabled all cargo clippy lints on my vendored version of your crate but I am looking forward to not having to disable it.

Thank you for building this once again, it's lovely!

fivemoreminix commented 5 months ago

Absolutely, Jim. I’ll add all of the signed and unsigned integers types and I’m working on implementing the Num trait for an arbitrary sized number from the num crate. Also I said maintenance, but it shouldn’t be any breaking changes. And I will absolutely run cargo clippy, and do some complete code formatting. I’ve learned a bit about software development since working on this project!

Thanks for your suggestions, I greatly appreciate the input.

On Mar 29, 2024, at 10:25 AM, Jim Chng @.***> wrote:

Awesome, thank you for letting me know. I need to do some maintenance on this crate to improve stability and push out the latest version, 3.0.0 which you’re using. Let me know if you’d like to see any other features with issues. 👍 … <x-msg://1/#> On Mar 29, 2024, at 10:16 AM, Jim Chng @.***> wrote: Hi @fivemoreminix https://github.com/fivemoreminix https://github.com/fivemoreminix (Luke) I am going to publish typenum-consts https://github.com/jymchng/typenum-consts, which consists of 4 procedural macros that converts a literal integer to type-level integers provided by the typenum https://github.com/paholg/typenum/tree/main/src crate. Within it, I allow for evaluation of simple mathematical expressions, like so: use typenum_consts::uconst; use typenum::{U15, assert_type_eq); type A = uconst![{ a = 5; b = 10; a + b; // a + b = 5 + 10 = 15 => A is U15 }]; assert_type_eq!(U15, A); I used your crate rsc as the evaluator. Thank you for building this. I vendored your crate because you didn't put it on crates.io and I needed your crate to support implementing Num for isize. Thank you. — Reply to this email directly, view it on GitHub <#13 https://github.com/fivemoreminix/rsc/issues/13>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIJLS4M4AS7K4J7LZOA5YLY2WATHAVCNFSM6AAAAABFORW7RWVHI2DSMVQWIX3LMV43ASLTON2WKOZSGIYTKNJVG43DGMI. You are receiving this because you were mentioned.

Thank you for your prompt reply. I am sorry to hear your need to do some maintenance on the crate. I am definitely looking forward to using it once you have stabilized what you need to stabilize.

With regards to features, there are mainly two:

Would you mind helping to implementing your Num trait to isize minimally? Currently, it is only implemented for f64, which is awesome, but I need it for isize for purely integer-based evaluation of mathematical expressions. If you don't mind my imprudence, would you also mind running through your codes with cargo clippy? Because I have a pre-commit hook that runs cargo clippy and it flagged out several suggestions on your codes with respective to lifetime annotations. I disabled all cargo clippy lints on my vendored version of your crate but I am definitely looking forward not having to disable it. Thank you for building this once again, it's lovely!

— Reply to this email directly, view it on GitHub https://github.com/fivemoreminix/rsc/issues/13#issuecomment-2027382469, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADIJLSZB6CILTXMYEE6WYL3Y2WBVJAVCNFSM6AAAAABFORW7RWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRXGM4DENBWHE. You are receiving this because you were mentioned.

fivemoreminix commented 5 months ago

Added signed integer types with commit d6360c66df17b7f085ed6f3406ec07bfe07043b0 And did cargo clippy and fmt 1369888fc4d371bbf76ac89d591e00a7e80ae848 15c0e0137766c394072a9d6075b72bec7a424866

Let me know if you need anything else added or patched. I'm going to go ahead and push out 3.0.0.