crab
crab copied to clipboard
.crab file extension
I very much like @nonetrix 's proposal over here for the .crab
file extension: https://github.com/crablang/crab/issues/18#issuecomment-1509703861
Why?
-
It allows users to show their support for CrabLang on their GitHub repos!
-
Its cool 🦀😎
How?
I think we can make this work and still be compatible with r*st. We would just need a crabgo
command to do the conversion. Probably something like:
crabgo crabify
: .rs -> .crab
crabgo rsify
: .crab -> .rs
For extra credit we can add a command to configure git with pre-commit
and other .gitattributes
that properly convert and / or compare .rs
and .crab
making for a frictionless developer experience. Something like:
crabgo gitify
Edit: typo
Edit: New proposed Commands per discord discussion here: https://discord.com/channels/1074804478651400303/1095989994033782814/1096842935049404447
crabgo convert rs-to-crab
: .rs -> .crab
crabgo convert crab-to-rs
: .crab -> .rs
With the following shorthands:
crabgo convert crab
= crabgo convert rs-to-crab
crabgo convert rs
= crabgo convert crab-to-rs
Edit:
Some common questions have been:
Will we still support .rs
?
Answer: Yes
I intend for the tool to make developing with both .rs and .crab a frictionless experience. Meaning it will allow libraries written in both .crab and .rs to work together.
Will this be in main / master?
No. It will either be in an experimental branch or as a subcommand in a new repository. I personally think the subcommand in a new repository is the best way to start. Here's some documentation to reference until we get the crabgo docs up: https://doc.rust-lang.org/book/ch14-05-extending-cargo.html
I'm personally in support of the convert [from-to-target]
with convert [target]
shorthand. Its clear concise and explains what is happening in the command.
are you proposing these changes be on the stable branch, or the experimental branch?
Experimental. Maybe even as a subcommand:
https://doc.rust-lang.org/book/ch14-05-extending-cargo.html
Which would mean a new repository under the CrabLang umbrella.
^ This is probably the easiest way to start.
This is an excellent proposal!
why not support both extensions?
why not support both extensions?
Are you suggesting supporting both .rs
and .crab
? If so, that is also what I propose! :) I don't ever want to stop supporting .rs
. .crab
would be an addition and we would make sure we have the tooling to easily convert between .rs
and .crab
.
i've been working on adding support for .crab
. i think it's a good first step for our experimental branch. progress has been a little slow, but i think i am almost done with it.
i propose crablang/wastebasket#11 ( .🦀)
i opened a PR in the crabgo repo that changes .rs
to .crab
. i'd like to support both extensions—and we will—but it's a little bit more intensive to do that.
https://github.com/crablang/crabgo/pull/1
-1
@trvswgnr why not .🦀#53 .🦀
What about making something like
crabgo convert rs crab
which would mean rs => crab and
crabgo convert crab rs
crab => rs
What about making something like
crabgo convert rs crab
which would mean rs => crab and
crabgo convert crab rs
crab => rs
I like this proposal. I think it might be my new favorite. Will update the issue with it
Keep .rs
extension.
There is absolutely zero reason to invent new extension for a language that has the same syntax.
In case crab codebase significantly diverges from upstream (which I doubt very much, given current nature of the project), syntax can be disambiguated using editions in Cargo.toml
(smth like edition=crab-2021
instead of current edition=2021
).