Linux-Networking Digest #696, Volume #11 Sun, 27 Jun 99 20:13:54 EDT
Contents:
Re: Why not C++ (Johan Kullstam)
Re: Works now IP MASQ and Samba needs to work????? (Mike Parker)
Linux Drivers for Allied Telesyn AT2500 NICs ("Mike")
Re: Why not C++ (Bruce Hoult)
Logging into Novell Netware from Linux ([EMAIL PROTECTED])
Re: Why not C++ (Bruce Hoult)
Re: RH 6, doesn't load my NIC (lyte)
Re: Why not C++ (Nathan Myers)
Re: If I had a gun.... (Scott Sweeting)
Re: Linux Server Win95 client (lyte)
Re: Dial-up problems (lyte)
----------------------------------------------------------------------------
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
From: Johan Kullstam <[EMAIL PROTECTED]>
Date: 27 Jun 1999 17:20:37 -0400
[EMAIL PROTECTED] (Don Waugaman) writes:
> In article <[EMAIL PROTECTED]>,
> Johan Kullstam <[EMAIL PROTECTED]> wrote:
>
> [ referring to two code snippets to create a float matrix, in C & C++ ]
>
> >you forgot the freeing step. -- and the debug the memory management
> >step when you free the wrong thing or the right thing twice or forget
> >to free it at all.
>
> I take it that the above is your opinion of the C code, since the C++
> program suffers from none of these problems.
>
> > -- and the my memory is fragmented into oblivion
> >after all these malloc/frees so now my performance is losing hard.
>
> Which is as much a problem for the C code as for the C++ code, if not
> more so since schemes such as reference-counted objects is more
> difficult to implement in C.
yes. C and C++ because of explicit pointers preclude intelligent
memory management. you get reference counting, but you do not get
consolidation of older objects in the heap into contiguous memory.
and in C, mallocs tend to be rare. most C programs will malloc
everything they need right off the bat and keep hold of the memory
until they exit. however, C++ encourages more dynamic memory
exercising because its syntax hides the malloc/free somewhat.
> >the memory fragmentation problem pretty much precludes seriously using
> >C++ for kernel work.
>
> I don't think that memory fragmentation is worse in C than in C++.
> It's true that some features of C++ can cause programmers to use
> dynamic memory more than in C. but that's an attribute of the use of
> the language, not of the language itself.
>
> What it means is that in areas where memory fragmentation is an issue,
> you'll have to be very careful about how you manage memory. This is
> an issue in C programs as well, of course. The difference is that you
> can use C++'s features to more easily move between different methods
> of memory and fragmentation management.
in eg lisp you let your vendor take care of this for you.
> For example: collection templates in the C++ Standard Library take an
> "allocator" template parameter, which means that you can substitute in
> your own memory allocator if the built-in one isn't acceptable for your
> needs. This is part of what makes the C++ SL a rather robust design -
> and something that can't be done without C++'s substantial template
> support.
is `alloca' a valid `allocator'?
> A good designer will build something that is flexible and reusable - a
> poor one will create a mess. You've probably seen more C++ messes than
> C messes because there are fewer good C++ designers, largely because it
> takes a lot longer to become a good C++ designer. I don't mention this
> as a strength of C++ - it's not - but it's not wise to blame the tool
> for the poor hand that wields it, either.
>
> > look to microsoft for examples of C++ in action.
>
> You left out the phrase "poor use of" between "of" and "C++" in this
> sentence. Again, this is caused largely by libraries written by people
> with poor C++ design skills.
>
> >do you really mean that all this C++ incantation is somehow easier
> >than
> >
> > (let ((vec (make-array nelems :element-type single-float)))
> > ...)
> >
> >and then letting the garbage collector reap the results?
>
> Syntactically, I'd consider this to be about equal in complexity to
> the previous examples. However, the previous examples do clean up
> the vector when done, though you seem to be asserting the contrary
> in your last line.
>
> >C has the benefit of being rather lightweight and efficient. C++ can
> >be efficient when it comes to execution speed, but it is tedious to
> >program in resulting in poor development speed and poor
> >maintainability.
>
> I consider C++ to be a heck of a lot less tedious for programming than
> C, and the programs I write are done faster and are more easily
> maintained - though at least in part because C++ makes me think about
> the design more.
>
> >after using lisp's macros i don't know whether to laugh or cry when i
> >think of C++ templates.
>
> Could you describe what you don't like about C++ templates, and how a
> statically-checked language that intends to minimize runtime cost could
> do better?
static type checking has nothing to do with anything. imho it's a
negative. static types are more a disadvantage the larger and more
complex a program gets.
C++ doesn't have insignificant runtime costs. when you buy into the
complexity that C++ offers you, i think a more heavyweight language is
in order.
for example, here's a little macro i made in lisp
;; grouping function
(eval-when (:compile-toplevel :load-toplevel)
(defun group (source n)
(if (zerop n) (error "zero length"))
(labels ((rec (source acc)
(let ((rest (nthcdr n source)))
(if (consp rest)
(rec rest (cons (subseq source 0 n) acc))
(nreverse (cons source acc))))))
(if source (rec source nil) nil))))
;; setf helper
(defmacro _f (op place &rest args)
(multiple-value-bind (vars forms var set access)
(get-setf-expansion place)
`(let* (,@(mapcar #'list vars forms)
(,(car var) (,op ,access ,@args)))
,set)))
(defmacro asetf (&rest implicit-pairs)
;; unroll for multiple pairs
`(progn
,@(mapcar (lambda (pair)
`(_f (lambda (it)
(declare (ignorable it))
,(cadr pair))
,(car pair)))
(group implicit-pairs 2))))
in lisp assignment is done with setf
(setf foo 3)
is (roughly) equivalent to C
foo = 3;
now, i liked C's += -= &c operators. but how to do it in lisp? well,
there are incf and such, but i wanted something bigger. immagine a
an operator called _= where on the right hand side _ would be the left
hand side.
x _= foo(_);
would be the same as
x = foo(x);
this is not terribly important when x is just a variable, but if the
left hand side is complex and involves much pointer chasing like
x->y->z->w[5] then having a way to reference it would be a win.
x->y->z->w[5] _= fabs(_);
could perform
x->y->z->w[5] = fabs(x->y->z->w[5]);
the first is more clear imho just like += and friends.
with the lisp macros i made
(asetf foo (abs it))
is equivalent to
(setf foo (abs foo)).
whether asetf or _= are worthwhile ideas is not my point. my point is
that in lisp you *can* make an asetf. in C++, no matter what
templates you have, you cannot create a new operation like _=.
also note that in the definition of asetf i used a lisp function
group. how do you invoke C++ functions to help you expand a C++
template? what about functions which are 99% the same but differ in
one spot. how can you make an template-if which could invoke the
right part based on the type or some aspect of the type being passed?
consider a min function in C++ that you wish to templatize
template <class X>
X min(
X a,
Y b)
{
return a < b ? a : b;
}
how do you use this for classes for which < is not defined? how would
you substitute another definition of < if two less-than concepts would
make sense for a certain class? perhaps you could pass a function.
but now < and the alt_less_than function would take different syntaxes
and hence not work like
min(a,b,<) and min(a,b,alt_less_than)
--
J o h a n K u l l s t a m
[[EMAIL PROTECTED]]
Don't Fear the Penguin!
------------------------------
From: Mike Parker <[EMAIL PROTECTED]>
Crossposted-To: linux.redhat.install
Subject: Re: Works now IP MASQ and Samba needs to work?????
Date: Sun, 27 Jun 1999 23:31:21 +0100
Reply-To: Mike Parker <[EMAIL PROTECTED]>
Follow Ups trimmed.
In article <[EMAIL PROTECTED]>, Scott
<[EMAIL PROTECTED]> writes
>Read the IP Masq Howto, and goto http://ipmasq.cjb.net
>
>Matt Goebel wrote:
>>
>> Thanks guys for all the info. I got my cable modem working now. All I need
>> was to call Mediaone and have them change the MAC to that of the card in my
>> Linux box, set it to use DHCP, and install the pump patch. Works great now.
>> I've also got my 2nd network card in the Linux box to work. Now I need help
>> getting my other machines (Windows 98) to use it as a gateway to the
>> internet via IP Masq. Since I'm using Redhat 6 (kernel 2.2.5) I think
>> support for this is built in and I won't need to recompile the kernel?? I
>> also need to get Samba to work. At the moment all I can go with the 2nd NIC
>> is ping the other machines and vice versa.
>> Nick <[EMAIL PROTECTED]> wrote in message
>> news:eRW13.14267$[EMAIL PROTECTED]...
>> > > The version of pump supplied with 6.0 does not work with roadrunner. At
>> > > least I have found this to be so. The updated version does work. You can
>> > > either get the updated version of pump or edit '/etc/resolv.conf'. I bet
>> > > if you look at /etc/resolv.conf you won't see your nameservers, only the
>> > > word search. Hope this helps.
>> >
>> > I used RH6 to do a complete install and during initialisation I set it to
>> > configure dhcp for RoadRunner. It worked first time and all I needed
>> > to add was a default gateway route to the routing table. Use linux-conf
>> > for this.
>> >
>> > Nick
>> >
>> >
>
--
Mike
Every one is more or less mad in their own way.
------------------------------
From: "Mike" <[EMAIL PROTECTED]>
Subject: Linux Drivers for Allied Telesyn AT2500 NICs
Date: Mon, 28 Jun 1999 10:59:04 +1200
Hi
I need Linux drivers for the Allied Telesyn At 2500 and or AT2700 nics.
Has anyone used an AT 2500 nics with Linux.
Mike
------------------------------
From: [EMAIL PROTECTED] (Bruce Hoult)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
Date: Mon, 28 Jun 1999 10:54:37 +1200
In article <[EMAIL PROTECTED]>, Johan Kullstam
<[EMAIL PROTECTED]> wrote:
> > > on the other hand, common-lisps like CMUCL can acheive near C or
> > > fortran execution speed. speed is not exclusively the domain of the
> > > C-like languages.
> >
> > I agree. The biggest problem with this is that Common Lisp is limited by
> > things such as the lack of type (and other) declarations which would
> > otherwise allow the compiler to generate even better code in many
> > situations.
>
> this is simply not true. lisp *has* types. lisp *has* type
> declarations. just because the langauage doesn't require explicitly
> declaring them everywhere doesn't mean it will not let you specify
> type and optimize accordingly.
Yes I *know* Lisp has type declarations. See the "(and other)" above.
Does CMUCL have a way of declaring that a certain class will never have
subclasses added? Does CMUCL have a way of declaring that a certain
generic function will never have methods added or removed?
If it doens't then how can it optomise this call? Some other bit of code
may change what "+" means at runtime.
-- Bruce
------------------------------
From: [EMAIL PROTECTED]
Subject: Logging into Novell Netware from Linux
Date: Sun, 27 Jun 1999 22:56:25 GMT
Greetings!
I have RH6.0 installed in my PC at work (default= Win95 on Novell
Netware) and I can currently access the internet over the firewall, but
I can't seem to figure out how to log into the network so I can access
the network file systems and printers. I have a complete set of IP
numbers, nameserver addresses, etc. for our network acquired through
various probing tools, but I don't want to go to sys admins for help,
since this is just a 'proof of concept' test that I'm doing on my own
time. How do you get to the equivalent of the Novell Netware login
screen on Win95? Any help will be greatly appreciated!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
From: [EMAIL PROTECTED] (Bruce Hoult)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
Date: Mon, 28 Jun 1999 10:59:14 +1200
In article <QGtd3.4830$[EMAIL PROTECTED]>, [EMAIL PROTECTED] wrote:
> In comp.os.linux.development.system Nathan Myers
<[EMAIL PROTECTED]> wrote:
> : Linus Torvalds <[EMAIL PROTECTED]> wrote:
> :>Bruce Hoult <[EMAIL PROTECTED]> wrote:
> :>
> :>But what others are saying is "a lot of existing C++ compilers generate
> :>worse code than a lot of existing C compilers". And they are right too.
> :>
> :>Sometimes theory matters. Sometimes it doesn't. The world is not as
> :>simple as you make it out to be.
>
> : Enough generalities. Take for example Egcs. C and C++, same code
> : generator, same optimizer. The last time you tried g++ was years
> : and years ago. It's time to look again.
>
>
> Using the latest egcs (from CVS) to compile a C program, with options
> '-fno-exceptions -fno-rtti -O2', the C assembler output is still
> smaller (in terms of # of instructions, not symbol length) while
> producing the same results.
>
> C++ is still slower and bulkier.
I don't understand. C compilers don't have rtti and exceptions, so you're
clearly using a C++ compiler to compile C code. Cool.
Now, which C compiler are you comparing it against to say that "egcs
-fno-exceptions -fno-rtti -O2" is worse than it?
-- Bruce
------------------------------
From: lyte <[EMAIL PROTECTED]>
Subject: Re: RH 6, doesn't load my NIC
Date: Sun, 27 Jun 1999 19:17:34 -0400
==============7677FE8C8206D32D43BA2642
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Toky wrote:
> Everytime i load linux, in the Initalize eth0, it always says "delaying...."
> and FAILED....
> any sugestions?
> i have a D-link DFE-530TX PCI
Did you recompile the kernel to support the NIC in the first place? If youre
new to compiling kernels visit
http://www.thecomputergallery.com/redhat/kernel.shtml
Hope it works.
--
Joey Olson
#RedHat OnLine
http://www.thecomputergallery.com/redhat
==============7677FE8C8206D32D43BA2642
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
Toky wrote:
<blockquote TYPE=CITE>Everytime i load linux, in the Initalize eth0, it
always says "delaying...."
<br>and FAILED....
<br>any sugestions?
<br>i have a D-link DFE-530TX PCI</blockquote>
Did you recompile the kernel to support the NIC in the first place? If
youre new to compiling kernels visit <A
HREF="http://www.thecomputergallery.com/redhat/kernel.shtml">http://www.thecomputergallery.com/redhat/kernel.shtml</A>
<br>Hope it works.
<pre>--
Joey Olson <[EMAIL PROTECTED]>
#RedHat OnLine
<A
HREF="http://www.thecomputergallery.com/redhat">http://www.thecomputergallery.com/redhat</A></pre>
</html>
==============7677FE8C8206D32D43BA2642==
------------------------------
From: [EMAIL PROTECTED] (Nathan Myers)
Crossposted-To: comp.os.linux.development.apps,comp.os.linux.development.system
Subject: Re: Why not C++
Date: 27 Jun 1999 16:33:26 -0700
Johan Kullstam <[EMAIL PROTECTED]> wrote:
> if you malloc and free a lot of
>things of different sizes, then heap memory does get chopped up. there
>are little bits of free memory here and there. you cannot consolidate
>them. and when allocating you search around for these free holes.
>the typical C++ program does a lot of malloc and free. memory
>fragmentation does occur and it does cause performance loss.
Yes, fragmentation happens in some C++ programs. It also happens in C
programs that do the same work. In C++ you have more opportunities
to do something about it. Fragmentation doesn't happen in some
implementations of garbage-collected languages. OTOH, garbage-
collection is possible with C++ as well.
All variety of problems can arise coding in any language, for
any application. Problems that cannot be dealt with become language
problems. In that sense, fragmentation is not a C++ problem.
Hence, pointing to C++ and saying it suffers fragmentation problems
is FUD.
--
Nathan Myers
[EMAIL PROTECTED] http://www.cantrip.org/
------------------------------
From: Scott Sweeting <[EMAIL PROTECTED]>
Subject: Re: If I had a gun....
Date: Sun, 27 Jun 1999 16:26:13 -0700
> The win98 box is as follows:
> C:\arp -a
> No ARP Entries Found
> C:\type C:\windows\hosts.sam
> 127.0.0.1 localhost
> 192.168.1.2 tireiron.toughguys.org
> 192.168.1.254 arson.toughguys.org
Isn't hosts.sam the *sample* hosts file? Shouldn't it be renamed to
'hosts' or 'hosts.lm'?
------------------------------
From: lyte <[EMAIL PROTECTED]>
Subject: Re: Linux Server Win95 client
Date: Sun, 27 Jun 1999 19:19:48 -0400
==============F881022DE94631FC39E8A442
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
DAVID M MCNAMARA wrote:
> I have connected my linux box to the internet , now how do i connect my 95
> box to the linix box so they can share the internet connection i'm using red
> hat 5
The regular IP Masquerading HOWTO might be a little confusing for you if youre
just a newbie to Linux. You can read a more down to earth guide on exactly what
to do to get your windows box surfing the net in no time, give it a try,
http://www.thecomputergallery.com/redhat/ipmasq.shtml
Cheers.
--
Joey Olson
#RedHat OnLine
http://www.thecomputergallery.com/redhat
==============F881022DE94631FC39E8A442
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
DAVID M MCNAMARA wrote:
<blockquote TYPE=CITE>I have connected my linux box to the internet , now
how do i connect my 95
<br>box to the linix box so they can share the internet connection i'm
using red
<br>hat 5</blockquote>
The regular IP Masquerading HOWTO might be a little confusing for you if
youre just a newbie to Linux. You can read a more down to earth guide on
exactly what to do to get your windows box surfing the net in no time,
give it a try, <A
HREF="http://www.thecomputergallery.com/redhat/ipmasq.shtml">http://www.thecomputergallery.com/redhat/ipmasq.shtml</A>
<br>Cheers.
<br>
<pre>--
Joey Olson <[EMAIL PROTECTED]>
#RedHat OnLine
<A
HREF="http://www.thecomputergallery.com/redhat">http://www.thecomputergallery.com/redhat</A></pre>
</html>
==============F881022DE94631FC39E8A442==
------------------------------
From: lyte <[EMAIL PROTECTED]>
Subject: Re: Dial-up problems
Date: Sun, 27 Jun 1999 19:22:10 -0400
==============2902D31E2F8066C80D1BDE21
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
John Tomlinson wrote:
> Hi
>
> If someone could help me with the following problem I would be most
> grateful, mainly because I'm going to take a sledgehammer to my machine if i
> don't solve it soon:
>
> I have recently installed Redhat Linux 5.1 on my machine with kernel 2.0.34
>
> Obviously one of the first things one wants to do is get online, ifconfig
> provides a supposedly straightforward way to configure the dialup ppp
> connection. Having configured everything and started usernet the damn thing
> doesn't work. Therefore we go to first principles and try to configure
> things properly:
>
> Using minicom I've tried logging in to my ISP to see if the modem is being
> initialised correctly and if I have to tell the machine at the ISP to start
> a ppp process:
>
> 1. Minicom is very, very slow.
> 2. I only get as far as sending my login and password then the connection is
> severed.
>
> I've checked the login sequence from windows using telnet and the login
> process is fast and the ppp process starts up automatically at the other
> end.
>
> Can somebody help me with this........
>
> Why is minicom so slow? (Indeed, why is seyon very slow as well?)
>
> I would prefer to get the dialup connection working myself, it's the best
> way to learn, but since I'm relatively new to LINUX/UNIX I need some help.
>
> Thanks
>
> John
>
> p.s. On a different note could someone confirm that my kernel supports ppp,
> when I type pppd at the prompt I get the gobbledygoop so I assume everything
> is fine in that dept.
Maybe you should give a chatscript a try. Check out PPP-UP on our site.
www.thecomputergallery.com/redhat/ppp.shtml
It comes with an easy to follow guide and shouldnt be a problem to set up.
Cheers.
--
Joey Olson
#RedHat OnLine
http://www.thecomputergallery.com/redhat
==============2902D31E2F8066C80D1BDE21
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
John Tomlinson wrote:
<blockquote TYPE=CITE>Hi
<p>If someone could help me with the following problem I would be most
<br>grateful, mainly because I'm going to take a sledgehammer to my machine
if i
<br>don't solve it soon:
<p>I have recently installed Redhat Linux 5.1 on my machine with kernel
2.0.34
<p>Obviously one of the first things one wants to do is get online, ifconfig
<br>provides a supposedly straightforward way to configure the dialup ppp
<br>connection. Having configured everything and started usernet the damn
thing
<br>doesn't work. Therefore we go to first principles and try to configure
<br>things properly:
<p>Using minicom I've tried logging in to my ISP to see if the modem is
being
<br>initialised correctly and if I have to tell the machine at the ISP
to start
<br>a ppp process:
<p>1. Minicom is very, very slow.
<br>2. I only get as far as sending my login and password then the connection
is
<br>severed.
<p>I've checked the login sequence from windows using telnet and the login
<br>process is fast and the ppp process starts up automatically at the
other
<br>end.
<p>Can somebody help me with this........
<p>Why is minicom so slow? (Indeed, why is seyon very slow as well?)
<p>I would prefer to get the dialup connection working myself, it's the
best
<br>way to learn, but since I'm relatively new to LINUX/UNIX I need some
help.
<p>Thanks
<p>John
<p>p.s. On a different note could someone confirm that my kernel supports
ppp,
<br>when I type pppd at the prompt I get the gobbledygoop so I assume everything
<br>is fine in that dept.</blockquote>
Maybe you should give a chatscript a try. Check out PPP-UP on our site.
www.thecomputergallery.com/redhat/ppp.shtml
<br>It comes with an easy to follow guide and shouldnt be a problem to
set up.
<br>Cheers.
<pre>--
Joey Olson <[EMAIL PROTECTED]>
#RedHat OnLine
<A
HREF="http://www.thecomputergallery.com/redhat">http://www.thecomputergallery.com/redhat</A></pre>
</html>
==============2902D31E2F8066C80D1BDE21==
------------------------------
** FOR YOUR REFERENCE **
The service address, to which questions about the list itself and requests
to be added to or deleted from it should be directed, is:
Internet: [EMAIL PROTECTED]
You can send mail to the entire list (and comp.os.linux.networking) via:
Internet: [EMAIL PROTECTED]
Linux may be obtained via one of these FTP sites:
ftp.funet.fi pub/Linux
tsx-11.mit.edu pub/linux
sunsite.unc.edu pub/Linux
End of Linux-Networking Digest
******************************