News for hackers. Stuff that matters.
Re:Ask HN: What is the state of C++ vs. Rust? by agentgt on Wednesday October 19, 2016 @11:20AM (#12744553)
This is all personal opinion so take it with a grain of salt.

I think Rust could do some serious C++ competition if it could dethrone C++ from some platform or have a worthy alternative.

That is I think Rust really needs a killer app/platform/problem similar to how Swift has Apple devices and DevOps now have Go.

If Rust could get into a gaming platform or have a really good gaming library like Unity it could have a good starting point to move over mind share.

Alternatively I think Rust could compete heavily with Go since the whole microservices space is still sort of up for grabs (or atleast is so massive that there is plenty of pie to be had).

Rust's current niche (ie users) is language aficionados which historically hasn't been a good niche (ie Haskell) for language propagation. That is I think Rust could get more popular if it can get heavily used by a set of niche users at first.

Besides mircoservices and games an interesting niche might be Arduino and IOT [1]. That might be a good niche/platform to dethrone C++.

[1]: http://jakegoulding.com/blog/2016/01/02/rust-on-an-arduino-u...

Re:Ask HN: What is the state of C++ vs. Rust? by mi100hael on Wednesday October 19, 2016 @11:50AM (#12744867)
> Alternatively I think Rust could compete heavily with Go since the whole microservices space is still sort of up for grabs (or atleast is so massive that there is plenty of pie to be had).

I think you're wrong about this one. Go has a ton of HTTP libraries that make it dead simple to get a web service up and running with all the features you'd expect like pattern-matching URL routing, database backends, sessions, etc. Building something in Rust would be much more painful.

Re:Ask HN: What is the state of C++ vs. Rust? by kornholi on Wednesday October 19, 2016 @12:54PM (#12745434)
Surprisingly, it's already not that painful. I recently wrote a tiny JSON service with Iron and Diesel and it wasn't that much longer or complex compared to Go. The biggest headache was figuring out how Diesel works, and it would have been a lot easier using raw queries with something like rust-postgres (which would be the way to go in Go or Node). Once the ecosystem matures a little bit more I don't see why Rust would be a bad choice.
Re:Ask HN: What is the state of C++ vs. Rust? by tmzt on Friday October 21, 2016 @12:07AM (#12758078)
Macros 1.1 should make working with Diesel easier for the programmer, compared to the incompatible compiler plugin APIs.

I think the sweet spot with rust might leveraging metaprogramming, for instance, generating a REST database API from a schema and having the resulting code compile to something faster the most languages like python or ruby, and at least on par with Go, Java, or swift.

Re:Ask HN: What is the state of C++ vs. Rust? by agentgt on Wednesday October 19, 2016 @12:05PM (#12745019)
There are libraries (I didn't downvote you but I suppose that is why as simple googling shows that) [1].

That being said one would argue if you are going the microservices route you shouldn't need an exceptional amount of routing anyway. You only need to really handle raw HTTP for the most part (also I would not say HTTP is the end all for microservices... I have been using a Rust AMQP library with some success [2]).

Also although Go has green threads it is still debatable if that is the right way or golden way particularly when so many backends like databases (e.g. postgres) can't handle async (tons of connections) anyway. Old school one thread per request libraries in Java like dropwizard can still do fairly well. I think Rust made the right choice with native threads and hopefully some interesting green thread or reactive libraries will come forth soon (or already here ... haven't googled it).

Also I'm just not sure I really buy into Go's channels but that is just a personal opinion at the moment.

[1]: https://youtu.be/pTQxHIzGqFI?t=964A

[2]: https://github.com/Antti/rust-amqp

Re:Ask HN: What is the state of C++ vs. Rust? by ngrilly on Wednesday October 19, 2016 @05:59PM (#12748078)
When you need to handle a lot of concurrent connections (from your clients, not to your database), Go green threads are invaluable (better than OS threads because a goroutine requires only 2 KB; and better than callbacks). They are also very useful to express concurrent algorithms.
Re:Ask HN: What is the state of C++ vs. Rust? by twic on Wednesday October 19, 2016 @05:50PM (#12748013)
I assumed that agentgt meant "up for grabs" in the sense of "not yet dominated by any one language", which is true. Go and Java are both big presences in that space, but neither is dominant. A language with the expressiveness of Java and the memory use of Go could be a strong challenger, and Rust is already better than that.
Re:Ask HN: What is the state of C++ vs. Rust? by schoenobates on Thursday October 20, 2016 @01:35AM (#12749936)
I'm not a RUST chap, but came across this the other day:

http://www.arewewebyet.org/

I've done most of my web service work in either Java or Go, but I'd like to give Rust a try for comparison at some point.

Re:Ask HN: What is the state of C++ vs. Rust? by tmzt on Friday October 21, 2016 @12:09AM (#12758086)
Rust people may have better insight into this, but it seems like that site is outdated and in need of an update.

Edit: I meant to say that I have heard from many of them that the content of that is outdated and in need of an update. There was talk of the community taking it over but I don't have the latest on that.

Re:Ask HN: What is the state of C++ vs. Rust? by steveklabnik on Friday October 21, 2016 @03:40AM (#12758809)
Dot org is the takeover of the old dot com, which is what you were thinking of.
Re:Ask HN: What is the state of C++ vs. Rust? by tmzt on Friday October 21, 2016 @03:51AM (#12758852)
Okay, there was an attempt made to get the .com redirected?
Re:Ask HN: What is the state of C++ vs. Rust? by steveklabnik on Friday October 21, 2016 @03:53AM (#12758857)
It currently does.
Re:Ask HN: What is the state of C++ vs. Rust? by tmzt on Friday October 21, 2016 @04:02AM (#12758895)
Okay, sorry for the confusion.
Re:Ask HN: What is the state of C++ vs. Rust? by steveklabnik on Friday October 21, 2016 @07:21AM (#12759490)
It's all good! It was wrong for a very long time. This is a recent development.
Re:Ask HN: What is the state of C++ vs. Rust? by fiedzia on Wednesday October 19, 2016 @01:12PM (#12745605)
> Building something in Rust would be much more painful.

Go may have more of those things and it may be easier to find copy-pastable examples for them, but rust has them too, and its not painfull. The things you mentioned are there and are working fine.

Re:Ask HN: What is the state of C++ vs. Rust? by bluejekyll on Wednesday October 19, 2016 @11:32AM (#12744669)
For those not aware of it, Tokio https://github.com/tokio-rs/tokio is a platform that is being built on top of Rust Futures for building exactly these types of services.

It's built around futures and mio, so Tokio services are async, and elegant.

Re:Ask HN: What is the state of C++ vs. Rust? by mastax on Wednesday October 19, 2016 @01:04PM (#12745544)
I'd say if you want to build web-backend type services in Rust right now, you'd do alright. Hyper, mio, diesel, etc. are all pretty good. I do think (and hope) that things will be much more compelling in a year once tokio and its library ecosystem have matured. Tokio's abstractions seem very compelling.
Re:Ask HN: What is the state of C++ vs. Rust? by setori88 on Wednesday October 19, 2016 @12:12PM (#12745078)
Regarding microservices; it's my hopes https://github.com/fractalide/fractalide moves into this space.