Giter Club home page Giter Club logo

Comments (13)

xJonathanLEI avatar xJonathanLEI commented on June 14, 2024 1

A better approach is to just move all binary targets to a dedicated package called cairo-cli, like what's done in foundry:

https://github.com/foundry-rs/foundry/blob/68714214c4aae6e337e6b2e40cf4de0d2de61f38/cli/Cargo.toml#L101_L109

(this makes installing all the binaries easy, but we still need to rename the binaries as suggested).

from cairo.

mkaput avatar mkaput commented on June 14, 2024 1

Yeah if we eventually want to put this on crates.io then crate names should also be made cairo/starknet-speicifc.

That's actually already an issue, because I have to use these super generic names in package manager code:

image

from cairo.

xJonathanLEI avatar xJonathanLEI commented on June 14, 2024 1

To make this PR manageable/reviewable and minimize the impact on other pending PRs, I will implement it as a script so that only the script needs to be reviewed. The PR itself can then be verified by running the script on the merge base to see if the exact same patch is generated. Pending PRs that are getting conflicts can simply have them resolved by running the script.

from cairo.

xJonathanLEI avatar xJonathanLEI commented on June 14, 2024

To demo how such a refactor would look like, I've created a fork with the addition of a cairo-cli package containing all 7 CLI targets, in which you can just install all 7 binaries like this:

$ cargo install --locked --path cli
---- SNIP ----
   Installed package `cairo-cli v0.1.0` (executables `cairo-compile`, `cairo-fmt`, `cairo-lsp`, `cairo-run`, `sierra-compile`, `starknet-compile`, `starknet-sierra-compile`)

(Using symlinks in my fork to make it easier to rebase. In an actual refactor files should be moved instead)

Not submitting the unsolicited PR until I get confirmation from the team that this is actually desired.

from cairo.

mkaput avatar mkaput commented on June 14, 2024

What's more, this also applies to crate names.

from cairo.

xJonathanLEI avatar xJonathanLEI commented on June 14, 2024

What's more, this also applies to crate names.

Yeah if we eventually want to put this on crates.io then crate names should also be made cairo/starknet-speicifc.

Btw I've squatted the cairo-cli crate name just in case one day this project goes on crates.io.

from cairo.

spapinistarkware avatar spapinistarkware commented on June 14, 2024

O think that's a good idea. Renaming crates and executables.
I'd like to get such a PR. @orizi ? Wdyt?

One question - generate_syntax isn't supposed to be an exposed binary, it's just a utility for generating source code.

from cairo.

orizi avatar orizi commented on June 14, 2024

it sounds like a good idea.

from cairo.

xJonathanLEI avatar xJonathanLEI commented on June 14, 2024

Thanks! So I guess the consensus here is to get this resolved early on to avoid breaking even more stuff later down the road.

Then I think the next logical step would be to determine which crates need renaming, and to what.

There are a total of 24 crates in this project. We already know that the syntax_codegen is just for internal codegen (won't get published on crates.io), so it doesn't need to be renamed.

On top of that, plugins seems to be only used in tests, so it won't get published either.

That should leave us with the following crates:

(Update: table moved to opening post for better visibility. Removing this one to avoid confusion.)

12 crate names are already taken on crates.io. We have to rename those if we want to eventually bring the whole thing on crates.io. Personally I think some names are way too generic even if available anyways.

Obviously I don't know the codebase good enough to come up with the best names. So this is totally just a suggestion. WDYT?

(I think we still need the new cairo-cli crate for making it easy to install the whole thing, but that one's easy to do once we get this resolved.)

from cairo.

spapinistarkware avatar spapinistarkware commented on June 14, 2024

I think every crate should be prefixed with cairo. I think we just didn't know these names correspond to package names on crates.io when we started writing.

from cairo.

xJonathanLEI avatar xJonathanLEI commented on June 14, 2024

Got it. Thanks for the input. Would you like to simply prefix cairo- to all the current names?

My suggestions were based on this prefix-adding principle, while:

  • applying abbreviation/simplification where applicable, which helps prevent overly long crate names (e.g. cairo-diagnostics-proc-macros)
  • leaving the sierra-* crates unprefixed since they're already prefixed by sierra-
  • using - instead of _

Please kindly let me know your preferences. Would love to push this forward and secure (squat) the crate names.

Btw I just moved the table from the comment to the opening post for better visibility.

from cairo.

spapinistarkware avatar spapinistarkware commented on June 14, 2024

This sounds good to me. Though, I don't like the dxs abbreviation. I don't mind having a long name, so I prefer diagnostics
Other than that, would love to get a PR:)

from cairo.

xJonathanLEI avatar xJonathanLEI commented on June 14, 2024

Sounds good! Will submit PR. Thanks!

from cairo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.