News for hackers. Stuff that matters.
Re:"No way to prevent this" say users of only language where... by yetihehe on Wednesday May 22, 2024 @05:33AM (#40439069)
I love one comparison to hole hawg[0] (used for unix vs windows&mac), which is usable here. Memory safe languages are like a fancy electric drill from target. They get the job done, but if you want some more serious drilling they die on you instead of doing something dangerous. C is like one of those drills which are comprised of engine and a handle (cheap, changeable piece of steel pipe). They are designed to do one thing: they rotate a drill. When drill blocks, they rotate you. But when you take appropriate precautions, boy do it drills...

This is from my favourite book: In the beginning was the command line.

[0] https://web.stanford.edu/class/cs81n/command.txt , search "HOLE HAWG".

Re:"No way to prevent this" say users of only language where... by superb_dev on Wednesday May 22, 2024 @02:05PM (#40444047)
So what are you able to do with C that you can’t do in Rust? Somethings are more difficult to pull off, but everything possible in C is possible in Rust. Worst comes to worst you can always drop into unsafe Rust

This “sometimes you need a knife" argument just doesn’t make sense. You can have the power and the safety. Stop cutting off your fingers.

Re:"No way to prevent this" say users of only language where... by yetihehe on Thursday May 23, 2024 @02:19AM (#40451104)
Make a program for 8051 MCU. Or a lot of other microcontrollers.

> This “sometimes you need a knife" argument just doesn’t make sense. You can have the power and the safety. Stop cutting off your fingers.

Sometimes you need a scalpel.

I'm not against Rust. I still want to start a project where Rust will be worth learning for me, but I'm currently busy writing erlang and java for big systems and C for microcontrollers. This is of course only my local situation, I don't advocate for those languages (I love erlang though and I'm wishing for advertised easy concurrency in Rust, maybe someday).

Re:"No way to prevent this" say users of only language where... by superb_dev on Thursday May 23, 2024 @03:16AM (#40451513)
Actually I’ve been pleasantly surprised by Rust on the Arduino! Things are certainly much easier with the large community behind it, I probably would’ve chosen C if there wasn’t an existing community.

I don’t think Rust should be used everywhere, but I’m firm that it could be used anywhere that C can (short of an unsupported architecture).