News for hackers. Stuff that matters.
Re:Things That Turbo Pascal Is Smaller Than (2011) by metaltyphoon on Sunday November 15, 2026 @02:35PM (#50509916)
This can’t be right is it?
Re:Things That Turbo Pascal Is Smaller Than (2011) by Joker_vD on Sunday November 15, 2026 @02:55PM (#50510090)
Yes, it can be. You can run `strings "$(command -v touch)"` yourself and then compare the output with the strings in parse-datetime.y [0]. Look for e.g. "FORTNIGHT", "sixth", and "error: parsing failed, stopped at '%s'", they're all inside the touch's executable.

[0] https://github.com/coreutils/gnulib/blob/master/lib/parse-da...

Re:Things That Turbo Pascal Is Smaller Than (2011) by darkwater on Sunday November 15, 2026 @03:39PM (#50510465)
But there ought to be some reason behind this that explains why that fence is there. No?
Re:Things That Turbo Pascal Is Smaller Than (2011) by shiandow on Sunday November 15, 2026 @04:54PM (#50511236)
Repeating the code is silly, but some degree of duplication in the binary makes sense. It's a basic size / latency trade-off.
Re:Things That Turbo Pascal Is Smaller Than (2011) by regularfry on Sunday November 15, 2026 @07:01PM (#50512279)
My first naive thought is never mind shared libraries, can touch just exec date when it has to?
Re:Things That Turbo Pascal Is Smaller Than (2011) by collinfunk on Sunday November 15, 2026 @04:56PM (#50511256)
It is correct. But only 'date' and 'touch' use it, so I am not sure how much benefit there is in making it a shared library.

If size is really a concern, we have supported building a single 'coreutils' binary since 2014, which will be more effective in saving disk space. It can be done with './configure --enable-single-binary'.

Re:Things That Turbo Pascal Is Smaller Than (2011) by Joker_vD on Sunday November 15, 2026 @05:28PM (#50511529)
> But only 'date' and 'touch' use it, so I am not sure how much benefit there is in making it a shared library.

There is also the rest of the whole "gnulib" folder inside the coreutils repo. Yes, I know that Gnulib explicitly states in the docs that it's a source code library but it doesn't bother to explain why exactly it chose to be that instead of being a .so à la glibc (beyond some rather unrelated "but supply chain attacks!" segment in the docs — if I cared about that, I'd statically link the relevant parts of glibc as well, in fact, that would be a much higher priority).

Re:Things That Turbo Pascal Is Smaller Than (2011) by collinfunk on Sunday November 15, 2026 @06:48PM (#50512161)
Read section 2.2 [1]. Each package that uses Gnulib maintains a list of modules that its program(s) requires. I.e., each package has a different library built as libgnu.a.

Gnulib also doesn't make API stability guarantees like shared libraries do. If a distribution installs Gnulib as a shared (or even static) library, and then links programs to that instead of the vendored sources, they will likely end up with broken programs.

[1] https://www.gnu.org/software/gnulib/manual/gnulib.html#Libra...

Re:Things That Turbo Pascal Is Smaller Than (2011) by Joker_vD on Sunday November 15, 2026 @09:14PM (#50513210)
Yeah, I've read the section of 2.2 in its entirety — nothing you said in your comment is in it.

Also, "Gnulib doesn't make API stability guarantees like shared libraries do" — a) do you mean ABI? b) why not? The gnulib seems like something that's perfectly suited to be a shared library, even more so than the glibc, since it's not a language runtime.

Re:Things That Turbo Pascal Is Smaller Than (2011) by collinfunk on Monday November 16, 2026 @12:46AM (#50514449)
For question A, both API and ABI. Question B is answered in the documentation.