Live data from Hacker News

Rust can be difficult to learn and frustrating, but it's also very exciting

influxdata.com

161–170 of 282 posts

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#161
post #147

Earlier quoted context omitted.

The failures of Rust are the same failures of C++. Leaky abstractions making it impossible to separate representation details, making the abstraction consume a disproportionate mental load. Given that Rust doesn't actually solve any of the actual problems C++ programmers have, there is no motivation to switch.

Actual problems like: - sending dangling references to thread functions. Lambdas with automatic reference capture creating threads from inside functions that exit are terrible here. - returning a pointer or reference to an invalidated iterator - returning a pointer or reference to the contents of a temporary Yes indeed, C++ programmers never actually have these problems, they are purely imaginary. /sarc

Yeah, I don't think there is a professional C++ developer who has any of these problems. It's called static analysis... welcome to a decade ago. Why on earth would an organisation move their codebase to Rust when they can just run Clang? Which they should be doing anyway.....

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#162
post #122

Earlier quoted context omitted.

Despite Java's growth, C remains the language of choice for operating systems and C++ for web browsers, desktop applications, games and high performance web services. Rust is really only competing with C/C++, not JavaScript or even Java (or Go).

I'm waiting for game engines to pick up Rust.

To be competitive to C++ on the AAA world, Rust engine tooling need to be on pair with Ogre3D, Godot, Cocos2d-X, SpriteKit, Unreal, Unity, CryEngine.

So it would be interesting to see what Seed Studios will come up with.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#163
post #122

Earlier quoted context omitted.

I'm waiting for game engines to pick up Rust.

Not sure why downvoted. A language aimed at replacing systems languages like C++, which happens to be the go-to language for game development, seems like a reasonable choice for a game engine. There's actually a website dedicated to tracking this - http://arewegameyet.com/

Actually it is quite interesting, thanks for sharing.

I think to be on pair with C++, a Rust based engine needs to have some Unreal like tooling.

Which actually seems to be a couple of WIP on that website, so I will now get to track their progress. :)

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#164
post #64

Earlier quoted context omitted.

It's web ready. It's very web ready.

Woah, I’m a big fan of rust, but saying it’s web ready is disingenuous. Rocket isn’t stable, most of the libraries rocket depends on aren’t stable either. Making http requests.. are there any stable http libraries yet? Last I checked Hyper was still on a 0 release with no h2 support. Rust has conquered a lot, but it’s web service/API story is not complete yet. Go is ahead in this respect.

> with no h2 support

IIRC h2 support has been in Hyper for a few months.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#165
post #157

Earlier quoted context omitted.

> Rust is the answer to the question "can we have speed, correctness, and expressiveness in one language?" My biggest gripe is that they left out readability. I like the semantics of Rust, and appreciate the performance and the transparent memory model. I am extremely excited to try Rust on an embedded project. Bur honestly, the syntax is gruesome. Coming from Python, Rust looks like two rabid gerbils had a war dance…

>Bur honestly, the syntax is gruesome. Coming from Python, Rust looks like two rabid gerbils had a war dance on my keyboard. What exactly is terrible about it? The snake_case I got used to, I kind of like having braces, and that's not really a killer argument either, because most languages have them, apart from that I find Rust also much cleaner than Python syntax. I'm really not sure what you mean. Is it the lifetim…

As someone with a C++ background who loves Rust and wants it to succeed: Code where the lifetime syntax is used much can look really horrible and confusing, and to people new to Rust it might feel like it's for no reason.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#166

I have been learning Rust on and off this year. I have been writing mostly GO for the past few years, but am moving to coding almost primarily in Rust for any new project, and porting over some older ones. Microservices, Data Layer, etc... Honestly, while not perfect, its one of the most beautiful languages I have ever come across. Plus, I have not enjoyed coding in a language this much in a while.

How does your team (E.g., the people on the hook for reviewing/supporting/contributing to your project) feel about the change? This is a big difference when moving from Go. A language that nobody calls beautiful, but is very easy for a team to contribute to and support (relative to other languages).

Like I said, we are using it for new code bases, and not moving all of our existing Go Code, thats doing fine. I agree that GO is very easy, I can get most any dev up and running and comfortable on Go in about a week. Honestly though, I can get a decent dev going on Rust in a week. Even with Go, if I was teaching a NodeJS dev, I would get them going on everything but goroutines & channels, and then ease them into it. With Rust, I feel to a Go dev, the syntax isnt too foreign. Plus, focus on understanding ownership & borrowing with real examples relevant to the team, then have them focus on core language features, and then branch out, how you would do with any language. We see a noticeable uptick in performance, and Rust has been well received. Yes Go's ecosystem now is well established, but when trying to do Location intelligence software back in 2014/2015 with Go was a pain from memory. I am not bashing GO, been a gopher for a while, but I do love Rust, and IMHO is not too complex. It just makes sense.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#167
post #62

Earlier quoted context omitted.

I don't think that's fair. I'm not entirely sure what beautiful means for a programming language, but I've seen many examples of Go programs which exhibited a beautiful simplicity. This project for example: https://github.com/inconshreveable/slt .

I didn’t mean to knock Go. It’s just that when I ask people what they love about it, nobody usually expresses a “feeling” they have when they use it.

Yes I agree. Beauty is highly subjective when it comes to programming languages. Its definitely an expression of a feeling from use and relative successes/failures.

I know people I highly respect that call C# with Linq & its lambda implementation very beautiful, and I can see why, but I have not a strong opinion one way or another on it.

I had a lot fun when initially learning Rust, and the way I have phased it in to the projects (work & home) that I have been doing has led to successes, which definitely increases my bias towards the fact rust is awesome =).

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#168
post #120
post #98

Earlier quoted context omitted.

A lot of (but not all) complexity is solved in C/Python/Java by throwing a data structure at the problem. But is it a fair statement to say that not all data structures will work in Rust? Or is it better to say that some data structures work better in Rust than others?

Writing certain data structures in safe Rust can be hard, but not impossible. I’m not aware of any data structures that simply cannot be written in Rust.

Of course, since anything that can be written in C can be written in unsafe Rust.

Though, reading the post above yours, I was thinking more about the use of data structures than the implementation of them. In C++, when faced by the need to efficiently iterate through a data structure in different, incompatible orders, the tool of choice is often just to make intrusive linked lists with multiple next pointers per element. I think I've even once implemented something that was a priority queue (heap), two different lists and a tree at a same time.

While doing that in Rust is by no means impossible, it seems to me that the use of such a structure would be much more clumsy in Rust, to the point where I would try hard to solve the problem in some different way.

The languages are all turing-compatible anyway, so it's not about what can be done, it's about what approaches does the language make easy and promote. Overall I really like the kind of code idiomatic Rust tends to end up like.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#169

Earlier quoted context omitted.

Python is pretty to look at, but I hate working in white space sensitive languages. If I have to have another argument about tabs vs. spaces I am going to toss my monitor out the frickin’ window. Also, it makes autoindent in Emacs worse.

Well, tabs versus spaces is not a Python thing, that will bite you in any language eventually. Blame the VT-100 terminal. Here is the thing about indentation versus curly-braces-and-semi-colons: It boggles me that people find it acceptable to use one mechanism to communicate block structure to the compiler, and a completely different mechanism to communicate block structure to humans, and have no way to automatically…

GCC will now warn about (some cases of) misleading indentation, which is a step forward. And clang format can autoformat based on the brackets, I believe.

I still prefer whitespace to indicate blocks though.

Re: Rust can be difficult to learn and frustrating, but it's also very exciting

#170

I have been learning Rust on and off this year. I have been writing mostly GO for the past few years, but am moving to coding almost primarily in Rust for any new project, and porting over some older ones. Microservices, Data Layer, etc... Honestly, while not perfect, its one of the most beautiful languages I have ever come across. Plus, I have not enjoyed coding in a language this much in a while.

How does your team (E.g., the people on the hook for reviewing/supporting/contributing to your project) feel about the change? This is a big difference when moving from Go. A language that nobody calls beautiful, but is very easy for a team to contribute to and support (relative to other languages).

One more point here, I wouldnt have done it if I did not get full support & enthusiasm from my team. But I guess sometimes it helps when you dont have HUGE existing code bases to have to justify to port. =)
Post reply on HN