How programmers transition between languages

rjframe dlang at ryanjframe.com
Tue Jan 30 11:55:42 UTC 2018


On Tue, 30 Jan 2018 10:38:31 +0000, Russel Winder wrote:

> On Mon, 2018-01-29 at 17:18 +0000, Mafi via Digitalmars-d wrote:
>> 
> […]
>> What would you say are the most important differences between dub and
>> Cargo? What does Cargo do better than dub (or worse for that matter)?
>> Superficially, they seem to be designed quite similarly.
> 
> The single most important thing is that Cargo stores source on a per
> person basis and compiles for each project separately. Dub stores source
> and compilation products on a per person basis. So, for me, Dub does the
> wrong thing with compilation of dependencies, and Cargo does it right.
> Why? Compiler choice and compiler option choice is a per project thing,
> not a centralised thing.

Are you sure? Every project on my PC places the build files in
$PROJECTDIR/.dub/build; the source is in ~/.dub/packages.

That said, the name of the compiler is kept in the directory structure (as 
well as architecture and OS), which means there could be advantages to 
placing build artifacts globally, since compiler changes would still be 
separated, we get a reduction in disk usage and (sometimes) compile speed 
for already-built libraries.


> Cargo allows for download from the central repository and from any
> arbitrary Git or Mercurial repository. Dub only seems to get from the
> central repository.

This would be nice. I wonder though if the community is too small for this 
right now; remove the necessity of the central repository and it may die 
(I would say it's somewhat struggling as it is) -- and when it comes to 
finding libraries there are advantages to it that Github doesn't have.


> The Cargo repository is just nicer than the Dub repository.

It looks a lot nicer. I'm going to argue that as far as functionality 
though, it's horrible (note this is my first time looking in a long time):

- Home page is nice; it makes me want to use it.
- I click "Browse All Crates"; the default sort is alphabetical - not
  useful unless I'm just browsing, even then I'd likely want to browse by
  category. Each project takes up too much space (it looks like something's
  missing on each project), but I like the links to the project's
  homepage/repo/docs being right there in the list.
- I don't see any sort of categories/tags to organize projects. I guess I 
  have to know what I'm looking for and use the right search term.
- Overall, I have the impression that it was designed to look good, but
  less effort has gone into what people will want to do with it in the
  first place (assuming I can consider myself normal for a moment).

Dub doesn't look so nice, but it's efficient; I could see me searching 
Cargo for something and not finding it; I've never thought that about Dub 
(granted, far fewer packages) or Pypi.


> Cargo uses TOML project specifications, Dub uses JSON or SDL. Cargo
> wins, Dub doesn't.

Agreed.


> It is certainly true that Dub and Cargo have the same aims and goal,
> it's just that Cargo does it better on essentially all fronts as far as
> the project build and builder are concerned.

Have you opened issues on the dub repository for the various problems you 
see?

--Ryan


More information about the Digitalmars-d mailing list