From b6c110fe53d9abbda016ad0155a10a391b25d496 Mon Sep 17 00:00:00 2001 From: Tim Fennis Date: Tue, 4 Mar 2025 09:25:19 +0100 Subject: [PATCH 1/4] minor deps --- Cargo.lock | 80 +++++++++++++++++++------------------- Cargo.toml | 28 ++++++------- andy-cpp-macros/Cargo.toml | 6 +-- 3 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 02f61d5..9be255c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "autocfg" @@ -206,9 +206,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.28" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -216,9 +216,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -328,9 +328,9 @@ checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "either" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] name = "endian-type" @@ -345,7 +345,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -449,7 +449,7 @@ checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -509,9 +509,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "linux-raw-sys" @@ -596,7 +596,7 @@ dependencies = [ "self_cell", "serde", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -704,9 +704,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "oorandom" @@ -725,9 +725,9 @@ dependencies = [ [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" [[package]] name = "plotters" @@ -794,18 +794,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -916,7 +916,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] @@ -961,9 +961,9 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -982,18 +982,18 @@ checksum = "c2fdfc24bc566f839a2da4c4295b82db7d25a24253867d5c64355abb5799bdbe" [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", @@ -1002,9 +1002,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -1047,9 +1047,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -1087,11 +1087,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.11", + "thiserror-impl 2.0.12", ] [[package]] @@ -1107,9 +1107,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -1128,9 +1128,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-linebreak" @@ -1267,7 +1267,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.59.0", + "windows-sys 0.52.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 74b9cb8..3f347bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,25 +22,25 @@ lto = true [dependencies] ahash = { version = "0.8.11", optional = true } andy-cpp-macros = { path = "andy-cpp-macros" } -anyhow = "1.0.80" -clap = { version = "4.5.1", features = ["derive"] } -either = "1.11.0" +anyhow = "1.0.97" +clap = { version = "4.5.31", features = ["derive"] } +either = "1.14.0" factorial = "0.4.0" itertools = "0.13.0" -miette = { version = "7.2.0", features = ["fancy"] } -num = "0.4.1" -once_cell = "1.20.2" -ordered-float = "4.2.0" -owo-colors = "4.1.0" +miette = { version = "7.5.0", features = ["fancy"] } +num = "0.4.3" +once_cell = "1.20.3" +ordered-float = "4.6.0" +owo-colors = "4.2.0" rand = "0.9.0" rand_chacha = "0.9.0" -regex = "1.10.4" +regex = "1.11.1" rustyline = { version = "15.0.0", optional = true, features = ["derive"] } -ryu = "1.0.17" -self_cell = "1.0.4" -serde = "1.0.217" -serde_json = { version = "1.0.138", features = ["arbitrary_precision"] } -thiserror = "2.0.3" +ryu = "1.0.20" +self_cell = "1.1.0" +serde = "1.0.218" +serde_json = { version = "1.0.140", features = ["arbitrary_precision"] } +thiserror = "2.0.12" [dev-dependencies] criterion = { version = "0.5.1", features = ["html_reports"] } diff --git a/andy-cpp-macros/Cargo.toml b/andy-cpp-macros/Cargo.toml index b83f713..57e8dae 100644 --- a/andy-cpp-macros/Cargo.toml +++ b/andy-cpp-macros/Cargo.toml @@ -9,7 +9,7 @@ license = "MIT" proc-macro = true [dependencies] -proc-macro2 = "1.0.79" -quote = "1.0.35" -syn = { version = "2.0.55", features = ["full", "extra-traits"] } +proc-macro2 = "1.0.94" +quote = "1.0.39" +syn = { version = "2.0.99", features = ["full", "extra-traits"] } itertools = "0.12.1" From 847a8ad2d426b73004b71f4e30f902524f68cd32 Mon Sep 17 00:00:00 2001 From: Tim Fennis Date: Tue, 4 Mar 2025 09:28:02 +0100 Subject: [PATCH 2/4] Fix cycle count in pi_approx.ndc --- benches/programs/pi_approx.ndc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benches/programs/pi_approx.ndc b/benches/programs/pi_approx.ndc index 610daec..4156979 100644 --- a/benches/programs/pi_approx.ndc +++ b/benches/programs/pi_approx.ndc @@ -11,4 +11,4 @@ fn monte_carlo_pi(num_samples) { return (inside_circle / num_samples) * 4; } -print(monte_carlo_pi(2_500_000).float) +print(monte_carlo_pi(100_000).float) From f7221a93b6bbaf947e91232ca1ee24716b7f7830 Mon Sep 17 00:00:00 2001 From: Tim Fennis Date: Tue, 4 Mar 2025 09:21:47 +0100 Subject: [PATCH 3/4] Small improvements --- andy-cpp-macros/src/lib.rs | 2 ++ benches/benchmark.rs | 10 +++++----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/andy-cpp-macros/src/lib.rs b/andy-cpp-macros/src/lib.rs index 9e7db60..a72e681 100644 --- a/andy-cpp-macros/src/lib.rs +++ b/andy-cpp-macros/src/lib.rs @@ -29,6 +29,8 @@ pub fn export_module(_attr: TokenStream, item: TokenStream) -> TokenStream { let mut registrations = Vec::new(); let mut uses = Vec::new(); + // TODO: if we find something that we don't wish to edit we can just copy it over instead of throwing an erreor + // TODO: if we find a non-public function we could just copy it over as well? for item in items { match item { Item::Fn(f) => { diff --git a/benches/benchmark.rs b/benches/benchmark.rs index 5f40d67..f0e82b7 100644 --- a/benches/benchmark.rs +++ b/benches/benchmark.rs @@ -13,6 +13,7 @@ fn run_string(input: &str) -> Result { interpreter.run_str(black_box(input), false) } +#[allow(unused)] fn math_benches(c: &mut Criterion) { let mut group = c.benchmark_group("math"); group.warm_up_time(Duration::from_secs(2)); @@ -41,9 +42,9 @@ fn math_benches(c: &mut Criterion) { Right, } let mut gen = |operand, operation| match (operand, operation) { - (Operand::Right, "^") => rng.gen_range(2..=9), - (Operand::Right, "/" | "\\" | "%" | "%%") => rng.gen_range(1..=10_000), - _ => rng.gen_range(-10_000..=10_000), + (Operand::Right, "^") => rng.random_range(2..=9), + (Operand::Right, "/" | "\\" | "%" | "%%") => rng.random_range(1..=10_000), + _ => rng.random_range(-10_000..=10_000), }; for typ in types { for (operator, operator_name) in operators { @@ -101,7 +102,6 @@ fn math_benches(c: &mut Criterion) { group.bench_function(format!("{typ} {operator_name}"), |b| { b.iter(|| run_string(&program)) }); - // println!("{program}"); } } } @@ -129,5 +129,5 @@ fn directory_benches(c: &mut Criterion) { } } -criterion_group!(benches, directory_benches, math_benches); +criterion_group!(benches, directory_benches); criterion_main!(benches); From 25a7297bd6137436cf57594aa79f4945941ba589 Mon Sep 17 00:00:00 2001 From: Tim Fennis Date: Tue, 4 Mar 2025 09:38:03 +0100 Subject: [PATCH 4/4] Incompatible dependencies --- Cargo.lock | 29 ++++++++++------------------- Cargo.toml | 4 ++-- andy-cpp-macros/Cargo.toml | 2 +- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9be255c..212e5e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,7 +43,7 @@ dependencies = [ name = "andy-cpp-macros" version = "0.1.0" dependencies = [ - "itertools 0.12.1", + "itertools 0.14.0", "proc-macro2", "quote", "syn", @@ -345,7 +345,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -449,7 +449,7 @@ checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -475,18 +475,9 @@ dependencies = [ [[package]] name = "itertools" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] @@ -582,7 +573,7 @@ dependencies = [ "criterion", "either", "factorial", - "itertools 0.13.0", + "itertools 0.14.0", "miette", "num", "once_cell", @@ -716,9 +707,9 @@ checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" [[package]] name = "ordered-float" -version = "4.6.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +checksum = "e2c1f9f56e534ac6a9b8a4600bdf0f530fb393b5f393e7b4d03489c3cf0c3f01" dependencies = [ "num-traits", ] @@ -916,7 +907,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1267,7 +1258,7 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3f347bf..3ace901 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,11 +26,11 @@ anyhow = "1.0.97" clap = { version = "4.5.31", features = ["derive"] } either = "1.14.0" factorial = "0.4.0" -itertools = "0.13.0" +itertools = "0.14.0" miette = { version = "7.5.0", features = ["fancy"] } num = "0.4.3" once_cell = "1.20.3" -ordered-float = "4.6.0" +ordered-float = "5.0.0" owo-colors = "4.2.0" rand = "0.9.0" rand_chacha = "0.9.0" diff --git a/andy-cpp-macros/Cargo.toml b/andy-cpp-macros/Cargo.toml index 57e8dae..5aa4b08 100644 --- a/andy-cpp-macros/Cargo.toml +++ b/andy-cpp-macros/Cargo.toml @@ -12,4 +12,4 @@ proc-macro = true proc-macro2 = "1.0.94" quote = "1.0.39" syn = { version = "2.0.99", features = ["full", "extra-traits"] } -itertools = "0.12.1" +itertools = "0.14.0"