top | item 39499540

(no title)

JonasWanke | 2 years ago

We're using some unstable features (hence nightly), and I just updated our Rust version on Thursday (https://github.com/candy-lang/candy/pull/948) because the previous one (nightly-2023-07-21) was too old for a dependency. So we're not usually using this recent Rust versions.

Thanks for letting us know about the binary size! We previously enabled debug info in release builds to use flamegraphs, but actually don't need it for most builds. I just disabled it (https://github.com/candy-lang/candy/pull/950), and the binary size went down from 177.4 MB to 14.2 MB for me!

The CLI should work, or at least we're using it regularly when working on Candy. Can you please share your OS and the command and output, maybe in a GitHub issue? We definitely need to improve our documentation and the CLI's error handling. Does running `cargo run --release -- run ./packages/Examples/helloWorld.candy` from the repository root work for you?

The VS Code extension also uses the CLI internally since that exposes a language server, so it basically runs `cargo run --release -- lsp`. But we also have to improve the stability here.

discuss

order

quag|2 years ago

Thanks for the reply! I think I've figured out why I couldn't get any of the examples to run. I was using the debug build rather than the release build. Take sqrt.candy for example, it takes 26 seconds to compile (25s) and execute (1s) with the debug build, and only 1 second to compile and execute on the release build. This is on a Ryzen 7700X, one of the fastest single threaded CPUs.

Similarly, average.candy takes 24s to compile the 10 line program that only depends on Core and averages three numbers (1, 2, and 3). clock.candy takes 39s to compile and then panic. echo.candy takes 23 seconds before prompting and echoing the input. file.candy takes 26s before panicking, and so on. I never waited long enough to see any of the programs work. Thanks for pointing me at needing to use --release.

  cargo run -- run ./packages/Examples/sqrt.candy  26.28s user 0.11s system 100% cpu 26.392 total
  cargo run --release -- run ./packages/Examples/sqrt.candy  0.97s user 0.08s system 100% cpu 1.052 total