On Tuesday-201407-29, 19:29, Jarkko Hietaniemi wrote:
> to time functions than the C std library. (Which sucks on so many levels.)
If I may up the meta and muse some more on this subject: not just in
time functions, but in many places Perl historically has decided to
imitate closely the C std library or the nebulous 'UNIX'. (Which
roughly translates as Sun OS 4, BSD 4.2/4.3, when the mammoths and
Larry, roamed the land.) This was pre-POSIX and pre-SUS.
(Cue in multiple position-based arguments and return values, and of
course also wantarray.)
Of course Perl was kind of marketed as "system admin's C, C with less
core dumps", so let's give some design slack there.
This model of course broke as the glaciers melted. The POSIX module was
needed for all the new stuff, and for stuff that didn't fit in with the
old simpler stuff (the signals being the most horrifying example).
But even without POSIX happening things didn't map perfectly to even
other UNIXes: the uids/gids model were different between different
legacy UNIXes. The pwent fields, another mess: some new fields couldn't
be returned, some old fields weren't there.
By the time the _r variant hordes swept in, the old model was running to
the hills. And then there was this new kid on the block, Win32, which
sort of roughly could be mapped to 60% of UNIX/POSIX APIs... and
ActiveState rode into the town, sheriff Sarathy leading.
Hindsight is of course easy, but maybe reimplementing low-level APIs as
high-level APIs is not the best idea.