4 ms·
> But that's perhaps a performance and logistical advance, not a security advance. Isn't it both, depending where you come from? And isn't decreasing the perfo
by masklinn 12y ago
> But that's perhaps a performance and logistical advance, not a security advance.
Isn't it both, depending where you come from? And isn't decreasing the performance/security tradeoff a security advance when developers in the domain do not want to compromise on performance?
> But developers shouldn't be swapping their Python code for Rust if security is their primary objective.
OTOH developers building up security primitives/building blocks aren't doing so in Python in the first place, and doing so in Python would mean it's not easily accessible for {anyone not using Python}.
- tptacek 12y agoYes! I'm struggling to articulate the sentiment that boils down to "if you're already deploying Python or Scala or Ruby, Rust is unlikely to drastically improve your security, and rewrites are sure to harm security at least somewhat". If you're currently shipping C/C++, Rust seems like a great bet. Don't write C/C++ in 2015.
- masklinn 12y agoYeah Rust isn't safer than an already memory-safe language (though it might be faster, then again it's also quite a bit more work wrt e.g. Go). but > Don't write C/C++ in 2015. That probably isn't going to stop, even ignoring performance ricers the bottom of the stack does need control, does need good performances, and more importantly does need to be usable from just about everywhere. You can't really/easily use a scala library from MRI, or a CPython one from Go (it's already hard enough to use a CPython library from Pypy). If there's a C interface and little to no runtime assumption however you're good to go. Currently that means C or C++ (with a nice extern C ABI/API). If it could be something safer in the future, that would probably be a good idea.
- bad_user 12y ago> You can't really/easily use a scala library from MRI You can easily link Scala with Ruby by running both on the JVM. Assuming you really want MRI, on the client-side that implies running 2 processes with their own runtime at least, instead of just one process. There is a reason for why I've heard of Ruby developers choosing JRuby to deploy Ruby apps, because having only one GC for managing a long-running process is expensive enough, having more than one gets awful fast. On the server-side on the other hand, you have the freedom of deploying your stuff on multiple servers, which is often the case so you can use a micro-services approach - in our current project the front-end is developed in Ruby / Javascript and the backend in Scala, linked through a web service API. The great thing about this, besides using the best tool for the job and so on, is that people can work on them in parallel. IMHO, I think the reusability of C is overstated. I haven't used C libraries in any of the JVM apps I ever developed and this reduced the headaches I've had back in the days when I did stuff with CPython or Ruby MRI. And given a potent runtime, you can make both Python and Ruby run on top of it with reasonable performance (compared to their reference implementations).
- SeanDav 12y agoWow, strong statement! I am not going to weigh on this other to ask for clarification - do you mean not use C/C++ at all, or only in the context of security applications?
- hawkice 12y agoAlmost all applications are "security applications", in the sense they are security sensitive, these days. If I pull data over the internet, my first person shooter now can't allow buffer overruns. Bad Things may happen in almost any environment.
- tptacek 12y agoDon't use C/C++ at all.
- deleted 12y ago[deleted]
- fsloth 12y ago"Don't write C/C++ in 2015" That's quite bold.
- tptacek 12y agoSome people have to write C/C++. Kernel developers, for instance. But most people who write C/C++ in 2015 don't really have to. For every low-level game programmer or RTOS embedded systems use case you'll cite, I'll cite an unforced error that occurs 5x as often, such as "we wrote our custom database engine that only ever runs serverside in C".
- felixgallo 12y agoOn the other hand, Rust is not ready -- either from a stability or library perspective -- in 2015, most likely. What are you recommending the C/C++ programmers go to?
- tptacek 12y agoJava. Python. Golang. Lua.
- plinkplonk 12y ago(Just trying for clarity, not arguing against or opposing your point) In an earlier comment you used as an example of an unforced error "we wrote our custom database engine that only ever runs serverside in C". Are you saying (with this comment) that for such use cases, developers should use Java/Python/Go/Lua (vs C/C++)?
- jerven 12y agoYes, because you remove a whole class of errors that might be exploited. Might be hard, might even be impossible, but they are there waiting to be taken advantage of. Interestingly enough, very high performance java is a bit like rust. Almost all memory safe, except a few (10-100) lines off crazy unsafe stuff. Of course it is possible that your C code has no memory issues and is verified to be safe, but I would not bet any money on it. Also at the moment custom code is the last entry point for a hacker, but once all other things are hardend its the last guaranteed leak in the ship. I also understand where C semantics can lead to faster code than e.g. java today. But I suspect that edge to disappear within the next 3 years. Just like java is going to make heterogeneous compute easy its also going to improve streaming over memory for speed where needed.
- TheDong 12y agoI strongly disagree. I think that switching from Python or Ruby to Rust will generally give a drastic security improvement. The difference between having a complete type system and not is night and day. If you look at bugs in Ruby, it's frequently because of dynamic typing. Having strong and strict typing is a wonderful way to catch logic errors at compile-time, and every logic error is a potential security flaw.