Coder Social home page Coder Social logo

Comments (3)

vitiral avatar vitiral commented on June 7, 2024

I think this kind of "story" can also help with #19 to tell the purpose of quicli. It is an entry point for beginners and a helper when your knowledge expands.

This will help reduce the amount of "should this crate be part of quicli" discussions -- most of those could be redirected to the relevant ergo subcrate.

from quicli.

killercup avatar killercup commented on June 7, 2024

from quicli.

vitiral avatar vitiral commented on June 7, 2024

Awesome! 🎉

How about just a full-throttle feature as the only default feature (for now), and ergo will work with just no-default-features.

I would like to unify the docs as well, to tell the full story. Basically the story is this:

Getting Started Guide

This is the kind of person who is not familiar with rust, or at least not familiar with the full ecosystem and how to build an application.

They are directed to use a cargo like this:

[dependencies]
quicli = "0.X.X"
serde = "0.X.X"
# ... other `derive` dependencies

The "cookbook" guide then looks very similar to what it does today (but we will keep improving them 😄)

Next Level: full ecosystem

At the next level, they are instructed to use a Cargo.toml like this:

[dependencies]
ergo = "0.X.X"
serde = "0.X.X"
# ... other `derive` dependencies

[dependencies.quicli]
default-features = false
version = "0.X.X"

We then basically replicate the rust cookbook, as well as additional examples, using this as the ecosystem. I would like one of the primary goals of ergo to be that it should be able to do almost anything from within the rust cookbook with zero additional dependencies.

Usecase

I think I see clearly now how these two crates interact:

  • quicli is for reducing boilerplate to quickly setup a CLI application. It is intended only for --bin crates.
  • ergo is an ecosystem of crates built for high level libraries, including --bin crates. It is also split into subcrates (i.e. ergo_fs) for some lower level libraries.

Let me include a use case, which is the CLI application I am rewriting.

artifact will be (eventually) split into 3 crates. Their dependencies (roughtly) would look like this:

                 ---- artifact-data
                /       - ergo
               /
artifact-app -------- artifact-web
 - quicli               - ergo
 - ergo                 - yew
                        - gotham

As you can see, the two "high level libraries" can feel free to depend on ergo. In order for this to be ergonomic, ergo must not include libraries like StructOpt and envlogger, which should only exist in --bin crates.

Conclusion / Vision

I think these two libraries can interact very nicely, and I think our first goal can/should be to rewrite the rust Cookbook using these libraries.

I'm currently reviewing the API guidelines and plan on contacting the libz blitz team and see if we can share knoweldge/expertise. The ideal case would be that the cookbook we work on writing will be the rust cookbook once ergo and quicli are stabilized. I would like to see if bringing the libz blitz team onboard would allow those goals to align.

Before that though I am going to actually use ergo and quicli as they exists today to rewrite artifact and port some of the cookbook. I will be making frequent changes/PRs for any bugs I find.

Does that all sound like a reasonable strategy?

from quicli.

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.