crab icon indicating copy to clipboard operation
crab copied to clipboard

.crab file extension

Open TCROC opened this issue 1 year ago • 11 comments

I very much like @nonetrix 's proposal over here for the .crab file extension: https://github.com/crablang/crab/issues/18#issuecomment-1509703861

Why?

  1. It allows users to show their support for CrabLang on their GitHub repos! image

  2. 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

TCROC avatar Apr 15 '23 15:04 TCROC

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.

TCROC avatar Apr 15 '23 17:04 TCROC

are you proposing these changes be on the stable branch, or the experimental branch?

trvswgnr avatar Apr 17 '23 05:04 trvswgnr

Experimental. Maybe even as a subcommand:

https://doc.rust-lang.org/book/ch14-05-extending-cargo.html

TCROC avatar Apr 17 '23 11:04 TCROC

Which would mean a new repository under the CrabLang umbrella.

^ This is probably the easiest way to start.

TCROC avatar Apr 17 '23 11:04 TCROC

This is an excellent proposal!

mjovanc avatar Apr 17 '23 14:04 mjovanc

why not support both extensions?

explosion-mental avatar Apr 18 '23 17:04 explosion-mental

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.

TCROC avatar Apr 18 '23 17:04 TCROC

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.

trvswgnr avatar May 23 '23 15:05 trvswgnr

i propose crablang/wastebasket#11 ( .🦀)

Cuteistfox avatar May 28 '23 21:05 Cuteistfox

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

trvswgnr avatar May 30 '23 06:05 trvswgnr

-1

Cuteistfox avatar May 30 '23 20:05 Cuteistfox

@trvswgnr why not .🦀#53 .🦀

Cuteistfox avatar Jun 01 '23 19:06 Cuteistfox

What about making something like

crabgo convert rs crab

which would mean rs => crab and

crabgo convert crab rs

crab => rs

mrquantumoff avatar Jun 05 '23 15:06 mrquantumoff

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

TCROC avatar Jun 05 '23 15:06 TCROC

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).

rlidwka avatar Jun 11 '23 12:06 rlidwka