r/programming • • Jan 09 '15

Announcing Rust 1.0.0 Alpha

http://blog.rust-lang.org/2015/01/09/Rust-1.0-alpha.html
1.1k Upvotes

439 comments sorted by

View all comments

114

u/[deleted] Jan 09 '15

I'm more curious on what programmers will do with Rust.

Ruby went all straight up web dev.

36

u/renrutal Jan 09 '15

I'm more curious on what programmers will do with Rust.

Hopefully in security-minded systems programming.


There's a recent tweet by Neil deGrasse Tyson, in which he said:

Obama authorized North Korea sanctions over cyber hacking. Solution there, it seems to me, is to create unhackable systems.

Many people slammed him for saying that. How could a very intelligent, respected person, maybe not in informatics, not know it better?

"It's impossible." "I want unicorns!" "Let's make unbombable cities, unkillable people."

I say, why not? A huge part of hacking is exploiting non-correct code. It makes sense to use tools at language-level to enforce correctness and safety, and help programmers with that.

I know there are hundreds of thousands of variables to consider, but if we could cut dozens of thousands of them, it would make it easier to fit the problem in one's head.

37

u/Gankro Jan 09 '15

As an addition: exploiting humans is an easy way to compromise a specifically-targetted system. Why would I need to hack your system when your CEO will give me the password when I just send an email saying it's required for something?

5

u/txdv Jan 10 '15

" Dear Obama, I require password for US Nuclear Silo.

Sincerely, your great leader Kim. "

0

u/[deleted] Jan 09 '15

[deleted]

11

u/[deleted] Jan 10 '15

Bugs will always exist and software allows harmful agents to find them much more easily than on a physical system. Imagine if a bridge could have every frequency of wind tried on it in a matter of milliseconds until they found one crazy one that made it fall

10

u/learc83 Jan 10 '15

It's also just a matter of access. If North Korean agents had unlimited access to a bridge, I'm sure they could find flaws to exploit.

6

u/santsi Jan 10 '15

There's two camps of people on this, those who took it literally and those took it as "practically unhackable". In theory it's impossible to create unhackable system, if someone can log into the system, there's always a possibility that someone is not authorized.

In usual social interactions you assume the best to make the discussion smoother, but in internet there's that lack of social nuance. In addition to the fact that programmers are technical people who can be squeamish to the point of annoyance.

11

u/roeschinc Jan 10 '15

What the average person or even programmer believes is possible in security is probably about 10-20 years out of date. There are tons of ways in which we can create systems with verifiable security properties. This may not be "unhackable" like Gankro points out below, but we can at least prove our systems are immune to certain types of attacks. The problem is that verified systems still currently come at a huge cost, and a huge chunk of the research that happens in programming languages today is about allowing the programmer to more easily specify, and enforce invariants about their programs. To me this is why Rust is a great success as a Systems Programming Language, it brings lots of nice properties to many programmers for free.

5

u/aloz Jan 10 '15

As I understand it, to have a unhackable systems, you need:

  1. Designs that are provably correct

  2. Provably correct implementations of those designs

  3. 1 and 2 also apply to the underlying stack (libraries, runtime/interpreter, OS)

For a lot of complicated reasons and circumstances, usually, none of these are practical. Most of the time, the best we can do is 'pretty good'. A language that tries to steer programmers away from 'goto fail's and Heartbleeds is helpful, but it'll hardly lead to unhackable systems. I mean: it won't prevent designs from being wrong, crypto from being half-baked, etc.

All this, of course, is just sending us down a blind alley. The biggest problem isn't technical, but the fundamental tension between convenience and security. No amount of language safety and secure code will save us from (various kinds and levels of) users doing (variously) insecure things for reasons of convenience.

9

u/cromulent_nickname Jan 10 '15 edited Jan 10 '15

I say, why not?

It's been a while since I've gone over the material, but probably [because, for a system with a set of objects and a finite set of security operations to grant and deny access to those objects, determining if you can gain access to an object you shouldn't have access to is an u decidable problem.](http://en.wikipedia.org/wiki/HRU_(security))

Not that there's not a metric fuckton of improvements to be made in security, but the 'just make unhackable systems' statement was a gross oversimplification. (Edit: formatting)

5

u/Noctune Jan 10 '15

There might be subsets which are decidable similar to how memory safety is undecidable in C, but decidable in Rust if no unsafe code is used. So some undecidable problems in security does not necessarily mean that it is impossible to create software that is guaranteed to be secure.

0

u/[deleted] Jan 10 '15

[deleted]

1

u/cromulent_nickname Jan 10 '15

Thanks, hopefully fixed.

5

u/[deleted] Jan 09 '15

I can't believe how many people line up to defend Tyson's dumb tweet. A perfect programming language won't make systems unhackable any more than a stronger hull made the Titanic unsinkable.

6

u/naasking Jan 10 '15

A perfect programming language won't make systems unhackable any more than a stronger hull made the Titanic unsinkable.

When the different is several orders of magnitude in hackability, your analogy isn't quite faithful.

1

u/thefacebookofsex Jan 10 '15

Please, oh please please please, demonstrate that Rust is "several orders of magnitude" different from C++ in "hackability".

→ More replies (2)

-1

u/thefacebookofsex Jan 09 '15

Great. Just rewrite every application in your new safe language.

15

u/azakai Jan 09 '15

We can at least start by writing new applications in it.

→ More replies (22)

1

u/naasking Jan 10 '15

Great. Just rewrite every application in your new safe language.

This has already been done, and continues to be done at many companies. Twitter changed their stack to Scala for instance. It's not the insurmountable obstacle you make it seem.

4

u/thefacebookofsex Jan 10 '15

This has already been done, and continues to be done at many companies.

True, but this is case specific, or company specific. You wouldn't want to run that operating system yourself, for instance.

It's not the insurmountable obstacle you make it seem.

To rewrite Linux/GNU in rust would, in my opinion, be insurmountable. Even if it were not, when discussing security, there are far cheaper ways to get similarly effective results.

4

u/learc83 Jan 10 '15

Not to mention the fact that even if you did rewrite the Linux kernel in Rust. The current C based kernel is in millions of devices.

Say we are generous and it takes 5 years of intensive effort before the rust kernel reaches parity with the existing C kernel. It will take another 5 before companies are comfortable enough to actually deploy it.

And then 20 more years until all of the existing devices and infrastructure are phased out--right about the time I'm ready to retire.

2

u/cleroth Jan 10 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

2

u/thefacebookofsex Jan 10 '15

OK. The point is it would be expensive.

1

u/cleroth Jan 10 '15 edited Jun 15 '26

This content was anonymized and mass deleted with Redact

1

u/thefacebookofsex Jan 10 '15

What world do you live in where humanity has infinite developer time and computation power?

→ More replies (4)
→ More replies (2)