This looks like some good remarks. Personally, I think Rust is great because it addresses a lot of hard and/or inconvenient issues with other languages. A lot of the pain points I have with Rust are consequences of that. A great example is how hard it is to work with floats at times: it's hard because nearly every other language is doing it wrong!
Which is also a great demonstration on why they keep doing it wrong: doing it right is a pain in the ass. ![]()
Reading through your notes, I keep thinking "oh, there's a good reason for that... but it doesn't help if you don't know what it is". I suppose that sort of thing is primarily Steve's problem. ![]()
Just to track my own reactions to your notes:
-
finddidn't work because it's defined to only work on immutable objects; theTreeMapinstance being mutable is irrelevant. Just below it in the docs, though, isfind_mut, which was what you wanted. That you didn't (see it/know to look for it/recognise the distinction) suggests that the docs at that point weren't doing a good job of noting how important that distinction is in Rust. -
I vaguely remember trying to do something with
Hasharound the same time. It was rather obtuse. The current API is... well, I just looked it up, and I'm frankly baffled at a first glance on how to use it. [1] The good news is that part of Steve's contract is for him to write examples for every type and function, or at least as much as is possible. Once that's done, Rust should have pretty excellent coverage when it comes to practical examples. That's obviously little comfort back then. -
I think the JSON thing is a bit unfortunate. It comes down to either: using a
Vec<f64>instead of a fixed-size type, waiting for Rust to get generic value parameters, implementing the very general-purposeDecodableinterface, or manually unpacking the JSON AST. -
I find it amusing that Shepmaster said "cast" when he was talking about
transmute. In probably any other language, bitcasting would be a language feature. Rust is all like "pfft; stick that crap in a function". Your point is pretty fair: how on earth is anyone looking for bit casting going to know to search for "transmute"? -
I'd say that the language is verbose in "compared to Python or Nim" terms, but I don't see it as being unduly so. Especially when you consider that there's been a concerted push to remove unnecessary syntax sugar ahead of 1.0 stabilisation. That said,
if letgot added because it was such a widely useful bit of sugar. Also, there's lifetime elision, which is pretty damned massive.The example of
Addis pretty bad for Rust in a straight-up comparison, but I think it's also a little misleading. I mean, Rust doesn't have function overloading, you're not using tuple member access or using a struct with named fields, you're counting optional whitespace, and trait syntax has to deal with multiple dispatch and inference issues that an overloaded function doesn't.Again, completely fair to point out that it's easier to define addition of a type in Nim.
-
The standard library being complicated is... probably even truer today. Rust is very abstraction-happy, and that's a good thing. It's also a bad thing. I don't know about overcomplicated, though. That implies to me that the complexity serves no purpose, which I don't think is true. I mean, the
Entrystuff is a little obtuse at first, but it's a very impressively clean solution for the problem at hand. -
I deeply suspect your problems with Cargo were documentation-related. Cargo, at the start, had very sparse documentation, and some stuff was just not at all obvious. You should have been able to do the whole thing in a single directory. I haven't really read through the Cargo guide recently, but I think things have improved on this front.
I'm kind of surprised you didn't complain about the module system itself. That always seems to throw people for a loop!

Although now that I think about it, it seems like at least part of your problem with Cargo was, in fact, a problem with the module system. I wrote up an article about it a while ago, and Steve wrote a pretty detailed one for the guide book... but again, it's an issue of timing in your case, and making sure people can find the information in general.
-
Again, yeah,
Hashis a pretty nasty thing to have to deal with. -
The "overcomplicated" line is, I think, rather unfair. The reason
Vecdoesn't havemapis because it's defined onIterator. It makes little sense to pepper the code with special-cased shortcuts to general functionality. That starts to get into questions of "which iterator composition methods should be defined on containers?" and "in cases where a container has multiple types of iterators, which do we use?" and "should the shortcut return an iterator or the container type itself?". Shortcuts would be nice, but I also think in this case, they'd be a mistake.One thing that might help, however, are HKT (Higher Kinded Types). These are planned for eventually (hopefully in the near-term), and would allow for things like
Vecto express the fact that they can be turned into iterators. At that point, you could write an adapter that takes anIterableand exposes the composition methods itself, without the scaling problems of doing it at the moment.Also, it's not just so you can do things like
VectoList.Iteratoris basically the fundamental compositional unit of sequential processing in Rust. There are whole libraries that are just about defining newIterator-based compositions. It's not just aboutVec; literally every type that can be turned into anIteratorgetsmap.Now, having said all that, allow me to blow a hole in my own argument:
Option::map,Result::map, andVec::map_in_place(though that one does have additional restrictions).
[2] -
On your points comparing Nim to Rust directly, Rust does have control over the calling convention. Rust's interop with C is pretty great, with the exception of
unionwhich Rust just completely fails at right now (you have to resort totransmute). -
I can't comment on Nim macros, as I'm not familiar with them. I can guess that Nim templates are less verbose than Rust generics, though. To be fair, after years of working with "conventional" template systems (C++ and D, mostly), I much prefer the way Rust does it, as it allows generics to be type-checked at their definition, instead of at their expansion. They're so, so much easier to debug problems with!
-
Also, Rust does support dynamic binding, although I'm not sure what exactly your referring to here in regards to Nim. Short version: as long as a trait is object-safe, it can be used for static dispatch and dynamic dispatch.
I'm always happy to see stuff like this, because it's hard to keep track of how the language appears to newcomers when you're already waist-deep in it. Thanks for putting it up.
-
Ok, so there's a
Hashertrait now, but the only operations defined areresetandfinish. If I'm implementingHashon a type, how the heck do I feed it anything?
-
I had links to the documentation, but the forum apparently thinks I'm not trustworthy enough. Fine, be that way. Stupid forum...