Nushell core team meeting 2025-01-22

Attendees

  • Jack
  • Piepmatz
  • Michael
  • Darren
  • Andy
  • Douglas
  • Ian
  • Rose
  • Stefan
  • Jakub
  • Aucacoyan
  • Devyn
  • Wind

Agenda

  • Quick check, any objections to #14397?
  • Assignment statements or expressions
  • #14865 Add examples, categories, search_terms with test, bench, deprecated, platform attributes, etc. to custom commands Discord Discussion
  • #14873 Track where we are at with the voting on How essential is remembering the current directory for each Windows drive letter?
  • [ ]
  • [ ]

Discussed Topics

filesize formatting changes

  • greenlit, change the name of decimal to metric for the kB/MB series, keep binary for KiB

Assignment expression vs statement.

Current state

  • let/const/mut are statement only
    • (not allowed in pipeline elements)
  • $mutable = reassignment is expressiony
    • somewhat more involved rules on precedence/associativity to the | pipe
      Proposal make all assignment expression like (so the operation returns the same value and you can chain assignments)
  • Pro:
    • repl brevity
    • more consistent rules between binding/reassignment
  • Caveats:
    • cloning of the value
    • (what is the rule in statement level on REPL)
    • confusability with ==
    • potentially confusing order of operations
    • collection may not be obvious based on chosen syntax

Somewhat orthogonal but additive:

  • Being able to pipe into a variable instead of leading with the lhs
    • pipeline | let x
    • This would mesh well with the expressiony logic
    • stream | let x | do more stuff
      • challenge around stream vs collecting (looking over at the tee code maybe to assign while streaming)

Wishlist: feature flag

  • precedent: EVAL_IR
  • at the start of the engine state set based on external env/flag
  • also possibility of a global if at startup
  • Alternatively somethign config like that can be changed at runtime

command level attributes/metadata

  • motivation: provide examples etc.
    • great for getting parity of std or other modules with the builtins
  • different syntax proposals:
    • flag on the def command
      • readability concern
      • existing impl in #14865
    • @example (optional const expression) etc. attributes
      • simpler to parse for external tools
      • could this generalize to even custom attributes
  • Sentiment leave --env and --wrapped untouched for now, general preference towards the attribute syntax for the rest
Select a repo