Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[9fans] a quick and simple minded study of configure.

9 views
Skip to first unread message

ron minnich

unread,
Jun 15, 2007, 5:16:53 PM6/15/07
to
Plan 9 ports is portable to many systems. I did the following very
stupid command:
wc `find . -print | egrep
'Darwin|freebsd|FreeBSD|linux|Linux|power|386|NetBSD|OpenBSD|SunOS'`

I.e. just wc all the files that have a name that looks in any way os
or architecture dependent.

Note how unfair this is. It may count the same file twice, it counts
CVS, and so on. Very, very unfair.

Sum:
11219 34549 240528 total

Now, two popular MPIs:
first, LAM
rminnich@xcpu lam-7.1.3]$ wc ./configure
45815 164201 1362823 ./configure

Yes, that is not a typo: 45KLOC. The configure script is about 4x the
size of ALL the portability support in p9p. Makefiles are around 1029
lines. Most of that is configure goo.

For openmpi, a popular mpi:
[rminnich@xcpu openmpi-1.2.2]$ wc configure
152939 581569 5028307 configure
[rminnich@xcpu openmpi-1.2.2]$ wc Makefile
1541 5368 62023 Makefile
[rminnich@xcpu openmpi-1.2.2]$

Yes, 153KLOC of shell script for the configure. A factor of 3 growth
over the one done four years ago for LAM.

Yow. The generated makefiles average about 1500 lines. The configure
scripts take about 5 minutes to run.

I know we have some faculty on this list. Please talk to your students :-)

This is nuts.

ron

Francisco J Ballesteros

unread,
Jun 15, 2007, 5:20:36 PM6/15/07
to
>
> I know we have some faculty on this list. Please talk to your students :-)

I promise. That's impressive. Cannot believe it.
Thanks a lot for the info.

Rob Pike

unread,
Jun 15, 2007, 5:24:27 PM6/15/07
to
When porting the Plan 9 kernel to Sun, I struggled a bit with the MMU.
Someone offered to send me the code for Spring (I think) to help me
understand it. The relevant code was far bigger than the entire Plan
9 kernel code I was porting. It didn't help at all.

Dave Cheriton gave a talk, I think at the first OSDI, where he spoke
about a system he'd written. He said it was small, only 100K lines.
I said I considered that large; our kernel at the time was about 25K
lines and was far more complete than his research toy. "Yeah," he
said, "but those are Bell Labs lines." I took that as a compliment,
but he might not have meant it that way.

-rob

David Leimbach

unread,
Jun 15, 2007, 9:19:19 PM6/15/07
to
Heh. Reminds me of when I wrote an assembler as an undergrad in
college in C++ in 1200 lines. I was pretty impressed with myself at
the time till I saw my professor's 600 line version.

I think that's what got me into learning these higher level languages
and higher order functional programming languages - the desire to
write less code.

I'm pretty sure I'm not good at it yet but I always found this one
line. "word counter" impressive.

std::distance(std::istream_iterator<std::string>(std::cin),
std::istream_iterator<std::string>());

I think that's corect but I'm on my blackberry.

I think I got that from a newsgroup back in the 90s


--
- Passage Matthew 5:37:
But let your communication be, Yea, yea; Nay, nay: for whatsoever
is more than these cometh of evil.

Skip Tavakkolian

unread,
Jun 16, 2007, 12:40:26 AM6/16/07
to
> I'm pretty sure I'm not good at it yet but I always found this one
> line. "word counter" impressive.
>
> std::distance(std::istream_iterator<std::string>(std::cin),
> std::istream_iterator<std::string>());

it is impressive that you typed that on a blackberry!

it's not short, if you count the class implementation. it doesn't
convey the idea - the solution is not understood unless you
understand each piece.

i think what Ron is bringing up is having/learning the ability to
see through layers of filters to the exact need and providing a
design that is just the right distance between "pie in the sky" and
"failure of vision".

Bruce Ellis

unread,
Jun 16, 2007, 1:59:09 AM6/16/07
to
i've asked this before .. who are we hiding the imformation from?
you reap what you do sow (grunt). built your house on sand?

brucee

David Leimbach

unread,
Jun 16, 2007, 11:35:47 AM6/16/07
to
On 6/15/07, Skip Tavakkolian <9n...@9netics.com> wrote:
> I'm pretty sure I'm not good at it yet but I always found this one
> line. "word counter" impressive.
>
>  std::distance(std::istream_iterator<std::string>(std::cin),
> std::istream_iterator<std: :string>());

it is impressive that you typed that on a blackberry!

I'm not going to tell you that it was easy :-)
 

it's not short, if you count the class implementation.  it doesn't
convey the idea - the solution is not understood unless you
understand each piece.

I disagree, to the extent that it really is short, in that it's one line :-)

I agree as your point is 100% valid that if you don't know distance, istream_iterator, what cin is, and how it deals with "std::string", that you wouldn't know how to write that line, and you possibly wouldn't understand how it works.

But I suspect any person dealing with C++ has an idea how the STL and Standard C++ Library works.  What might still not be obvious is that that you need certain restrictions on iterators for STL to work (don't stable_sort on list iterators, as you probably need something with random access, not bi-directional iterators).  (ok that was a bit tongue-in-cheek)

No wonder there's so much money in C++ books  :-)   

i think what Ron is bringing up is having/learning the ability to
see through layers of filters to the exact need and providing a
design that is just the right distance between "pie in the sky" and
"failure of vision".

Yep, I was trying to point out that sometimes less code is more headache :-)

Of course when the plane door closes you have to shut off your phone so I don't think I got that across very well :-).

At any rate, I'm hoping that's NOT what was meant by "Bell Labs Lines"  :-)

Dave

Martin Neubauer

unread,
Jun 17, 2007, 3:07:30 AM6/17/07
to
* David Leimbach (lei...@gmail.com) wrote:
> it's not short, if you count the class implementation. it doesn't
> >convey the idea - the solution is not understood unless you
> >understand each piece.
>
>
> I disagree, to the extent that it really is short, in that it's one line :-)

So is

word_count(text);

And a much simpler one at that.

Uriel

unread,
Jun 17, 2007, 7:59:47 PM6/17/07
to
I was going mention that a 'word counter' is not two 'Bell Labs
lines', but two Bell Labs *characters*: wc

And the tools programming model trounces everything else once more.

uriel

P.S.: For http://gsoc.cat-v.org and http://9p.cat-v.org I wrote (with
the help of Kris) a whole website engine, including multi-domain
handling, a blog with rss feeds and and other junk in two hundred
lines of rc and awk. After this, thinking about building websites with
python or any other language makes me cringe.

David Leimbach

unread,
Jun 17, 2007, 10:26:43 PM6/17/07
to
No doubt about it

I wrote a soap client with nothing but curl perl and pipes glued with
a little sh

Took about 30 minutes and each piece does a very small and well
defined task. If it hadn't been soap based I would not have used
perl.

That's another reason why I like languages like limbo or erlang.
Seems to encourage breaking even serial problems into communicating
tasks. Then in some cases if you need to distribute the problem over
many machines you've got less work to do.

0 new messages