Better HN
topnewbestaskshowjobs
Log inSign up

staticassertion

13,486 karma · joined Jun 1, 2016 (10y ago) · 4,896 submissions

@insanitybit
Submissions

comment 9y ago · link · parent

Totally. But in the case of rust your vulnerabilities are grep'able. For all of the code you have in a project you only have to search for the unsafe keyword when you want to audit it.

I think that makes a very significant difference.

comment 9y ago · link · parent

People have been assuming this for years.

comment 9y ago · link · parent

I didn't claim that rust would be faster than C (not that it can't be) in that situation. I would expect very similar performance.

I'm not feeling very well unfortunately, not really in the mood to code.

comment 9y ago · link · parent

If you want an AV, MSE has the lowest attack surface impact. It has always been good at implementing security mitigation techniques (whereas other vendors are atrocious here) and it's not very invasive.

For security as a whole, I would suggest a good adblocker, keeping your system up to date, keeping your browser and plugins up to date, and I'd suggest Chrome although maybe that's controversial.

comment 9y ago · link · parent

C/ C++ compilers are also capable of doing this, though rust's iterator syntax tends to make it a pretty natural optimization.

comment 9y ago · link · parent

Because your 'safe' implementation will certainly have a performance cost, and won't be the default. This is why, despite C++ providing std::array, you'll still find buffer overflows in C++ code. C++'s std::array provides the safe 'at' function but you're opting into a performance penalty and it's not the more familiar [] syntax.

Rust arrays/ vectors are safe-by-default. To use the unchecked, unsafe version requires using the 'unsafe' keyword.

let v = vec![0, 1, 2]; unsafe { let x = v.get_unchecked(5); }

This means you can basically grep audit for vulnerabilities, and the above code should be very rare.

comment 9y ago · link · parent

AV = Trashfire. If there were actual repercussions for writing code irresponsibly, even their billions in revenue wouldn't keep them from bankruptcy.

Time and time again we see these ridiculous vulnerabilities but nothing changes. AV insists on massively increasing system attack surface under the guise of security.

comment 9y ago · link · parent

Data races definitely happen in the real world and they are awful to track down, because they only happen n% of the time. All of my least favorite bug-fix experiences have been data races.

comment 9y ago · link · parent

I believe you have three choices with Ada:

1) No manual memory management, everything is static and you have memory safety

2) Garbage collection, you have memory safety

3) Manual memory management, you lose memory safety

Rust provides memory safety in the case of manual memory management.

comment 9y ago · link · parent

> Of course. But OTOH, we shouldn't immidiately discount LLs when writing code, just because the perf isn't optimal.

Most of the time you should, I'd say. Regardless, the decision should be very natural/ trivial for any developer - understanding the performance attributes of the most common data structures is not asking too much of developers.

> They trade speed for other that were, in the language designer's opinion, equally or more important than being fast.

Yes, of course. I am not advocating for highly tuned software - I've stated as much in the last post. There are often tradeoffs.

No one is arguing that a linked list is not more algorithmically efficient at certain things. What I will say is that Vectors still end up faster for most operations, and it shouldn't be hard for a developer to determine when those situations arise.

I am not arguing against LL. I am just saying that it isn't 'lunacy' to understand basic performance characteristics of your software. Your post essentially came off, at least to me, as "people are crazy for wanting ot use a more efficient data structure".

comment 9y ago · link · parent

Right but what's the reason not to pick a data structure with better performance? This should be a really trivial choice with virtually 0 impact on code since a list and array will have nearly if not entirely the same interface.

I would also challenge that 99% of all applications are disk bound but I think it's really besides the point. Really, the argument is that performance doesn't matter in all situations, which is true, but hardly means that we should be against writing fast software.

comment 9y ago · link · parent

Errrr, how is this lunacy? Seems like something everyone should be aware of.

comment 9y ago · link · parent

True, at least to some extent. But I think TensorFlow treated C++ as a first class citizen and not as a tool to improve performance.

You wouldn't use sklearn as a C++ developer, for example. But you could totally use TensorFlow.

comment 9y ago · link · parent

Maybe they're not annoying cool kids but people doing work in a new domain and trying to share the benefits.

I don't think people are saying that their solutions are better just because they're in rust. Maybe somewhere someone is, but the majority of what I see doesn't really sound like that.

comment 9y ago · link · parent

I did a talk at RustConf about Rust for machine learning.

The short story is that rust is awesome for handling data - especially unclean data. But Python, or really anything with a REPL, is still ideal for the exploratory phase using ipython notebook and whatnot.

Rust would be suitable for building machine learning algorithms but it's still immature in that area. For now you could perform the data processing in rust and the ML in Python.

comment 9y ago · link · parent

For the record, I've used rust for machine learning, and it was great. It isn't for "religious beliefs" - both myself, an engineer, and a data scientist on my team, had great results using rust.

Rust is entirely practical and well suited for the task. And yes, people use rust.

comment 9y ago · link · parent

TensorFlow is written in C++ so I'd expect it to impact the deep learning result.

comment 9y ago · link · parent

This is the same in rust. Panics end at thread boundaries. So you'd have some event loop with threads / coroutines doing stuff and if they panic you handle it at the top level.

comment 9y ago · link · parent

You can use map or and_then, you can write a macro, you can use try!, you can use if let, etc. There are lots of ways to handle errors in rust.

comment 9y ago · link · parent

Yep. More of the same. Despite most of the recent improvements to the Linux kernel essentially boiling down to cherry picking Grsec/PaX, no one gives them due credit. And no one's even talking about RAP.

comment 9y ago · link · parent

Awesome. Thanks a lot. I'll have a look at those links with this context.

comment 9y ago · link · parent

Can you talk more about using Pony in a production environment? What are the performance aspects of it? How do you find writing 'non-actor' code - like just doing some string manipulation?

I find the language fascinating but I'm learning Erlang and I don't really want to get started with Pony at the same time. Do you have experience with Erlang?

what made you choose Pony?

Sorry for the bombardment of questions but I don't hear much about Pony. As a rust user, and a burgeoning fan of Erlang, I'm fascinated.

comment 9y ago · link · parent

I believe MS does in fact use a typed heap in IE, but for security reasons (some sort of UAF mitigation iirc).

comment 9y ago · link · parent

Thanks, I've been wondering how Erlang does GC.

comment 9y ago · link · parent

Just learn C or C++. There are way more materials for learning them, and it's certainly different from python. You'll learn things that you would never learn while writing Python, which is the goal.

If you know C++ and Python, you can pick up most mainstream languages. If you learn a more functional language afterwards, you'll basically be able to pick up anything.

comment 9y ago · link · parent

I think it's actually "coke", isn't it?

comment 9y ago · link · parent

Err, I didn't say anything about any browser. I said that performance and battery life are not at odds, they often go hand in hand.

comment 9y ago · link · parent

> Yes, lower power/memory usage equals better battery life at the cost of performance,

This is almost never actually the case. In reality, better performance tends to mean better battery due to improved usage of resources.

1
160161162163164