6 ms·
Great proposal, but Temporal is a poor name. Why not, in the age of the import keyword, finally just have a standard library, and import Date from std like a pr
by ABoldGambit 6y ago
Great proposal, but Temporal is a poor name. Why not, in the age of the import keyword, finally just have a standard library, and import Date from std like a proper programming language?
- politelemon 6y agoI agree, I think there should have been some drop-in replacement which would allow old scripts to continue working but also let new work make use of these improvements with `Date`. I feel that this duality will persist for a long time, and it can lead to answers, documentation and codebases becoming a confusing mess. It's hard to predict exactly what this mess will look like, only... er... Time will tell.
- runarberg 6y agoThere is a proposal for that[1] which introduces a `js:` pseudo-protocol for importing a build in module (or a standard library): import Temporal from "js:temporal"; 1: https://github.com/tc39/proposal-built-in-modules https://github.com/tc39/proposal-built-in-modules
- hyperpape 6y agoI agree Temporal is an odd name for the object representing an Instant. But it shouldn't be Date either. A Date does not have a time associated with it. Java really did a good job here: Instant, LocalDate, LocalDateTime, ZonedDateTime. (If they hadn't already had java.util.Date, they probably could've replaced LocalDate/LocalDateTime with Date/DateTime, but that ship sailed).
- cwp 6y agoTemporal is just the namespace. It has classes called DateTime, Date, Time, TimeZone, Duration etc.