[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::amiga_v1

Title:AMIGA NOTES
Notice:Join us in the *NEW* conference - HYDRA::AMIGA_V2
Moderator:HYDRA::MOORE
Created:Sat Apr 26 1986
Last Modified:Wed Feb 05 1992
Last Successful Update:Fri Jun 06 1997
Number of topics:5378
Total number of notes:38326

416.0. "C prettyprinters?" by ECC::JAERVINEN (I'm apathetic and I don't care.) Mon Mar 30 1987 13:35

    As I may finally jump into C programming (yeecchh! [no flames please])
    I wondered whether there are any C prettyprinters (formatters)
    available that run on Amiga (or could easily be ported). I tend
    to be very sloppy while writing code and have always relied on
    a formatter (having used one for pascal many years).
    
    I do have one for VMS but I have no sources.
    
        
T.RTitleUserPersonal
Name
DateLines
416.1Pascal, yeech! Flames please!BIZET::TENNYDave TennyMon Mar 30 1987 18:0616
>    As I may finally jump into C programming (yeecchh! [no flames please])

If you don't want flames, don't light a match.

>    I wondered whether there are any C prettyprinters (formatters)
>    available that run on Amiga (or could easily be ported). I tend
>    to be very sloppy while writing code and have always relied on
>    a formatter (having used one for pascal many years).

Death to quiche eating languages like Pascal !
Perhaps it's time to learn to type...

Hmm, it's getting warm in here.

	Dave        

416.2(-: The cold war becomes hot :-)SOFTY::HEFFELFINGERBored on BoardTue Mar 31 1987 00:597
    Woooosh!  The flames rise.
    
    Death to macho (ie. unreadable) C-esque languages.  Long live
    readability and strong typing.
    
    Sorry, I just had to,
    Gary
416.3More Gasoline Please, I am getting coldNAAD::SWARRLearner's PermitTue Mar 31 1987 01:2516
    
    [NO FLAME just a great deal of mirth]
    
    Let us all bow in homage to all those great (substitute big) ones out
    there who believe even the GREAT BOOK would be better, if only it had
    been written in C, How fitting, the only thing more obscure than a C
    program must be Sanscrit 
    
    Did you hear about the C programmer who thought structure was a
    place where you went to relieve yourself.
    
    Sorry .0 , no pretty printer but a lively discussion  of the relative
    merits of different programming languages ( substitute religion).
    Just to mention it, why give up Pascal -- just move over to Modula-2.
    
    The compiler sure is more reasonably priced than Lattice or Manx.
416.4lots of :-) faces hereSTAR::BANKSIn Search of MediocrityTue Mar 31 1987 01:4812
    Personally, I can't see getting excited about a PASCAL vs C vs MODULA
    vs BLETCH (oops.  I mean BLISS) war.
    
    Programming in high level languages is like masturbation via remote
    manipulator arm.  All the bother and none of the pleasure.  All
    dreamt up by people who were too afraid to program a computer. 
    Now we have all these really swell ways of putting our fingers all
    over the keyboard and sticking our faces into the CRT and looking
    real busy without really getting around to telling the machine what
    to do in any reasonable terms.
    
    If you want to tell the machine to do something, just tell it.
416.5XYZZY?ECC::JAERVINENI'm apathetic and I don't care.Tue Mar 31 1987 08:4014
    oops, looks like I used the wrong magic word... and not too helpful
    to find a prettyprinter, so we might turn this into a language-flaming
    note as well...
    
    I had a chance to try out TDI Modula but I wasn't too impressed by
    the compiler (though I have nothing against Modula as a language).
    But the compiler looked shaky (in fact I tried to compile two
    Modula prettyprinters; the compiler crashed on one, runtime hung
    without any error messages on the other). Besides the library supplied
    didn't even have RealIO...
    
    Well, I *do* like quiche, honestly, and about the only thing I miss
    from MS-DOS is Turbo-Pascal...
    
416.6BAGELS::BRANNONDave BrannonTue Mar 31 1987 23:368
    what?  no mention of FORTRAN for the masses....generations of
    computer hackers warped in their infancy by exposure to quiche
    too early in life, sigh..
    
    At least Basic knows how to use GOTOs for fun and profit.
    
    :-) dave
    
416.7SOFTY::HEFFELFINGERBored on BoardWed Apr 01 1987 01:0011
    Sorry that there probably will be no answer to the 'C' pretty-printer
    question, but a little light-hearted joking about languages can't
    hurt too much.  I agree that TDI's Modula leaves much to be desired.
    (An end to frequent guru visits, for instance. :-)  However, it's
    still my compiler choice, at least until something less macho comes
    along.  The rumored Turbo Pascal could be just the ticket for us
    computer wimps, provided it's done right.  It would be so nice to
    have an integrated, (read, slick) environment for programming like
    one can find on the Itty Bitties.
    
    Gary
416.8SQM::JMSYNGEJames M Synge, VMS Performance Anal.Wed Apr 01 1987 01:3513
	And the winner is...

	There is a pretty printer out there.  It is called CB (C Beautifier)
	and exists on most unix systems.  I don't have a public domain version
	I can post, but I'd guess that some group such as the C Users Group
	has a PD version in their library of hundreds of disks.  They advertise
	in Dr. Dobbs, and perhaps in Byte.

	Sorry, couldn't resist a straight answer after all the swill (oops!
	I mean philosophy/religion).

James
416.9LEDS::ACCIARDIWed Apr 01 1987 04:0111
    Regarding Turbo Pascal...
    
    I read a thread on Plink somewhere that referred to Borland porting
    TP to the Amiga...Borland is still taking the pulse of the Amiga
    market, but if you call them and express a desire for TP, they will
    record your name and request.  If enough people ask, I guess they'll
    do it.
    
    Personally, I feel a little silly about begging some software house
    to please make a title available for my poor Amiga, but what the
    hell, its only a phone call...
416.10ECC::JAERVINENI'm apathetic and I don't care.Wed Apr 01 1987 06:343
    Someone call for me? A transatlatic call would use up all the money
    I've been saving for my Amiga Turbo Pascal...
    
416.11An Amiga C PrettyprinterTLE::RMEYERSRandy MeyersWed Apr 01 1987 18:3473
I have a C prettyprinter for the Amiga called clist.  It has a two
minor bugs in it; I will try to get it fixed up an make it available
sometime over the next week.

This prettyprinter is owned by Digital Equipment Corp: It was developed
by an employee whose cost center was paying for its development.  I do not
believe that it would ever be turned in to a product, so there seems no
reason not to let employees use it own their home systems.

Clist currently runs on VMS, Ultrix, CPM, and the Amiga.  It is the most
powerful C prettyprinter I have ever seen.  Unlike C Beauty, which only
indents the lines of the program, clist actually will fix spacing of
tokens in the line and choose reasonable line breaks (it tries to break
lines at low precedence operators).  For example, this third place winner
in the obfuscated C contest:

a[900];		b;c;d=1		;e=1;f;		g;h;O;		main(k,
l)char*		*l;{g=		atoi(*		++l);		for(k=
0;k*k<		g;b=k		++>>1)		;for(h=		0;h*h<=
g;++h);		--h;c=(		(h+=g>h		*(h+1))		-1)>>1;
while(d		<=g){		++O;for		(f=0;f<		O&&d<=g
;++f)a[		b<<5|c]		=d++,b+		=e;for(		f=0;f<O
&&d<=g;		++f)a[b		<<5|c]=		d++,c+=		e;e= -e
;}for(c		=0;c<h;		++c){		for(b=0		;b<k;++
b){if(b		<k/2)a[		b<<5|c]		^=a[(k		-(b+1))
<<5|c]^		=a[b<<5		|c]^=a[		(k-(b+1		))<<5|c]
;printf(	a[b<<5|c	]?"%-4d"	:"    "		,a[b<<5
|c]);}		putchar(	'\n');}}	/*Mike		Laman*/


After being run through clist looks like this:

a[900];
b;
c;
d = 1;
e = 1;
f;
g;
h;
O;
main(k, l)
    char **l;
{
    g = atoi(*++l);
    for (k = 0; k * k < g; b = k++ >> 1)
	;
    for (h = 0; h * h <= g; ++h)
	;
    --h;
    c = ((h += g > h * (h + 1)) - 1) >> 1;
    while (d <= g) {
	++O;
	for (f = 0; f < O && d <= g; ++f)
	    a[b << 5 | c] = d++, b += e;
	for (f = 0; f < O && d <= g; ++f)
	    a[b << 5 | c] = d++, c += e;
	e = -e;
    }
    for (c = 0; c < h; ++c) {
	for (b = 0; b < k; ++b) {
	    if (b < k / 2)
		a[b << 5 | c] ^= a[(k - (b + 1)) << 5 | c] ^= a[b << 5 | c] ^=
		  a[(k - (b + 1)) << 5 | c];
	    printf(a[b << 5 | c] ? "%-4d" : "    ", a[b << 5 | c]);
	}
	putchar('\n');
    }
}					/*Mike          Laman*/


The style of output from clist is the recommended Kernigham and Ritchie
style.
416.12ECC::JAERVINENI'm apathetic and I don't care.Thu Apr 02 1987 06:097
    GREAT!!  CLIST is the one I have for VMS that I mentioned in .0
    - I just didn't have an idea where it comes from, whether the sources
    are available etc.
    
    PLEASE PLEASE make it available ASAP! I'll buy you a beer or six
    when you come to Munich...