Urgent.News

the world's headlines, one feed

Editions

Tech

CARGO: Rust's Package Manager (Think npm or pip)

Building a CARGO Project In the last article we learnt how we create a new CARGO project using the cargo new command in the command line. Now it’s time to build that project. We will have a main.rs in the /src folder that was created when we executed the cargo new command. It contains code for basic ‘Hello, World!’ program that we build in the last article. Let us use that as a base for now, we…

Building a Cargo Project

After writing the 'Hello, World!' code in a human-readable format, the next step is to convert it into a machine-understandable code and an executable to run directly. This process is called 'building' the project. To build a Cargo project, run the command 'cargo build' in the newly created folder from the 'cargo new' command. This creates an executable file in the './target/debug' folder with the same name as the project.

The first time running 'cargo build' also generates a 'Cargo.lock' file, which keeps track of the exact versions of dependencies in the project. To execute the program, navigate to the executable in the terminal; for instance, in the example given, the command './target/debug/cargo_intro' will display 'Hello, world!'. However, this method can be cumbersome if repeated frequently.

Cargo simplifies this process by allowing users to run the executable directly with the 'cargo run' command. If any files are modified, 'cargo run' automatically rebuilds and runs the executable, eliminating the need for separate 'cargo build' and execution steps. For example, changing 'Hello, World!' to 'Hello, my name is Aditya.' will prompt a rebuild when running 'cargo run'.

Additionally, the 'cargo check' command allows users to verify if the code compiles without generating an executable.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — it may contain errors, so check the original before relying on it.

Also reported by 1 other outlet

Read the original at dev.to →

More in Tech

Rust SIMD Just Came to the GPU — and It Changes How We Think About Parallel Programming

For decades, GPU programming has meant one of two things: writing CUDA kernels in C++ or wrestling with OpenCL. Both require you to think in a fundamentally different paradigm than CPU programming.

  • Rust SIMD now works natively on GPUs, bridging decades-long programming gap
  • VectorWare's GPU runtime enables SIMD code to run without modifications
  • Same Rust code can run on x86 CPUs, ARM devices, and GPUs with single codebase

Porting a Python PEG parser to Rust in 72 hours, and actually proving it worked

There's a joke that every Rust project starts with someone saying "we should rewrite this in Rust" and ends four weekends later with a half-finished repo and a lot of new opinions about lifetimes.

  • Team ported parsimonious Python PEG parser to Rust in 72 hours for Port Mortem 2026 hackathon
  • Rust parser achieved 23x performance increase over original Python parser
  • Optimized Rust parser used 6.7 MB memory vs. 13 MB, with 0.016 ms peak latency

Tired of JS for simple UI in Ruby?

Meet web_ruby_ui — write reactive client-side SPAs using 100% pure Ruby via WebAssembly. Features state management & VDOM diffing. Give it a try & share feedback!