On Tuesday, March 18th, 2025 at 1:40 PM, Chet Ramey via TUHS <tuhs(a)tuhs.org> wrote:
On 3/18/25 4:05 PM, Dave Horsfall wrote:
On Tue, 18 Mar 2025, Chet Ramey via TUHS wrote:
also,
related, I did find the original, wonderful, paper about
writing hello, world in x11: it was a compressed .ps; it
uncompressed fine but almost nothing I have could work with the .ps.
I have a pdf of that paper.
About five pages long, as I recall...
14.
Rosenthal, D., “A Simple X11 Client Program,” USENIX Winter Conference
Proceedings, pp. 229-242, Dallas, 1988
(the subtitle is "How hard can it really be to write "Hello,
World"?").
https://archive.org/details/1988-proceedings-winter-tech-dallas
If you agree that's the one we're talking about, I'll send it to Warren.
Chet
--
`The lyf so short, the craft so long to lerne.'' - Chaucer` Ars longa, vita
brevis'' - Hippocrates
Chet Ramey, UTech, CWRU chet(a)case.edu
http://tiswww.cwru.edu/~chet/
One thing this article doesn't address in my mind is what precisely is a given
user trying to achieve with a "Hello, World" application. On one hand is the
"Does my environment function" role in which I think their application may
have been a bit heavy handed for. In my mind this would amount to:
- Retrieve the display
- Create a window in it
- Map the window
- Loop to allow it to display
- Unmap the window
- Cleanup
With looping to display in particular being based on some non-specific
termination that could be as simple as a timer/countdown. After all, all I want
to know is can I build and run something targeting Xlib, all the rest is then
can I use specific feature of Xlib <xyz>, for instance, displaying text. Even
polling for keyboard events to perhaps catch an Esc press isn't really relevant
to the question of will a window map, display in the event loop, then unmap
when the event loop is terminated.
On the other hand, a "Hello, World" is often used as the least common
denominator application that allows text-based feedback to a user, thereby
facilitating using that display mechanism for feedback throughout ongoing
development. For instance, my minimal "Hello, World" for microcontrollers
tends to be just verifying I can drop a single character in the transmitter of
a UART and get that character back on the connected tty. Once I have such
a putc, I have my first debug mechanism.
Not intended as critique either, just some philosophical questions that
arose thinking about "what do I want to achieve" regarding a classic
"Hello, World" program.
They do touch on this in the article too but I think there is a tad bit lost
comparing the Xlib implementation to the use of printf. To quote:
These examples demonstrate that programming
applications using only the basic X library interface is
even more difficult and unrewarding than programming
UNIX applications using only the system call interface.
But some of the efficacy of this mention is lost without the comparison
being between "Hello, World" using nothing but syscalls. For instance
all the matters of getting the graphics context correct, color space,
resizing, etc. sound like concerns comparable to those far removed
from a printf() user by the tty driver, things like ioctl(), etc.
Nice read though. Obviously they touched on a philosophical question that
can continue to be kicked around in all sorts of ways.
- Matt G.