0

Is it possible to write Rust code that is as compact and expressive as Python?

For example, consider a simple web crawler using the spider library in Rust that extracts all links from a website with just a few lines of code: Description: Here’s an example Rust code snippet using the spider crate: use spider::tokio; use spider::website::Website; #[tokio::main] async fn main() { let mut website: Website = Website::new("https://spider.cloud"); website.crawl().await; let links = website.get_links(); for link in links { println!("- {:?}", link.as_ref()); } } With just this code, you can crawl a website and extract all the links on the server. The question is whether Rust can achieve the same level of conciseness and expressiveness as Python for tasks like this.

14th Oct 2025, 2:15 AM
luis ga murillo
luis ga murillo - avatar
0 ответов