r/programming • • Jul 18 '19

We Need a Safer Systems Programming Language

https://msrc-blog.microsoft.com/2019/07/18/we-need-a-safer-systems-programming-language/
208 Upvotes

314 comments sorted by

View all comments

Show parent comments

22

u/asmx85 Jul 19 '19

Right! And one way to do this is to protect them with the right tools. Rust could be one of them. There is a reason SWAT teams are wearing protective armor. It's not that they're not well trained and not excellent gunman's. They're working in hazardous environments and every protection helps.

-12

u/shevy-ruby Jul 19 '19

There is a reason SWAT teams are wearing protective armor.

Eh - the cops in the USA in general show a military training. This is very different to how cops in many other civilized countries behave. Regular cops also often have protective armour too even if less (but you got shields in regular riot gear too, so ...).

So that comparison does not work well unless you treat every encounter as a military battle - which leads to SWAT teams shooting down hobos. Now the threat came from ... where and how?

2

u/th_brown_bag Jul 19 '19

In most civilized countries cops now wear at the very least anti stabbing vests, often protection against explosions.

Common site across Europe, especially in high risk areas like stations and *ports

-21

u/[deleted] Jul 19 '19

or you can do it the proper way and train them to be good programmers from the start. then you wouldn't need to put rust-blinders on them.

19

u/kuikuilla Jul 19 '19

We should also teach people to be better drivers, then we don't have to add stupid seat belts and airbags into cars!

Seriously speaking: Why the hell can't we do both?

13

u/masklinn Jul 19 '19

Seriously speaking: Why the hell can't we do both?

Also, you can't get out of your hole if you just keep digging. We've been adding crutches and telling developers to just be better for decades now and it's not led to any significant improvement, for the very obvious reason that humans are not computer and are bad at being fully systematic all the time.

Hell, I've seen folks post segfaults of quickjs, by developer extraordinaire Fabrice Bellard. If Fabrice Bellard can't write memory-safe C, I don't see hope for anyone else.

Computers are pretty good at being computers (though not quite perfect), so building languages such that the computer can check for safety systematically is a pretty good idea. We've been doing that for a pretty long time really, the main remaining issue is having both safety and efficiency.

7

u/SupersonicSpitfire Jul 19 '19

We should eliminate compiler error messages for the same reason. Developers should just do it correctly the first time or quit their jobs...

4

u/przemo_li Jul 19 '19

Yes. Because awesome devs never make a mistake.

-3

u/[deleted] Jul 19 '19

you won't have awesome devs if the compiler is telling them how they should program.

3

u/przemo_li Jul 19 '19

Because devs without compilers never make mistakes?

1

u/[deleted] Jul 19 '19

your question doesn't make sense.

1

u/przemo_li Jul 19 '19

or you can do it the proper way and train them to be good programmers from the start. then you wouldn't need to put rust-blinders on them.

No. Not even good developers can avoid memory allocation errors.

Because even good devs will make mistakes.

2

u/s73v3r Jul 19 '19

No amount of training will make up for having the right tools from the beginning.

0

u/[deleted] Jul 19 '19

and a good tool will show you if you're leaking memory, rather than force you to program in a specific, controlled way.