[Toybox] New tests for dirname and wc
Rob Landley
rob at landley.net
Mon Nov 26 09:28:14 PST 2012
On 11/25/2012 11:39:43 PM, David Seikel wrote:
> /me picks two things out of this long email to comment on.
I copied the whole thing because who knows how long ago the
conversation wandered off the list? It's easier for me to check the
list archive than to dig through the compost heap of my inbox, so I
like having toybox stuff copied here.
> > I've still got a couple todo items: allow space as a time
> > designator, allow , as a fraction indicator. (*shrug* Posix.)
>
> I would guess for those human languages that swap the usage of
> commas and periods as fraction / thousands separators.
I expect so.
Mostly I'm not bothering with that because it belongs at the GUI level:
we're not translating the names "sort", "touch", "kill", or "nice" to
other languages, why translate their arguments? It wasn't there for the
first 30 years of these tools, adds a large amount of complexity for a
relatively small amount of gain, changing the alphabetization of "sort"
broken more than one build when that suddenly happened, I'm not
competent to _test_ this so if I did implement it I'd have no way of
knowing if I'd done it right...
But if SUSv4 is going to require a synonym and it's easy to do, sure,
why not?
> <useless anecdote>
>
> In the SecondLife (SL) based virtual world work I do, the major clone
> of
> the server side is called OpenSim. OpenSim has the option of creating
> your virtual world from a disparate collection of sim servers run by a
> motley collection of random people. A sim is the basic unit of
> geography in SL, 256x256 meters, starting at 0 meters, and extending
> all the way up to entirely useless heights. So for instance, one sim
> server could be in USA, with the server itself set to the USA
> variation
> of English as it's locale, while another sim server could be in
> Denmark, with it's locale set to Danish.
>
> English and Danish are two languages where the use of commas and
> periods for fraction / thousands separator is swapped. OpenSim
> developers like to do crazy things, like use human readable wire
> protocols, coz they drink the "humans being able to read wire
> protocols
> that 99.999999% of the time only computers need to read is a great
> idea
> for the 0.000001% of the time that a human needs to read it to debug
> it"
> kool-aid.
I side with them on this: word size, endianness, alignment, padding,
how the compiler's decided to represent C bitfields this week, anything
to do with floating point representation...
That said, translating a wire protocol is nuts. The comma/period is
part of the protocol. You can say decimal numbers are represented by
"123!456" and if that's what you're doing just be _consistent_.
> Some of the things OpenSim sends as human readable wire
> protocol get filtered through the servers locale. Did I mention the
> OpenSim developers are crazy?
That is crazy, yes.
> The end result is that if you teleport from this Danish sim to that
> USA
> sim, the Danish sim says "send this avatar to a height of 20,123
> meters" (a little over 20 meters, a typical ground level), and the
> USA sim server thinks "Hmmm, 20 thousand meters high, OK" and tosses
> the
> poor avatar waaaay up in the air. There is never anything up that
> high, and the avatar has a loooong fall to the ground where they
> thought they where going.
>
> Getting commas and periods right is important for humans, computers
> should not care so much on the damn wire. Getting it wrong can be
> painful and messy.
The moral of the story is "pick one and be consistent". And I have.
I admit to a certain amount of discomfort going "the langauge I already
speak is coincidentally the standard for posix programming". This is a
decision in need of more defending than average.
That said, Linus Torvalds was born speaking Swedish, and learned
English to compute with. Ingo Molnar is hungarian. Pavel Machek's home
page even says http://atrey.karlin.mff.cuni.cz/~pavel/ "English is my
second language." The OpenVZ guys are in Moscow. Years back I handed
off BusyBox to Denys Vlasenko who is from the Ukraine, and uClibc is
currently maintained by Bernhard who was in Austria last I checked.
Mark Shuttleworth's from South Africa (although one of their 11
official languages is English so I dunno what he grew up speaking).
Marcelo Tosatti is from Brazil, Thomas Gleixner is German, VFAT
filesystem maintainer Ogawa Hirofumi is from Japan...
Outside of Linux: Guido Van Rossum is Dutch but Python development
occurs in english. Here's an interview with Ruby inventor Yukihiro
Matsumoto... in English:
http://www.youtube.com/watch?v=IGG4l_QEzog PHP inventor Rasmus Ledorf
was born in Greenland but tweets in English https://twitter.com/rasmus
There's a theme here. All these people picked a language to collaborate
in. Leveraging that theme to simplify the toybox code is kinda obvious.
But there's "simplifying" and then there's "not serving the users".
Still not sure where to draw the line, mostly waiting for people to
complain and thus volunteer to test stuff. :)
> > I can do a sysvinit. It would be really nice if there was SOME
> > standard, somewhere...
> >
> > Mostly I want to get a clear idea of the problem people are trying
> > to solve, and whether or not there's any installed base of expertise
> > out there I can leverage. (What are the expectations here? What do
> > sysadmins sit down and mangle today without having to learn new
> > stuff? I dunno, I need to talk to some sysadmins...)
>
> Long ago, for busybox, I did a Sys V init that tried to stick to what
> LSB said should be done. I can't recall why it was not accepted inte
> busybox. Possibly someone had done their own favourite style of init
> and Sys V init was not desired. shrugs
>
> It was described as "Clean room implementation of runlevel/init.d/SYS
> V
> init applets for busybox, aiming for LSB compliance."
>
> /me digs through his ancient projects ...
>
> http://urunlevel.sourceforge.net/ Oh ick that looks awful on a wide
> screen.
>
> If nothing else, it might provide one persons take on the LSB
> "standard", even if it was from seven years ago. One feature I added
> was the ability to write init "scripts" in C as well as the usual
> shell
> scripts. Toybox probably does not want that.
Not so much, no.
If sysv init is the way to go, writing one is easy enough. Working out
the correct design is generally the hard part, implementation is
comparatively trivial. (Of course you learn stuff during the
implementation that can affect the design. Something about plans not
surviving contact with the enemy. :)
Rob
More information about the Toybox
mailing list