News for hackers. Stuff that matters.
Re:Things That Turbo Pascal Is Smaller Than (2011) by jll29 on Sunday November 15, 2026 @12:06PM (#50508542)
While some comparisons may look silly, the fact that the touch command's binary should exceed Turbo Pascal is insane: the command basically creates an empty file or updates the file change date if the file already exists, not more.

There's no reason (other than laziness) why that should take more than 2k.

On the other hand, a lot of boilerplace code is repeated in each and every command. When I first learned as a kid about UNIX commands being ordinary programs, I was intrigued (there is nothing "special" about them, you can also write your own!) but also shocked about the overhead compared to an architecture in which e.g. the shell contained all (at least core) commands compiled into a single binary, which could share all the error handing, startup code, command line parsing code and so on.

Re:Things That Turbo Pascal Is Smaller Than (2011) by teiferer on Sunday November 15, 2026 @12:29PM (#50508786)
Agree with everything you wrote, but if you go look for bloat on your storage device, the last thing that will be of any significance is that overhead.
Re:Things That Turbo Pascal Is Smaller Than (2011) by solyin on Sunday November 15, 2026 @06:52PM (#50512202)
The biggest the things on my disk are VMs , docker images, and then I don't care to bother.
Re:Things That Turbo Pascal Is Smaller Than (2011) by zahlman on Sunday November 15, 2026 @12:29PM (#50508795)
> the command basically creates an empty file or updates the file change date if the file already exists, not more.

GNU coreutils touch does a lot more than that. My local copy is about 95k; it allows for choosing from multiple different timestamps to update; suppressing the (default) creation of an empty file if it doesn't already exist; operating on symlinks directly rather than following them (if the system supports it); specifying a custom timestamp rather than "now" (including by parsing a date string), and of course outputting a help message and a version.

Re:Things That Turbo Pascal Is Smaller Than (2011) by regularfry on Sunday November 15, 2026 @12:50PM (#50508994)
I was going to suggest that even that logic wouldn't account for a binary size three times the RAM of my first machine, but from the man page:

> DATE STRING

> The --date=STRING is a mostly free format human readable date string such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". A date string may contain items indicating calendar date, time of day, time zone, day of week, relative time, relative date, and numbers. An empty string indicates the beginning of the day. The date string format is more complex than is easily documented here but is fully described in the info documentation.

There it is.

Re:Things That Turbo Pascal Is Smaller Than (2011) by Joker_vD on Sunday November 15, 2026 @02:19PM (#50509778)
You'd think they'd put this bullshit inside some .so where it could be reused by all other coreutils; but no, it's re-included in every GNU tool that deals with parsing dates.
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.
Re:Things That Turbo Pascal Is Smaller Than (2011) by mitxela on Sunday November 15, 2026 @07:43PM (#50512616)
then people would be complaining about .so dependency hell

2/5

Re:Things That Turbo Pascal Is Smaller Than (2011) by Joker_vD on Sunday November 15, 2026 @09:30PM (#50513306)
Well, guess we have to be grateful that Ulrich Drepper never really got around to mess with gnulib, unlike he did with glibc.

And the .so dependency hell is real. You try to build some older version of a certain language runtime, it complains that your libssl/libcrypt lacks the functions it needs (those functions were in 1.0.1f, but 1.0.1k dropped them because that's how semver works), and of course your distro doesn't have the older version of libcrypt packaged for it so you take the package from the previous version of your distro, and it complains that your libc is too new and segfaults. Well, you sure as hell ain't rolling your system's libc to an older version so you try to rebuild libcrypt from the source, but the build with default config/flags still doesn't satisfy this certain language runtime and oh my god why am I even wasting my time on this, "docker pull certain-language:ancient" it is. Yeah, sure, this image has essentially Ubuntu 14.04 inside of it but at this point IDGAF. Why can the same 6.16 kernel run the user space both from today and from ten years before it, but the userspace from today can't run the program from eight years ago?

Re:Things That Turbo Pascal Is Smaller Than (2011) by eterm on Monday November 16, 2026 @01:56AM (#50514818)
Better yet, in a completely different utility whose output could be piped into the parameter, but the lack of rich piping brings you back to parsing.
Re:Things That Turbo Pascal Is Smaller Than (2011) by unnah on Monday November 16, 2026 @03:25AM (#50515307)
I would hope that the date formats parsed by GNU touch would still be at a lower level of complexity than the dialect of Pascal supported by Turbo Pascal... but you never know until someone checks.
Re:Things That Turbo Pascal Is Smaller Than (2011) by II2II on Sunday November 15, 2026 @03:32PM (#50510410)
And how much of that feature-rich version touch is actual executable code?

I did a quick estimate by disassembling touch with objdump on macOS (163 kB executable), and it was approximately 6 kB (1500 instructions * 4 bytes/instruction). There is a lot more to an executable than executable code.

Re:Things That Turbo Pascal Is Smaller Than (2011) by zahlman on Monday November 16, 2026 @06:05AM (#50516254)
Interesting. What else did you find taking up the space?
Re:Things That Turbo Pascal Is Smaller Than (2011) by agumonkey on Sunday November 15, 2026 @02:42PM (#50509975)
I'd love to have a graph of gnu [core]utils growth over time. IIRC in Unix days, these simple utils were simple.. until they had to support various flags, and various hosts ..
Re:Things That Turbo Pascal Is Smaller Than (2011) by raddan on Sunday November 15, 2026 @03:33PM (#50510415)
If you run `strace` you can get a hint at why `touch` (and any modern, compiled C binary) might be big: it is doing way more than you think it does, and you definitely _want_ a lot of that. For example, any program that uses the C standard library needs to have that code available-- since virtually every C program is going to use it, it will be loaded and mmap'ped into some region of memory. The stack needs to be set up, memory protection bits will be set, a random value is read to be used as a stack canary, etc, etc. I count on the order of 50+ system calls.

Watching `mv` do its thing is even better. About 100 system calls, including playing nice with SELinux in case it happens to be installed, just to issue a single `renameat2` system call.

Don't forget that we're running on a 64-bit machine. MS-DOS in 1986 was a 16-bit machine? The word size on a modern machine is bigger because we have a bigger address space, more registers, and more instructions.

We want speed and security and convenience and pleasant error messages. All of this is put here by the compiler to ensure that we have nice things. It sounds awesome to have such a small Pascal compiler, and it makes the modern state of binaries seem bloated, but all those extra bytes are paying for things that we want. There's probably a little bloat, but really, there is not much bloat.

Re:Things That Turbo Pascal Is Smaller Than (2011) by cowlevel on Monday November 16, 2026 @04:38AM (#50515744)
Most of that startup code is handled by the shared loader, which is a separate executable (masquerading as a library) at /lib/ld-linux-something
Re:Things That Turbo Pascal Is Smaller Than (2011) by zvmaz on Sunday November 15, 2026 @04:43PM (#50511124)
> There's no reason (other than laziness) why that should take more than 2k.

I presume you know some of the intricacies of coreutils or the touch program. I'll probably go and donate to whomever receives donations for coreutils; it's the least I can do: Show some respect to the developers of these free and open source tools.

Re:Things That Turbo Pascal Is Smaller Than (2011) by mitxela on Sunday November 15, 2026 @07:43PM (#50512611)
The minimum size for a program is about 20k due to page alignment and sections. That's one page each for text, data, bss, rodata, and file headers that don't get loaded into memory at all.

1/5

Re:Things That Turbo Pascal Is Smaller Than (2011) by pron on Sunday November 15, 2026 @07:57PM (#50512728)
By "laziness", do you mean cost? Because there's been a ~30,000x inflation in RAM between 1986 and today, and what's silly is to ignore that 1GB of RAM has about the same impact on the machine as 20kB in 1986. Software back then (and even a decade later) was significantly more bloated than the "lazy" programs of today.
Re:Things That Turbo Pascal Is Smaller Than (2011) by lelanthran on Monday November 16, 2026 @02:33AM (#50515033)
> There's no reason (other than laziness) why that should take more than 2k.

Well...

     $ touch --help | wc -c
     1580
Just the text for the help message compiled into `touch` is over 1.5kB.

It's not just laziness, it's also what the program needs to do, like (for example) print out all the options it supports (1.5kB), then parse those options, execute a different code path depending on what the user wants to do, etc.

If all you want to do is update the date or create a new empty file, I can write a very short program that does that, although the minimum program in C is around 16kB (hello world), so that's the minimum overhead needed to have a C program loaded by Linux.