[comp.sys.amiga.programmer] 20 byte "Hello World" program.

Michael_Kelly@61ssc1.ceo.dg.com (02/27/91)

Would somebody like to define the difference between a 'program' and
a 'script'?
It seems to me that setting the Shell prompt to "Hello World" does 
not satisfy the requirement for a 20 byte program to display that 
string, neither does 'echo "hello world"' etc.
Then again, I could be wrong!
Just a thought....
Michael.

dillon@overload.Berkeley.CA.US (Matthew Dillon) (02/28/91)

    How about somebody post a 20MB "Hello World" program instead !8-)

					-Matt

--

    Matthew Dillon	    dillon@Overload.Berkeley.CA.US
    891 Regal Rd.	    uunet.uu.net!overload!dillon
    Berkeley, Ca. 94708
    USA

cedman@golem.ps.uci.edu (Carl Edman) (03/01/91)

In article <dillon.4433@overload.Berkeley.CA.US> dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
       How about somebody post a 20MB "Hello World" program instead !8-)

                                           -Matt

Well, that would be a trivial task if only we had the right tools
available: SmallTalk and X-Windows. :-)

        Carl Edman



"We hold that what one man cannot morally do, a million men cannot
morally do, and government, representing many millions of men, cannot
do." -- Auberon Herbert
          Send mail to Carl Edman <cedman@golem.ps.uci.edu>

epa@phobos.cis.ksu.edu (Eric P. Armstrong) (03/01/91)

dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:


>    How about somebody post a 20MB "Hello World" program instead !8-)

>					-Matt

That one could get you killed or your account yanked.

----
Eric Paul Armstrong                     Kansas State University 
   Bitnet:  ericpaul@ksuvm.bitnet  Internet: epa@phobos.cis.ksu.edu  

ckp@grebyn.com (Checkpoint Technologies) (03/01/91)

dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
>    How about somebody post a 20MB "Hello World" program instead !8-)
>
>					-Matt

#include <stdio.h>

static char hello[20971520] = "Hello World";

int main(int argc, char **argv) {
	printf(hello);
	exit(0);
}

(Sorry, I don't have a machine I can test this on...)
-- 
First comes the logo: C H E C K P O I N T  T E C H N O L O G I E S      / /  
                                                                    \\ / /    
Then, the disclaimer:  All expressed opinions are, indeed, opinions. \  / o
Now for the witty part:    I'm pink, therefore, I'm spam!             \/

djohnson@mbongo.ucsd.edu (Darin Johnson) (03/01/91)

In article <dillon.4433@overload.Berkeley.CA.US> dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
>
>    How about somebody post a 20MB "Hello World" program instead !8-)

OK, I don't have a 20MB one, but I had a 10MB one.  Unfortunately,
I haven't figured out how to get past rn without complaints
(If I can't get hello-world below 10MB, you expect me to be able
to figure out rn?)

And for you purists out there, the entire thing was coded in assembler,
except for those routines in Ada for which the extra size was important.
The algorithm roughly ran as follows:

  1) Name the program "hello-world".
  2) Include the string "xyzzy" as a string in the program.
  3) Implement a file-system handler and disk-driver, making full use of Ada
     rendezvous and exception handling facilities.
  4) Now search the file system for the "xyzzy" string.
  5) When found, back up through the data block list until you find
     the directory header.
  6) From the directory header, copy the name of the file onto the
     output, changing '-' to ' '.
  7) print a return, along with a system traceback.
-- 
Darin Johnson
djohnson@ucsd.edu
  - Political correctness is Turing undecidable.

cadp16@vaxa.strath.ac.uk (03/01/91)

In article <CEDMAN.91Feb28083422@golem.ps.uci.edu>, cedman@golem.ps.uci.edu (Carl Edman) writes:
> In article <dillon.4433@overload.Berkeley.CA.US> dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
>        How about somebody post a 20MB "Hello World" program instead !8-)
> 
>                                            -Matt
> 
> Well, that would be a trivial task if only we had the right tools
> available: SmallTalk and X-Windows. :-)
> 
>         Carl Edman
> 
> 
> 
> "We hold that what one man cannot morally do, a million men cannot
> morally do, and government, representing many millions of men, cannot
> do." -- Auberon Herbert
>           Send mail to Carl Edman <cedman@golem.ps.uci.edu>

There already is an X program that displays an animated world on the screen...

It takes up 10 Meg... (unexpanded)

You could run that, and while it is running say...

Hello

Hello

Hello



Well, ok, so its a Friday afternoon :-)

 
--------------------------------------------------------------------------------
Electric Monk~~~			      		/^^^\                
					     	       > o.o <              
Strathclyde University			      		\___/           
Computer Science			      		/ V \            
3rd Year				     	       <==+==>        
Amiga and X-Windows a speciality	    	      /       \       
					  	     ^^^U^^^U^^^     
--------------------------------------------------------------------------------

cedman@golem.ps.uci.edu (Carl Edman) (03/01/91)

In article <1991Mar1.061020.9083@grebyn.com> ckp@grebyn.com (Checkpoint Technologies) writes:
   dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
   >    How about somebody post a 20MB "Hello World" program instead !8-)

   #include <stdio.h>

   static char hello[20971520] = "Hello World";

   int main(int argc, char **argv) {
           printf(hello);
           exit(0);
   }

   (Sorry, I don't have a machine I can test this on...)

Sorry, I don't have a C-Compiler. Could you please post the UU-encoded
binary to this group ? I have to get this programm.

        Carl Edman


"We hold that what one man cannot morally do, a million men cannot
morally do, and government, representing many millions of men, cannot
do." -- Auberon Herbert
          Send mail to Carl Edman <cedman@golem.ps.uci.edu>

zap@lysator.liu.se (Zap Andersson) (03/02/91)

epa@phobos.cis.ksu.edu (Eric P. Armstrong) writes:

>dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:


>>    How about somebody post a 20MB "Hello World" program instead !8-)

>>					-Matt

Under Sunview you wouldn't possibly get it that small! Just the window
manager is 70Meg's. Sun rep's comment to that, when I asked him: "Disk is
cheap!"

>That one could get you killed or your account yanked.

Nah, need more than 20 Meg's to do that
to the guy we know as Matt
(Whata Rhyme, No Reason)

>----
>Eric Paul Armstrong                     Kansas State University 
>   Bitnet:  ericpaul@ksuvm.bitnet  Internet: epa@phobos.cis.ksu.edu  
--
* * * * * * * * * * * * * * * * *          (This rent for space)
* My signature is smaller than  * Be warned! The letter 'Z' is Copyright 1991
* yours!  - zap@lysator.liu.se  * by Zap Inc. So are the colors Red, Green and
* * * * * * * * * * * * * * * * * Greenish-yellow (Blue was taken by IBM) 

d0nostro@dtek.chalmers.se (Henrik Alteborn) (03/02/91)

In article <dillon.4433@overload.Berkeley.CA.US>, dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
|> 
|>     How about somebody post a 20MB "Hello World" program instead !8-)
|> 
|> 					-Matt
|> 

I'll see if I can shorten my 22MB version and fix the bugs, then I'll promise
to post it !!

Henrik Alteborn                 | -"I am Roger, the shrubberist"
d0nostro@dtek.chalmers.se       |           - Roger, the shrubberist.

cedman@golem.ps.uci.edu (Carl Edman) (03/03/91)

In article <peter.667941996@cutmcvax.cs.curtin.edu.au> peter@cutmcvax.cs.curtin.edu.au (Peter Wemm) writes:
   dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:

   >    How about somebody post a 20MB "Hello World" program instead !8-)
   >					-Matt

   I'll bite...

   how about

   #include <stream.h>
   void main()
   {
           cout << "Hello World" << '\n';
   }

   In GNU C++ this probably comes out about that big!!! :-) :-)

Only if you leave the debugging information in your g++ library.
Otherwise it is only about 100 kByte. :-)

        Carl Edman


"We hold that what one man cannot morally do, a million men cannot
morally do, and government, representing many millions of men, cannot
do." -- Auberon Herbert
          Send mail to Carl Edman <cedman@golem.ps.uci.edu>

peter@cutmcvax.cs.curtin.edu.au (Peter Wemm) (03/03/91)

dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:

>    How about somebody post a 20MB "Hello World" program instead !8-)
>					-Matt

I'll bite...

how about

#include <stream.h>
void main()
{
	cout << "Hello World" << '\n';
}

In GNU C++ this probably comes out about that big!!! :-) :-)

-Peter
--
Peter Wemm
------------------------------------------------------------------------------
peter@cutmcvax.cs.curtin.edu.au (if fails, try peter@cutmcvax.oz.au)

per@iesd.auc.dk (Per Langfeldt Hagen) (03/04/91)

>>>>> On 1 Mar 91 06:10:20 GMT, ckp@grebyn.com (Checkpoint Technologies) said:

> dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
>    How about somebody post a 20MB "Hello World" program instead !8-)
>
>					-Matt

ckp> #include <stdio.h>

ckp> static char hello[20971520] = "Hello World";

ckp> int main(int argc, char **argv) {
ckp> 	printf(hello);
ckp> 	exit(0);
ckp> }

It works :-). gcc -o hello hello.c
rho% ls -l hello*
-rwxrwxr-x  1 xputer   xputer   21068206 Mar  4 11:07 hello
-rw-rw-r--  1 xputer   xputer        128 Mar  4 10:44 hello.c

rho% hello
Hello Worldrho%

This was on a sun4. I will hurry and scratch the executable.

An other thing. I was surprised that it did not take any longer to
load the program:
rho% /usr/bin/time hello 
Hello World        1.5 real         0.0 user         0.2 sys

It (the sun4) could not have loaded the entire 20Meg in that time, so
it must be able to only load the necessary code and datasegments. This
would be nice to have on the Amiga!!!

/Per
I want an MMU.

ckp@grebyn.com (Checkpoint Technologies) (03/05/91)

In article <PER.91Mar4112733@omega.iesd.auc.dk> per@iesd.auc.dk (Per Langfeldt Hagen) writes:
>>>>>> On 1 Mar 91 06:10:20 GMT, ckp@grebyn.com (Checkpoint Technologies) said:
>
>> dillon@overload.Berkeley.CA.US (Matthew Dillon) writes:
>>    How about somebody post a 20MB "Hello World" program instead !8-)
>>
>>					-Matt
>
>ckp> #include <stdio.h>
>
>ckp> static char hello[20971520] = "Hello World";
>
>ckp> int main(int argc, char **argv) {
>ckp> 	printf(hello);
>ckp> 	exit(0);
>ckp> }
>
>It works :-). gcc -o hello hello.c
>rho% ls -l hello*
>-rwxrwxr-x  1 xputer   xputer   21068206 Mar  4 11:07 hello
>-rw-rw-r--  1 xputer   xputer        128 Mar  4 10:44 hello.c
>
>rho% hello
>Hello Worldrho%


S**t - forgot the newline.


I'll get started writing the spec for the revision. If I can push
through the funding for the change order, then maybe I can get it into
field testing sometime in early-mid summer, and maybe you'll see the
revised version published in time for xmas.  (These large programs sure
are a pain to maintain...)

:-)



-- 
First comes the logo: C H E C K P O I N T  T E C H N O L O G I E S      / /  
                                                                    \\ / /    
Then, the disclaimer:  All expressed opinions are, indeed, opinions. \  / o
Now for the witty part:    I'm pink, therefore, I'm spam!             \/