Live data from Hacker News

2016 Rust Commercial User Survey Results

internals.rust-lang.org

21–30 of 131 posts

Re: 2016 Rust Commercial User Survey Results

#21
post #17
post #15

Earlier quoted context omitted.

> - The type system is unusual, and complex. It's hard to do anything without templates. Do you mean the generic types and functions that stop you having to reimplement a whole pile of common patterns and data types yourself? You're welcome to write your own VecInt and VecString and VecMyStruct and VecYourStruct and OptionInt and HashMapIntString, but I'll go out on a limb and say that would be more annoying than 's…

Rust's generics have significant limitations, especially when mixing types, and are cumbersome to use. For example try writing even a basic function accepting two scalars of type T and U and performing arithmetic on them. The way the Rust compiler works it isn't possible without specifying various bounds on the traits (which I appreciate, actually, for explicitness). And even then there are limitations around casting…

> The way the Rust compiler works it isn't possible without specifying various bounds on the traits.

That's a feature! It works the same way in every language other than C++ or D that implements generics.

I much prefer explicitly typed generics to untyped generics as in C++. Not only are the error messages far more comprehensible, but it lets us avoid having to introduce confusing name resolution rules like ADL.

> And there is no specialization, which is a severe limitation.

There is now [1].

[1]: https://github.com/rust-lang/rust/pull/30652

Re: 2016 Rust Commercial User Survey Results

#22
post #3
post #2

Great to see Rust gaining a foothold in commercial areas. While by no means a perfect language, I enjoy it much more than writing C++.

Why do you specifically enjoy it more than C++? As far as I know, the main goal of Rust is to be safer than C++, not more enjoyable to write.

Long time C++ programmer here.

I specifically like the immutable-by-default, borrow, and move semantics. I can write safe code without bloating up my source with 'const &', std::move, '&& ...' and the like.

The safety issue for me is about the least important thing. Touting it as the big reason to use Rust is a distraction from my point of view.

Re: 2016 Rust Commercial User Survey Results

#23
post #17
post #15

Earlier quoted context omitted.

> - The type system is unusual, and complex. It's hard to do anything without templates. Do you mean the generic types and functions that stop you having to reimplement a whole pile of common patterns and data types yourself? You're welcome to write your own VecInt and VecString and VecMyStruct and VecYourStruct and OptionInt and HashMapIntString, but I'll go out on a limb and say that would be more annoying than 's…

Rust's generics have significant limitations, especially when mixing types, and are cumbersome to use. For example try writing even a basic function accepting two scalars of type T and U and performing arithmetic on them. The way the Rust compiler works it isn't possible without specifying various bounds on the traits (which I appreciate, actually, for explicitness). And even then there are limitations around casting…

This isn't wrong, but it seems to be putting the cart before the horse: even with limitations, having generics is still an improvement over not having them, in terms of one's ability to build type-safe abstractions (i.e. Rust would be a far weaker language without them). For instance, one can write a complicated lock-free data structure that works with any type T, doing the effort to optimise the atomic orderings and avoid leaks (etc.), all without forcing dynamic type casts or unnecessary allocations on downstream users.

> The way the Rust compiler works it isn't possible without specifying various bounds on the traits.

This is an explicit choice: C++-style check-at-use-site results in some seriously ridiculous error messages, and there's no boundary between implementation and signature, meaning a change to some small detail (and even syntax, in C++) in the implementation can accidentally cause downstream code to fail to compile. It is definitely annoying some times, but Rust, and most other languages with some sort of templates/generics, thinks the benefits outweigh the cost.

> And there is no specialization, which is a severe limitation.

Indeed, it is a limitation that the team recognises and is working on: https://github.com/rust-lang/rust/issues/31844 (Parts of which are already available in the nightly releases.)

Re: 2016 Rust Commercial User Survey Results

#24
post #20

I’d love to see a survey talking about what bugs get actually solved by using one of these modern languages like Rust or Swift, since i personally never once in my career had a bug that wouldn’t have happened if i used const, let alone any of the many other annoying Rust features. For a “systems programming language”, Rust doesn’t let you do anything i’d expect, like let you specify whether a signed integer is 2s com…

> I’d love to see a survey talking about what bugs get actually solved by using one of these modern languages like Rust or Swift, since i personally never once in my career had a bug that wouldn’t have happened if i used const, let alone any of the many other annoying Rust features.

A quick analysis I did showed that half of the critical security vulnerabilities in Gecko would have been prevented by writing content and layout code in Rust. The other half were mostly JS issues, often having to do with built-in APIs that would also be safe if appropriately written in Rust (or self-hosted).

> For a “systems programming language”, Rust doesn’t let you do anything i’d expect, like let you specify whether a signed integer is 2s compliment, and how it behaves when it wraps.

Well, this definition of a systems programming language excludes C.

> Instead the programmer is at the whim of the compiler writer, same as in C, and its “undefined behaviour” which is a source of real, hard to track bugs.

Nope. Rust defines signed overflow. http://huonw.github.io/blog/2016/04/myths-and-legends-about-...

> Rust doesn’t even have support for modern features like wide registers

What is a "wide register"? Do you mean SIMD? If so, it sure does [1].

> or any features that help you deal with raw memory, it just marks it as “unsafe”.

Sure it does. Rust helps you deal with raw memory by freeing you from the need to deal with raw memory in the vast majority of occasions. For example, in C you have to mess around with char pointers to operate on strings. In Rust you don't.

> There aren’t even any basic meta programming features like struct introspection.

That's what custom derive is for.

[1]: https://huonw.github.io/simd/simd/

Re: 2016 Rust Commercial User Survey Results

#25
post #20

I’d love to see a survey talking about what bugs get actually solved by using one of these modern languages like Rust or Swift, since i personally never once in my career had a bug that wouldn’t have happened if i used const, let alone any of the many other annoying Rust features. For a “systems programming language”, Rust doesn’t let you do anything i’d expect, like let you specify whether a signed integer is 2s com…

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.

Re: 2016 Rust Commercial User Survey Results

#26
post #17

Earlier quoted context omitted.

Rust's generics have significant limitations, especially when mixing types, and are cumbersome to use. For example try writing even a basic function accepting two scalars of type T and U and performing arithmetic on them. The way the Rust compiler works it isn't possible without specifying various bounds on the traits (which I appreciate, actually, for explicitness). And even then there are limitations around casting…

> The way the Rust compiler works it isn't possible without specifying various bounds on the traits. That's a feature! It works the same way in every language other than C++ or D that implements generics. I much prefer explicitly typed generics to untyped generics as in C++. Not only are the error messages far more comprehensible, but it lets us avoid having to introduce confusing name resolution rules like ADL. > An…

Well "the same way" is pretty broad. Generics in C++ are too loose and I edited my comment to reflect that I appreciate the explicitness required. That doesn't mean it couldn't be revisited for usability.

Also, huzzah for specialization. I'll try that out asap. Thanks for the heads up.

Re: 2016 Rust Commercial User Survey Results

#27
post #20

I’d love to see a survey talking about what bugs get actually solved by using one of these modern languages like Rust or Swift, since i personally never once in my career had a bug that wouldn’t have happened if i used const, let alone any of the many other annoying Rust features. For a “systems programming language”, Rust doesn’t let you do anything i’d expect, like let you specify whether a signed integer is 2s com…

> I’d love to see a survey talking about what bugs get actually solved by using one of these modern languages like Rust or Swift, since i personally never once in my career had a bug that wouldn’t have happened if i used const, let alone any of the many other annoying Rust features. A quick analysis I did showed that half of the critical security vulnerabilities in Gecko would have been prevented by writing content a…

Alright, thanks for clearing that up. I missed those in the documentation, since it doesn’t specify any of this directly.

Though, still wide registers aren’t a language feature. I don’t care, nor do i think any other seasoned programmer does, about the language “freeing me from the need to deal with raw memory”. It doesn’t. The types of problems you solve by introducing built-in string types and vectors aren’t problems in the first place. The problem is writing custom allocators for the data you have, and needing some basic bounds checking. Problem is working with structures of arrays instead of arrays of structures, because that can get messy and introduce basic typing bugs. I’d love to see any modern programming language at least make an attempt at making working with raw memory easier.

Re: 2016 Rust Commercial User Survey Results

#28
post #27

Earlier quoted context omitted.

> I’d love to see a survey talking about what bugs get actually solved by using one of these modern languages like Rust or Swift, since i personally never once in my career had a bug that wouldn’t have happened if i used const, let alone any of the many other annoying Rust features. A quick analysis I did showed that half of the critical security vulnerabilities in Gecko would have been prevented by writing content a…

Alright, thanks for clearing that up. I missed those in the documentation, since it doesn’t specify any of this directly. Though, still wide registers aren’t a language feature. I don’t care, nor do i think any other seasoned programmer does, about the language “freeing me from the need to deal with raw memory”. It doesn’t. The types of problems you solve by introducing built-in string types and vectors aren’t proble…

> I don’t care, nor do i think any other seasoned programmer does, about the language “freeing me from the need to deal with raw memory”.

I do. Am I a bad programmer?

> The types of problems you solve by introducing built-in string types and vectors aren’t problems in the first place.

Buffer overflows aren't problems?

Re: 2016 Rust Commercial User Survey Results

#29
post #20

I’d love to see a survey talking about what bugs get actually solved by using one of these modern languages like Rust or Swift, since i personally never once in my career had a bug that wouldn’t have happened if i used const, let alone any of the many other annoying Rust features. For a “systems programming language”, Rust doesn’t let you do anything i’d expect, like let you specify whether a signed integer is 2s com…

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.

Re: 2016 Rust Commercial User Survey Results

#30
post #13

From the article: "...fourteen companies responded to our outreach" That's not a survey, that's a focus group. I'm impressed with Rust. The borrow checker is the biggest advance in memory safety since garbage collection. But there's a lot about Rust that's unnecessarily weird. - The type system is unusual, and complex. It's hard to do anything without templates. - The template libraries are heavily biased towards clo…

Regardless of how valid or important the criticisms you list are (and there are already several replies tearing them apart point-by-point), I want to say I really appreciate hearing about potential pitfalls in new (and yes, hyped) technologies. If it turns out that none of these criticisms are that important, then that just makes Rust stronger. If they are important, the sooner we find out about them the better (and the Rust team can start addressing them).
Post reply on HN