Issue #13072 has been updated by shyouhei (Shyouhei Urabe).


stomar (Marcus Stollsteimer) wrote:
> > date library will be separeted from Ruby repository (stdlib) to date.gem
> 
> I think the concept of date (without time) is so important that it should not simply be unbundled into a gem.

Separating repository does not directly mean unbundling.

For instance we recently separated our openssl library to its dedicated repository.  But this doesn't mean we unbundled it.  Because rubygems depends that library, we cannot but ship them altogether.

Quite generally speaking, there are currently 4 kinds of situation for a formerly-standard library:

- Ones that are still remaining as they were before.
- So-called "default gems": ones that resides as source codes in the shipped tarball, with gemspec.
- So-called "bundled gems": ones that resides as .gem file in the shipped tarball.  They don't need network access to install.
- Ones that are not bundled any longer.  Installing them needs network access.

All but the last one are currently considered somewhat "standard".  And I don't think Date would go straight to the last kind.

> I'm concerned about the increasing tendency to unbundle core functionality, and fear that Ruby will loose some of its usability and attractiveness as an all-purpose language, especially for simple, easy to distribute, single-file scripts for e.g. administrative tasks, text processing, or data analysis.
> 
> Please keep in mind that installing gems is not always that easy, for instance without root access or on non-Unix-like operating systems -- even more so for native gems. _[Please forgive the (partial) double posting with #13221.]_

This concern is valid.

But what is discussed in this thread is to transplant some part of ext/date functionality to Time, to make them separate.  Once that happened, I think there are chances for Date to be a pure-ruby library again (note: it once was).

> The current situation with Time, Date, DateTime is indeed confusing, but instead of removing `date` offhandedly please try to find a solution where the core functionality is kept _somewhere_ in the stdlib (not necessarily where it is now).

Creating a gem and to unbundle it is a separate thing, and gem itself should have no side effect I believe.  We can arrange the way how Date library would be placed in a future.

----------------------------------------
Misc #13072: Current state of date standard library
https://bugs.ruby-lang.org/issues/13072#change-64075

* Author: zverok (Victor Shepelev)
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
The facts that I've been able to gather (not supported by links, so please forgive me if I am misquoting/misunderstanding):

* date library was initially developed and maintained by Tadayoshi Funaba, who was the "single point of truth" for its design and features;
* for at least year, initial creator/maintainer of the library is inactive in Ruby community, so library mostly considered unmaintained;
* as far as I can "sense"/guess from ticket responses about the library, the core team doesn't see it as crucial/important to maintain.

At the same time, the library provides:

* Widely and extensively used `Date` class;
* Pretty controversial `DateTime` class, which has a huge feature intersection but almost no compatibility with core `Time` class;
* Date parsing functionality (`Date._parse`), which is also used by `lib/time`.

The latter also leads to a really confusing situation, where one of the core Ruby classes has "optional additional functionality" in stdlib.

Overall, the situation looks pretty "dirty" (as in "dirty code"), and seems like needing improvement.

WDYT about this plan (for Ruby 2.5, for ex.):

* make `Date` and `Date._parse` parts of language core (with probably renaming `_parse` to something more readable, or even extracting something like `Date::Parser` module);
* merge `DateTime` and `Time` (while preferring `Time`s interface where possible);
* on the way, gather all requests/bugs from this tracker, related to dates and times parsing, representing and so on.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>