Skip to content
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

First meeting (2018-02-20 17:00 UTC) #1

Closed
killercup opened this issue Feb 15, 2018 · 6 comments
Closed

First meeting (2018-02-20 17:00 UTC) #1

killercup opened this issue Feb 15, 2018 · 6 comments

Comments

@killercup
Copy link
Collaborator

(will post the notes taken during the meeting here)

@killercup
Copy link
Collaborator Author

For the record: Etherpad right after this meeting

Rust CLI working group

Meta

Legend: -> = action item

Team members

  • eijebong (diesel, servo and randomly bumping dependencies all around the place...)
  • epage (Ed Page): cobalt, crate-ci
  • DPC (Dylan DPC): co-maintainer of uuid-rs & github-rs
  • kbknapp (Kevin Knapp): clap, clog, cargo-{outdated, count, graph}
  • killercup (Pascal Hertleif): WG lead, quicli, assert_cli, diesel, cargo-edit
  • TeXitoi (Guillaume P.): structopt, benchmarksgame in rust, osmpbfreader, mdo, mimirsbrunn (a geocoder in rust based on elasticsearch), a bit of rust-geo and rs-es
  • vitiral (Garrett Berg): artifact, ergo, path_abs, taken
  • yoshuawuyts (Yoshua Wuyts)
  • sgrif (Sean Griffin): diesel

Slogan ideas

Writing CLI apps in Rust is a frictionless experience with known best practices that work across platforms, good documentation, and effortless distribution

Definition of CLI

A program that is launch in a terminal with parameter, no user interaction during the execution, and that do work on files, network and/or output to terminal

ie not an ncurses TUI
ie not a daemon (@kbknapp: I would argue that I daemon could very well fall into the CLI realm of what's applicable here)

Goals

Areas

  • Fun / low friction

  • Cross-platform

  • Native to each platform

  • End-user consumable (distribution)

  • Releasing with confidence (testing, etc)

  • Rust is known to be a very good language for writing CLI tools

  • Writing and distributing a CLI in rust should be more fun than doing so in python.

  • "Writing a CLI tool" is a good way to get started with Rust as a beginner

  • Make it easy to ship well-tested binaries

  • "Writing seamless binaries in Rust should be effortless"

  • Rust CLI apps work effectively the same on all platforms

How to get there

  • Identify important use-cases and get crates ready
    -> Small survey?
  • Blog posts, tutorials, guides, etc. on how to write CLI apps in Rust
  • Cookbook? https://rust-lang-nursery.github.io/rust-cookbook/
  • quicli docs are written in a cookbook/"let's get shit done" way https://killercup.github.io/quicli/
  • "guides as tests" philosophy
  • CI book started (will include binary distribution): https://crate-ci.github.io/index.html
  • Organizing bin crates (when to mix bin/lib, when to keep separate, managing distinct dependencies)
  • Testing / Stability
  • Stability this year is a non goal. This year is about experimentation.
  • Working on stability for next year or the year after is a goal.
  • Do something like "crater" for the CLI ecosystem -- make it easy to have your CLI auto tested with the latest "CLI libraries"
  • Create "conglomeration" crates that exposes a "unified" API.
  • This is what ergo is attempting: https://github.com/rust-crates/ergo
  • Presence on the new Rust site
  • Begin describing "ideal workflows"

Crate-wise, I think the thing that could be valuable is to expand on an idea I've seen floated from time to time, creating higher level abstractions over the existing libs. For example, std::path is pretty low level when you compare it to pathlib in Python. If we provide some higher level libs (at the cost of performance or lack of platform neutrality) that'd be a big help for people. They could then progress to the lower level stuff in inner loops

Aspects of writing a CLI tool

Gotchas

  • test harness

    • how to set up clean filesystem/etc environments for testing (containers? chroot jails?
      • tempfile helps
      • dir-diff helps with validation
      • Mocking
  • error handling (failure is looking good but does not yet have clear messaging/documentation about how to architect/structure error handling in your app)

  • file path handling

  • how to package/deploy/distribute

  • serialization/deserialization idioms

    • learning how different formats (JSON, TOML, etc) interact with the serde data model
    • best practices and idioms, e.g. "intermediate representation" types that map more closely to the serialization format
  • Where to read config files from

    • XDG?)
    • app_dirs crate
      • Is it being maintained?
      • What can be done to help with this?
  • Config best practices

    • config crate (handle merging env with file)
  • streaming

    • how to thread progress computation through chained readers
    • handling different archive formats (this may be specific to me but I bet others will hit it)
      • how to stream zip files (no crates.io crate supports this AFAIK)
      • how to compute progress percentage of decompressing files

Packaging (Not cargo-install)

  • Guides/How-Tos
  • Deb, RPM, AUR, Homebrew, Snap, Flatpak, AppImage, nixpkgs
  • Automation
  • cargo subcommands
  • Using CI

If cargo-install is an important use case for dev tools, how much should we look at improving it?

@yoshuawuyts
Copy link
Collaborator

@killercup perhaps we could capture the etherpad snapshot in a file too?

@killercup
Copy link
Collaborator Author

@yoshuawuyts the etherpad is versioned already, and most of the content will probably be duplicated in tracking issues, so I wouldn't bother :)

@yoshuawuyts
Copy link
Collaborator

@killercup ah yeah, makes sense!

@pickfire
Copy link

pickfire commented Feb 23, 2018

@killercup What about unifying serde interfaces for different formats as such 3Hren/msgpack-rust#161? As well, can we join the conversation of CLI-WG?

@killercup
Copy link
Collaborator Author

killercup commented Feb 23, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants