Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
IT NachrichtenHow to improve your Android phone's battery life(29.09.2026 um 01:00 Uhr)
••
AI & KI NachrichtenAI Can Identify, Classify and Secure Data for States(29.09.2026 um 00:48 Uhr)
••
Admin & Dev ToolsGitHub Release: can1357/oh-my-pi v18.4.3 (29.09.2026)(29.09.2026 um 00:59 Uhr)
••
Sichere ProgrammierungCheap bloom for a Canvas 2D game in 8 lines (no WebGL)(29.09.2026 um 00:27 Uhr)
••••
IT NachrichtenHow to improve your Android phone's battery life(29.09.2026 um 01:00 Uhr)
••
AI & KI NachrichtenAI Can Identify, Classify and Secure Data for States(29.09.2026 um 00:48 Uhr)
••
Admin & Dev ToolsGitHub Release: can1357/oh-my-pi v18.4.3 (29.09.2026)(29.09.2026 um 00:59 Uhr)
••
Sichere ProgrammierungCheap bloom for a Canvas 2D game in 8 lines (no WebGL)(29.09.2026 um 00:27 Uhr)
•••
Intelligence View
⚡ tsecurity.de Intelligence

SORRY, RUST & DEVS !

Hi! Today, I will be comparing - for the second time: C and Rust in terms of speed to count till 500M. But before we jump in, let's address something real quick. Sorry, Folks! Last time I talked about C and Rust, I got hit with…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hi!

Today, I will be comparing - for the second time: C and Rust in terms of speed to count till 500M.

But before we jump in, let's address something real quick.





Sorry, Folks!



Last time I talked about C and Rust, I got hit with a wave of comments – some of them pretty passionate, I might add. Seems like I missed the mark with some of the code examples.

Some comments were pretty harsh - here, on Twitter and on YouTube, and somewhat lacked politeness - My advise, if you want to correct someone, do it with humbleness and respect.

In general, your feedback is precious (for the majority of adequate readers / viewers), and I'm here to set things straight.

So, grab a cup of coffee, and let's dive back in.





1- C



C is 50 years old !

It's like that vintage car your grandpa swears by – reliable, sturdy, but not without its quirks.

Take a look to my first test in C:




#include <stdio.h>
#include
<time.h>

int main() {
clock_t start_time = clock();

unsigned long long count = 0;
unsigned long long target = 500000000;

while (count < target) {
count++;
}

time_t end_time = time(NULL);
double elapsed_time = difftime(end_time, start_time);

printf("Counting to %llu took %f seconds.\n", target, elapsed_time);

return 0;
}






The count ended in ... well, take a look to the video :)





Now, I am not a savvy in neither C nor Rust, but I have a pretty solid foundation in C at least, and C's like that buddy who's been with you through thick and thin.

C is your best school friend, but you gotta watch your feet: Manual memory management? Yep, that's on you [and here Rust wins!].

And don't even think about safety nets like preventing data races or dangling reference errors, It's a bit of a rollercoaster, but hey, sometimes you need that freedom.





2- Rust



Now let's me talk a bit about Rust in this contest.

It's like C's younger sibling who's always preaching about safety and memory management :)) But you know what? It's got some cool tricks up its sleeve.

Here's Rust counting to 500M, I have used cargo run --release [which was way faster than with rustc command]




use std::time::{Instant};

fn main() {
let start_time = Instant::now();

let mut count: u64 = 0;
let target: u64 = 500_000_000;

while count < target {
count += 1;
}

let elapsed_time = start_time.elapsed().as_secs_f64();

println!("Counting to {} took {} seconds.", target, elapsed_time);
}






Rust might seem a bit intimidating at first, but it's got some serious game. With features like ownership and lifetimes [tutorials made, but not yet uploaded on the channel], it keeps you from shooting yourself in the foot with null pointers and data races.

Also the result of the Rust speed test was shocking !






Finding Your Groove



So, which one should you go for? Well, it depends on what floats your boat. If you're all about tradition and doing things your way, C might be your jam. But if you're ready to embrace the future and prioritize safety and reliability, Rust might just be your new bestie.



At the end of the day, it's not about which language is better. It's about finding the right tool for the job and being open to new ideas and perspectives. So, whether you're rocking C, Rust, or something entirely different, remember that we're all in this together.






Your Feedback Matters



I wanna hear from you, folks!

What's your take on C and Rust?

Any cool stories or experiences to share?

Drop 'em in the comments below, and let's keep this conversation rolling.



Thanks for reading this article.

Until next time, happy coding! 🚀

Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten SORRY, RUST & DEVS !

Thematisch verwandte Begriffe: SORRY, RUST, DEVS · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97023 | A path traversal vulnerability in Flatpak's handling of the export/bin d…
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag