The Cyber-Spy.Com Usenet Archive Feeds Directly
From The Open And Publicly Available Newsgroup
This Group And Thousands Of Others Are Available
On Most IS NNTP News Servers On Port 119.
Cyber-Spy.Com Is NOT Responsible For Any Topic,
Opinions Or Content Posted To This Or Any Other
Newsgroup. This Web Archive Of The Newsgroup And
Posts Are For Informational Purposes Only.
From: "John S. Dyson"
References: <firstname.lastname@example.org> <email@example.com> <firstname.lastname@example.org>
Subject: Re: Which basic compiler to buy?
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Date: Thu, 12 Dec 2002 00:46:30 -0500
NNTP-Posting-Date: Thu, 12 Dec 2002 00:38:40 EST
"Steve Andrew" wrote in message news:HeUJ9.3547$TC4.email@example.com...
> Frank Bemelman wrote:
> > "Dave_S" schreef in bericht
> > news:firstname.lastname@example.org...
> > [snip]
> >> To illustrate a point program the task of writting "hello world" in
> >> Qbasic and then write it in C. What is the executable size of each?
> >> Qbasic - maybe 10K
> >> C - at least 300K Hmmmmm - C was described as a fine edged scapel,
> >> why is the wound so big???
> > Don't forget the interpreter qbasic.exe that you need also. The C
> > program will be large (but smaller than 300K I'd guess) because the
> > rather complex code for the printf function will be linked in.
> Sounds like the whole of the stdio lib was linked in to me. The actual code
> to output a char using something like putch rather than printf would be
> minimal. MS were never known for producing granular libraries.
Alot of the 'fat' in C libraries is brought in as a result of multiple language
support routines (special characters, proper localized $/#, etc). This
happens especially egregiously when almost any
kind of serious standard I/O is invoked. Some systems will hide the
memory usage by using shared libs (that actually don't share as effectively
as people sometimes suspect also.)
Simple languages that only support limited multi-languages, or dynamically
load the libraries (therefore hiding the overhead away from the executable)
can seem alot more
memory efficient than the more complete languages and their libraries.
With C, you can produce VERY small programs, but it is important to
choose the libraries carefully. C++ is actually not that bad either, but
when being sloppy about using large libraries, and not being careful
about the C++ features used, then C++ can become notoriously fat.
(I am NOT advocating C++ in this discussion, but trying to explain
situations that can make program binaries larger than expected.)
A hello world, crafted as if it was on a microcontroller, can be built
for FreeBSD into an executable that is as small as the OS can use.
The standard libraries can be removed entirely, and system calls
like 'read' and 'write' can mitigate any such overhead. It is even
reasonable to build your own simple 'system libraries' to make the
binaries very small in general -- however, you might be missing some
of the advanced library features.
Rather than being religious by claiming that Basic is a language for
youngsters who know no better, or C cannot generate good code,
it is best to consider your available resources (programmer/platform),
and simply get the job done.
Go Back To The Cyber-Spy.Com
Usenet Web Archive Index Of
The sci.electronics.design Newsgroup