Replies: 3 comments
-
Also to add on my proposal, (I just realized that) this would render the This is due to the fact that you can simply change the source object: # specifying a path to crabc
source = { path = "path/to/crabc/bin" }
# specifting a url to crabc
source = { url = "https://example.com/crabc/dist/some-crabc-here" } |
Beta Was this translation helpful? Give feedback.
-
I don't think its correct to put this in |
Beta Was this translation helpful? Give feedback.
-
I agree. The more I've been thinking about it, the more I think we can accomplish this with custom build and run commands: crabgo buildc Which will look for a config pointing to a custom compiler. This will make interoperability between crab and rust easier I think. |
Beta Was this translation helpful? Give feedback.
-
People are very excited about issues such as:
And many more ideas sprinkled throughout the issue boards and Discord server.
Even Graydon, the creator of Rust himself, had things he wanted to do differently: The Rust I Wanted Had No Future
I am a firm believer that in the world of software, we can actually "have our cake and eat it too". With the exception of meeting deadlines... so we just won't set those 😎
And I think Rust has proven this theory with its 0 cost abstractions.
So in order to accomplish this... Lets just add crabc as a dependency in Cargo.toml! It might look something like this (see the bottom [crabc]):
Why would we do this?
Currently if users want to use experimental features that aren't in master or nightly, they have to
git clone <branch-with-cool-feature>
and build from source. This is not a seamless experience and does not streamline the adoption of the most requested features such as the .crab file extensionAlso, if a project requires a specific compiled version of crabc with a specific experimental feature, the author of the project has to be relied upon to provide that documentation. This would integrate that piece directly into the build process.
Potential downsides?
I was actually struggling to think of anything reasonable without feeling like I was grasping for straws. This normally leads me to believe I'm on to a good idea. I was able to think of one tho:
If one user created a package that requires a specific crabc compiler with specific features enabled, it would make the package unusable in other projects. This sounds scary at first (I was actually concerned about this when it occurred to me) until you realize that this is nothing more than a standard dependency conflict. No different that 2 crabc crates conflicting with each other on dependencies. It will be up to the project author to maintain crates that have high compatibility within the crabc ecosystem by building it with features standardized in master. If they diverge with custom compilers, they will have to make note of such. Projects do that today such as rocket.rs v4 and lower with nightly features.
Potential implementations:
crabgo
as it becomes an "it just works" implementation which is always my favorite.crabgo-crab
andcargo-crab
subcommand. I really like this idea forcargo
. It can be hosted on crates.io and allow for cargo / rust users to point their Cargo.toml tocrabc
if they so desire! :) I think this would be HUGE for streamlining adoption. It will also help with interoperability between the rust and crab toolchains.Note that this is a rough draft of an idea that came to me while taking a shower last night.
And another note: I'm not in love with the [crabc] syntax in the Cargo.toml above. We might be able to literally use the exact same syntax for [dependencies]. We can refine that in the comments. Just wanted to get my idea down and shared with you guys.
Do you love it? Hate it?
Is it engine to the rocket that CrabLang needs for taking off and going mainstream? 🚀
Or is it a rabid dog that needs to be taken out back and put down? 👀
Lets refine this thing together in the comments! :)
Edit:
I really like @HTG-YT 's proposed syntax here: https://discord.com/channels/1074804478651400303/1095989994033782814/1116011823733424128
Would match with the current dependency syntax in Cargo.toml
Edit:
And additionally as noted by @HTG-YT , the
source_type
field would be rendered unnecessary! 🎉Beta Was this translation helpful? Give feedback.
All reactions