[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

What is /g/'s opinion on the C vs Rust language war? Is

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 14
Thread images: 2

File: memory_safety.jpg (292KB, 500x1356px) Image search: [Google]
memory_safety.jpg
292KB, 500x1356px
What is /g/'s opinion on the C vs Rust language war?

Is the memory safety of Rust worth the nonportability and fatass compiler/binaries?

Is C's speed (outperformed by rust in a few special cases) and portability worth the lack of guaranteed memory safety?

Who wins the holy war?
>>
>>61398294
The consensus is that Rust isn't any safer than C. If you're a responsible programmer, you already write safe code.
It's never the language's fault that you made a mistake.
>>
File: 1491241196920.jpg (32KB, 480x480px) Image search: [Google]
1491241196920.jpg
32KB, 480x480px
>>61398294
C is king, small binary sizes means less cache misses, more compiler optimization, the lingua franca of all our IT infrastructure from kernels to drivers to compilers and browsers and literally everything is C.
Also
>rust SJW fags
>ever associating with those people
>>
>>61398328
Humans are bound to make mistakes that go overlooked unfortunately so one can't assume 100%, no matter how responsible the devs are, that code is safe.

Rust forces memory and type safety which effectively saves a lot of time and money that would otherwise be spent dealing with vulnerabilities.

C, however, isn't exactly foolproof which results in issues when ((humans)) write it.
>>
>>61398294
I like them both and I can't fucking make anything anymore because I'm constantly swerving back and forth between Rust and C.

I'm about to try some horribly botched attempt at combining what I like about both languages into some horrifying C-like language with Rust elements.
>>
>>61398328
Stop posting dumb shit and calling it a consensus.
>>
>>61398381
Programming is the most purely creative and industrious profession. As the adults in the room, programmers need to set an example and take personal responsibility for their skill and power.
>>
>nonportability
It should work anywhere that LLVM works.
>>
They're trying to make "systems programming for everyone" which doesn't work. Doing correct OS/Driver development requires considerable skill in knowing how to write the code and what tricks to use to get the most out of the system. There's no way around it, and using ISA and C is the only way to get the performance required for serious projects. C++ is a good choice but I would prefer C since it has fewer complexities (not to say that it's an easy language to master, but C++ is at least 10 times more complicated than C).
>>
>>61398328
The main issue in C is that it is really fucking easy to create bugs. To check if you are safely accessing a buffer, you need to check that your index is within the bounds of the buffer, the pointer is not NULL and that no overflows occurred in that calculation.
It sounds easy to just check that every time, but in C, people end up creating functions that specify that a parameter should be non-null, the arguments can't cause it to write out of bounds and other very specific restrictions. memcpy for example.

I don't know if there's a solution to this, apart from programming your applications in rust, SPARK or something even more autistic. Ada's runtime checks can stop all integer overflow and buffer overflow attacks, but they reduce performance by about 20%.
>>
>>61398294
>Rust doesn't pass all tests on FreeBSD and OpenBSD
>both of these have known working C compilers
Easy choice for me.
>>
>>61399939
obviously the correct choice is INTERCAL
>>
>>61398779
https://forge.rust-lang.org/platform-support.html
https://news.ycombinator.com/item?id=13889240

Fuck right off, tripfag.
>>
>>61398328
any programmer uses code written by somebody else which can cause exotic bugs, unless you develop for bare metal.

at least with rust you can blame memory mismanagement on someone else.
Thread posts: 14
Thread images: 2


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.