Live data from Hacker News

2016 Rust Commercial User Survey Results

internals.rust-lang.org

51–60 of 131 posts

Re: 2016 Rust Commercial User Survey Results

#51
post #46
post #45

Earlier quoted context omitted.

I went through all the Rust features. It doesn’t eliminate memory safety issues at all.

What's a specific memory safety issue Rust has outside `unsafe` code?

The memory safety issues happen inside of “unsafe” code, thus it doesn’t eliminate memory safety issues.

Re: 2016 Rust Commercial User Survey Results

#52
post #29

Earlier quoted context omitted.

You've never hit a NPE or null pointer? Data races or use after free? Const is nothing like references, not even close. I would suggest you spend a bit more time with the language to better understand exactly what Rust brings to the table.

The number of cases where i have to use a generic memory allocator like malloc in a typical project are extremely rare, so no. I never said that const is like anything, i just used it as an example.

What does malloc have to do with anything? Returning a pointer to the stack is just as likely to break everything if done improperly. Moving or copying a struct that points at itself is also going to break.

In fact, "how to to either of these things" is such a common question for new rust programmers trying to solve their borrow checker complaints that it constitutes pretty good evidence people are doing these things all the time with little understanding of why they are problematic.

And even if you _do_ know better, circumventing the borrow checker is fairly trivial.

Re: 2016 Rust Commercial User Survey Results

#53
post #49
post #42

Earlier quoted context omitted.

> What i’d want is a generic support for preventing buffer overflows, or bad memory access where i need it You have that. For example, if you have contiguous memory, the various forms of the [T] slice type can be used, they don't impose any allocation expectations. (And, once the standard library allows pluggable allocators, you'll likely be able to use Vec directly, for a growable vector type.) If you don't have con…

None of the things you mentioned, other than the slice type, which i don’t see how it would work on raw memory, are a language feature.

As I said, a slice can point to any memory, it doesn't matter where it came from: i.e. your allocator/things using it can expose slices instead of just plain pointers.

Generics and privacy are definitely language features, and they're core to the ease with which one can create abstractions. Rust is a systems language, it tries to give programmers the power to create their own safe abstractions as needed.

Re: 2016 Rust Commercial User Survey Results

#54
post #49
post #42

Earlier quoted context omitted.

> What i’d want is a generic support for preventing buffer overflows, or bad memory access where i need it You have that. For example, if you have contiguous memory, the various forms of the [T] slice type can be used, they don't impose any allocation expectations. (And, once the standard library allows pluggable allocators, you'll likely be able to use Vec directly, for a growable vector type.) If you don't have con…

None of the things you mentioned, other than the slice type, which i don’t see how it would work on raw memory, are a language feature.

Why would it be safer to implement Vec as a "language feature" as opposed to implementing it in the library?

We actually used to implement Vec as a language feature, and it was a lot of work to write things like growth in raw LLVM IR (which is a miserable programming language) instead of just using a real programming language—Rust—to do it.

Re: 2016 Rust Commercial User Survey Results

#55
post #51
post #46

Earlier quoted context omitted.

What's a specific memory safety issue Rust has outside `unsafe` code?

The memory safety issues happen inside of “unsafe” code, thus it doesn’t eliminate memory safety issues.

I don't think this is a useful point, because by the same logic:

- Haskell doesn't eliminate memory safety issues, they happen when using unsafePerformIO (or Foreign.*Ptr, or inside the runtime, your choice),

- Python doesn't eliminate memory safety issues, they happen when using ctypes,

- JavaScript doesn't eliminate memory safety issues, they happen when calling into the C++ code of the browser,

- Java doesn't eliminate memory safety issues, they happen when using JNI.

All languages have some sort of escape hatch that can be used to drop to a lower level, in order to actually interface with the operating system (etc.), Rust is slightly unique in that it makes this escape hatch fairly explicit/prominent at the language level and also provides the power needed do that interfacing/implementation itself (additionally, one gets all the normal benefits of Rust inside `unsafe`, the feature just lets one do more, not change the semantics of existing code).

Re: 2016 Rust Commercial User Survey Results

#56
post #37
post #33

Earlier quoted context omitted.

I'm sorry, I have plenty of gripes about the Rust team touting safety as much as they do but your comment just misses the mark, in my opinion. To begin with, "safety" isn't solved by just using const. It simply isn't feasible to write safe code in C without restricted feature usage to the point of being crippled. It's much easier in C++, but requires an incredible level of focus and "cruft constructs" like ' 'const &…

My point was that i haven’t come across a Rust feature i felt would save me from creating a bug.

Rust isn't a panacea, nor does it claim to be. It doesn't prevent bugs. It prevents memory safety bugs.

Re: 2016 Rust Commercial User Survey Results

#57
post #55
post #51

Earlier quoted context omitted.

The memory safety issues happen inside of “unsafe” code, thus it doesn’t eliminate memory safety issues.

I don't think this is a useful point, because by the same logic: - Haskell doesn't eliminate memory safety issues, they happen when using unsafePerformIO (or Foreign.*Ptr, or inside the runtime, your choice), - Python doesn't eliminate memory safety issues, they happen when using ctypes, - JavaScript doesn't eliminate memory safety issues, they happen when calling into the C++ code of the browser, - Java doesn't elim…

I never said i expect Rust to fix any of these problems, i would however expect it to at least try and introduce helpful constructs, instead of the ultimatum approach that every other language takes where you either program as expected or face the consequences.

Re: 2016 Rust Commercial User Survey Results

#58
post #49

Earlier quoted context omitted.

None of the things you mentioned, other than the slice type, which i don’t see how it would work on raw memory, are a language feature.

Why would it be safer to implement Vec as a "language feature" as opposed to implementing it in the library? We actually used to implement Vec as a language feature, and it was a lot of work to write things like growth in raw LLVM IR (which is a miserable programming language) instead of just using a real programming language—Rust—to do it.

Never said any of this.

Re: 2016 Rust Commercial User Survey Results

#59
> We received a resounding response to continue investing in building strong IDE tools. IDE tools in a commercial setting help teams coordinate their efforts by making it easier to navigate unfamiliar code, on-board new users, and streamline the development process.

I cannot wait. I cannot wait until this happens. Rust will become my main language.

Re: 2016 Rust Commercial User Survey Results

#60
post #53
post #49

Earlier quoted context omitted.

None of the things you mentioned, other than the slice type, which i don’t see how it would work on raw memory, are a language feature.

As I said, a slice can point to any memory, it doesn't matter where it came from: i.e. your allocator/things using it can expose slices instead of just plain pointers. Generics and privacy are definitely language features, and they're core to the ease with which one can create abstractions. Rust is a systems language, it tries to give programmers the power to create their own safe abstractions as needed.

I wasn't talking about that. What i meant was, if i have to implement it myself, that's not a point in favor of Rust. Though the slice does help with rudimentary bounds checking, so that's a start, though i don't see how that differs from a generic accessor method or an overloaded operator.
Post reply on HN