Hacker News new | past | comments | ask | show | jobs | submit login

I think it's possible to design a more intuitive system with less busywork:

1) For imports, the namespace hierarchy should have a one-to-one correspondence with the file and directory hierarchy.

2) For publishing code, instead of modules and Cargo, there would be one huge worldwide repository. You'd be able to freely import anything marked public, and the build system would cooperate with version control to make things work seamlessly.

Unfortunately it's probably too late for Rust to adopt such ideas. I wish some new language used them, though.

Given that crates.io has no namespaces, this is kinda sorta how this already works, I think. Or at least, I don't understand the distinction.

Well, you have two tools that can fetch stuff - git and cargo. In my preferred workflow there'd be only one tool. It would also work as a cloud filesystem, like p4fuse.

Cargo can use git, but it doesn't primarily. Crates are stored as tarballs on S3.

Right, I don't see why that's necessary. The whole world could be one big source control repository where each client keeps only their local changes. So e.g. if you want to make a local tweak to a third party library you're using, you 1) edit their file in your filesystem which is a transparent view into the world repo, 2) recompile your project.

That forces everyone to use git, which is not something we're interested in doing.

Agreed, it would force everyone to use the same VCS. I've lived in this kind of setup for years and I'm very happy with it, but point taken.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact