Repository navigation
Description
We have a few "types" where the naming is not perfectly consistent across the user facing interface:
- The commands specific to the type (e.g.
date now) - The
Typename accessible throughdescribe(e.g.1.0 | describefloat) - The
SyntaxShapei.e. the thing you can cue the parser to which is the thing the type annotations indefs are turned into (e.g.def foo [bar: datetime]) - Documentation inside and outside the application when referring to that.
On top of that our internal symbols should follow the same names for better discoverability.
✔️ decimal -> float
Here the direction to move is obvious as float is more true to what the capabilities of the underlying data type is (not money-safe, fast for approximate math)
Details as this is DONE
Status copied from #10320 (comment)
-
into decimaldeprecated in favor ofinto floatRenameinto decimaltointo float#9979 -
random decimaldeprecated in favor ofrandom floatRenamerandom decimaltorandom float#10320 -
describe/Type::to_string()isfloat - Parser accepts both
decimalandfloat... - to define
SyntaxShape::Decimal(Update internal use ofdecimaltofloat#10333) -
StyleComputerto map in the config uses the type name sofloat
date vs datetime
This is more contentious: date has a nice brevity for the command names but the capabilities for time are expressed by datetime
-
date ...family of commands (effectively the methods/class functions :P) -
format dateas the corresponding format command -
into datetimeas the cast -
seq datefor sequence generation -
Type::Date -
date now | describereturnsdate(rename date type to datetime #10298) -
SyntaxShape::DateTime - For command arguments
: datetime -
dateas the thing to style in the config (seeStyleComputer) - (Dataframes make a distinction between the two types:
dfr as-dateanddfr as-datetime) -
FlatShape::DateTime -
Expr::DateTime -
Category::Date
✔️ int and integer
Details as this is DONE
-
Type::Int -
SyntaxShape::Int -
random integerRenamerandom integertorandom int#10520 -
into int - type error messages e.g.
into intandnu_protocol::Value::as_intUseinttype name consistently #10579
bool and boolean
TODO
$nothing/null and nothing
- deprecate
$nothingin remove the$nothingvariable #10478
Addendum Path
To the user the distinction between Type and SyntaxShape is probably not strictly obvious. We should also try to get them as close as possible. Here a notable outlier is for example :path is SyntaxShape::Path that enables important completions but doesn't exist inside the Type/Value system
Activity
fdncred commentedon Sep 12, 2023
I'd add
FlatShapeandExprin general but more specificallyFlatShape::DateTime, andExpr::DateTime. All our enums should be in sync for better understanding.Just a listing of enums to check.
nu-protocol
nu-parser
sholderbach commentedon Sep 12, 2023
Feel free to expand the checklist above, we certainly should update the internals as well with the priority to user or user tooling facing stuff (e.g. that the ide extensions still work etc.)
amtoine commentedon Sep 12, 2023
wow, thanks for that @sholderbach 🙏
Update internal use of `decimal` to `float` (#10333)
1Kinoti commentedon Sep 27, 2023
intvsintegerType::IntSyntaxShape::Intrandom integer<~ culpritinto intRename `random integer` to `random int` (#10520)
Use `int` type name consistently (#10579)
Update internal use of `decimal` to `float` (nushell#10333)
Rename `random integer` to `random int` (nushell#10520)
Use `int` type name consistently (nushell#10579)
kronberger-droid commentedon Nov 14, 2026
The type names are consistent by now:
float,int,boolanddatetime, with$nothinggone.What is left is the naming of the
datecommands, which never got decided.