News for hackers. Stuff that matters.
Re:Ask HN: Why do you use Rust, when D is available? by nindalf on Friday June 12, 2020 @03:06AM (#23496791)
1. Could you give a few examples of libraries that can’t be made in Rust due to lack of abstraction compared to C++? GUI libraries apart, I can’t think of anything offhand.

2. True, but growth curves are rarely linear. Here’s a rough proxy on users - the number of subscribers to /r/rust - https://subredditstats.com/r/Rust. Look at the growth between 2014-18 and 2018-2020. You’re extrapolating on current growth rate, but that may increase in future.

3. “Ambitious”. Nothing I’ve seen precludes using Rust for ambitious projects. In fact, seeing the experience of Dropbox, Mozilla, Facebook and others, there are some ambitious projects that could only have been done in Rust. I’m gonna say [citation needed].

I agree with Stroustrup and look forward to the day people complain about Rust :)

Re:Ask HN: Why do you use Rust, when D is available? by saurik on Friday June 12, 2020 @05:40PM (#23504200)
I am under the impression that Rust is lacking even the most basic level of dependent typing: being able to template over a value; pretty much every typesafe buffer library I have ever written uses this to make Random<32>() return not just "a buffer" but "a buffer of size 32", which makes doing parsing of various packet formats and combining sources of information a lot more reasonable. (I am also under the impression that the Rust people intend to fix this lacking, but until then I know I am going to feel a bit crippled.)
Re:Ask HN: Why do you use Rust, when D is available? by steveklabnik on Friday June 12, 2020 @06:10PM (#23504412)
The basics are in nightly, but yes, not yet. We’ll get there.
Re:Ask HN: Why do you use Rust, when D is available? by papaf on Friday June 12, 2020 @07:34AM (#23498211)
1. Could you give a few examples of libraries that can’t be made in Rust due to lack of abstraction compared to C++?

I'm guessing, but I think that something like Armadillo[1] would not be possible on stable Rust. Something like Catch[2] might also difficult to make ergonomic.

I don't program in C++ anymore and I would personally live with the lack of expression/abstraction for a safer language though.

[1] http://arma.sourceforge.net/speed.html [2] https://github.com/catchorg/Catch2/blob/master/docs/tutorial...

Re:Ask HN: Why do you use Rust, when D is available? by 0xFluegel on Friday June 12, 2020 @02:32PM (#23502203)
Can you elaborate on why Catch would be impossible or unergonomic? It's a test framework, right? Why would one even use it instead of the normal rust test framework?

Also, how is it ergonomic? I'd agree if you say that it's (one of?) the best for C++, and it's also my go-to option, but ergonomic?

Re:Ask HN: Why do you use Rust, when D is available? by adamnemecek on Friday June 12, 2020 @11:37AM (#23500302)
Why are they impossible in Rust? Are you aware of Rust's macros right?
Re:Ask HN: Why do you use Rust, when D is available? by ncmncm on Friday June 12, 2020 @02:59PM (#23502470)
Rust macros know nothing about types, but types are what do all the work at compile time.
Re:Ask HN: Why do you use Rust, when D is available? by adamnemecek on Saturday June 13, 2020 @11:10AM (#23509952)
Do they have to know about types?
Re:Ask HN: Why do you use Rust, when D is available? by ncmncm on Monday June 15, 2020 @12:28AM (#23523799)
Only to build designs that today are possible only in C++.

Type-aware macros might not be the best way to implement the features needed to match C++.