Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.crab file extension #20

Closed
TCROC opened this issue Apr 15, 2023 · 15 comments
Closed

.crab file extension #20

TCROC opened this issue Apr 15, 2023 · 15 comments
Assignees

Comments

@TCROC
Copy link

TCROC commented Apr 15, 2023

I very much like @nonetrix 's proposal over here for the .crab file extension: #18 (comment)

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


Edit: My new favorite proposal is from @mrquantumoff here

What about making something like

crabgo convert rs crab

which would mean rs => crab
and

crabgo convert crab rs

crab => rs

I think this is the perfect approach. Its just the right amount of verbosity. It ready from left to right as "from -> to" as most programming languages (all that I've used) do.

I think it completely does away with the need for shorthands.

@TCROC
Copy link
Author

TCROC commented Apr 15, 2023

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.

@trvswgnr
Copy link
Collaborator

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

@TCROC
Copy link
Author

TCROC commented Apr 17, 2023

Experimental. Maybe even as a subcommand:

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

@TCROC
Copy link
Author

TCROC commented Apr 17, 2023

Which would mean a new repository under the CrabLang umbrella.

^ This is probably the easiest way to start.

@mjovanc
Copy link

mjovanc commented Apr 17, 2023

This is an excellent proposal!

@explosion-mental
Copy link

why not support both extensions?

@TCROC
Copy link
Author

TCROC commented Apr 18, 2023

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.

@trvswgnr trvswgnr moved this to Todo in Crab - Experimental May 23, 2023
@trvswgnr trvswgnr moved this from Todo to In Progress in Crab - Experimental May 23, 2023
@trvswgnr
Copy link
Collaborator

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 trvswgnr self-assigned this May 23, 2023
@Cuteistfox
Copy link

i propose crablang/wastebasket#11 ( .🦀)

@trvswgnr
Copy link
Collaborator

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.

crablang/crabgo#1

@Cuteistfox
Copy link

-1

@Cuteistfox
Copy link

@trvswgnr why not .🦀#53 .🦀

@mrquantumoff
Copy link

What about making something like

crabgo convert rs crab

which would mean rs => crab
and

crabgo convert crab rs

crab => rs

@TCROC
Copy link
Author

TCROC commented Jun 5, 2023

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

@rlidwka
Copy link

rlidwka commented Jun 11, 2023

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

@crablang crablang locked and limited conversation to collaborators Jun 11, 2023
@pinkforest pinkforest converted this issue into discussion #98 Jun 11, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Crab - Experimental Jun 11, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
Development

No branches or pull requests

7 participants