🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: rec.games.programmer
9 messages
9 total messages Started by Harold Iuzzolino Fri, 24 Jul 1992 17:19
Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
#178
Author: Harold Iuzzolino
Date: Fri, 24 Jul 1992 17:19
52 lines
2735 bytes
[Lots deleted]
>
>>I still like Pascal.  Everybody says, "it was originally intended only to teach
>>people how to program".  And I say, "so what?"  C apparently wasn't "good
>>enough" in it's original incarnation either.  Otherwise, why did they have to
>>come up with ANSII C and C++?  And C does sacrifice readability in favor of
>>flexibility.  The C "for" statement is especially weird; it's completely
>>different from "for" statements I've seen in any other language.
>
>pity about the pascal code generation ( pascal is EASIER to optimize than
>C, but no one (at least main-line compilers) seems to do it!!).compare
>output of your favorite pascal compiler with the same ( functionally ) code
>from MSC 6.0 (7.0??) or even watcom 9.0 ( with '486 code optimization ) and
>you will see what I mean..
>
[Mac pascal nuked]
>
>also.. I just love the ability to use the_variable<<=3; instead of ( I think )
>the_variable:=shl(the_variable,3);, which would not even be portable!!

the_variable:=(the_variable shl 3)

this is portable (at least to the amiga).  I have done it, I have proof,
I have programs that don't crash.  I have also seen Stony Brook's Pascal
(I own in it fact).  It is pretty good (optimization blows me away), but
I still like Turbo Pascal 6.0 better.  As I already optimize my code,
I don't need any compiler to do so.  (So I don't get flamed): This does
not mean that everyone can optimize their code.  Yes it is nice to
have a copmiler to do so.  Yes C does nicely.  However, if you guys
are going to go with optimization and libraries...how about Fortran (Puketran
to us)?  That is optimized, portable, and has millions of libraries.
(Ok, maybe not millions...but a lot).  Turbo Pascal is still the best 
language (I consider it to be a different language to normal Pascal) I
have ever used.  The only problem with it is the compiler limitations.
(i.e. that arrays have to be constant).  As far as I can tell, this
is the only thing that separates C from Pascal.  On a final note,
Pascal does have easier string handling and an ability to handle boolean
functions.

This is one nice thing about TP:

function BoolTest(x,y:byte): boolean;
begin
 ...
end;

begin
 if BoolTest(10,40) then InsertAnotherSpiffyProcedureNameHereIfYouWant;
end.
 

--Enh, so I forgot my sig...sue me.
<None>
#190
Author: sl8nl
Date: Sat, 25 Jul 1992 05:34
104 lines
3550 bytes
>>pity about the pascal code generation ( pascal is EASIER to optimize than
>>C, but no one (at least main-line compilers) seems to do it!!).compare
>>output of your favorite pascal compiler with the same ( functionally ) code
>>from MSC 6.0 (7.0??) or even watcom 9.0 ( with '486 code optimization ) and
>>you will see what I mean..
>>

Stony Brook compares quite favorably against these.  In fact, most of the code
is so compact, that even I, an code-optimizing freak :), had problems finding
things to optimize.

> I still like Turbo Pascal 6.0 better.  As I already optimize my code,
> I don't need any compiler to do so.  (So I don't get flamed): This does

I hand optimize my code, too, Mark.  Sometimes I use Stony Brook to turn
out assembly code so I don't have to write it.  Usually, it gets written
in straight assembly first, then thrown in to Pascal's inline assembly.
I generally don't like linking in .OBJ files.  Stony Brook handles them
wonderfully, but Turbo Pascal pukes on anything but procedure and 
function calls.

> (i.e. that arrays have to be constant).  As far as I can tell, this

The arrays don't have to be constant.  For instance:

type
  BArray = array[0..0] of Byte;

var
  B : ^BArray;
  NumElements : Integer;

begin
  Write('How many elements in the byte array: ');
  ReadLn(NumElements);
  GetMem(B,NumElements*SizeOf(Byte));
end;

This way, I can access B^[42] and B^[64000] quite easily...but I'll bet you
knew that and was referring to something else.

> is the only thing that separates C from Pascal.  On a final note,
> Pascal does have easier string handling and an ability to handle boolean
> functions.
> 
> This is one nice thing about TP:
> 
> function BoolTest(x,y:byte): boolean;
> begin
>  ...
> end;
> 
> begin
>  if BoolTest(10,40) then InsertAnotherSpiffyProcedureNameHereIfYouWant;
> end.

It does have easier string handling (hey, you C people, try doing this:
MyString := MyString + 'Hello' + MyString + ' Big String';  without using
C++ to generate a string operation class.), but C handles Boolean stuff
nicely, since the type casting isn't as strict.  For instance, the 
equivalent C procedure would have been:

char BoolTest(x,y)
unsigned char x,y;
{
  ...
}

main()
{
  if(BoolTest(10,40)) then InsertAnotherSpiffyProcedureNameHereIfYouWant;
}

One advantage of this is doing:

int IsThisTrue=1;

if(IsThisTrue) { ... }

In Pascal you'd have to typecast it:

const IsThisTrue : Integer = 1;

if Boolean(IsThisTrue) then begin ... end;


Don't get me wrong, Mark, I prefer Turbo Pascal over any of Borland's C
products: faster compile time, faster code, and smaller code.  But I wish
that Pascal were a bit less strict on its type casting.  I have a list of
what I'd want in the "perfect" language:

  C type casting.
  Pascal objects (C's multiple inheritance stinks!)
  The ability to perform ESP with the programmer.
  The ability to outguess the programmer on his/her next action.

OK, so it's far fetched.  I did like the game library idea:

  MakeGame(SPACE_GAME, WITH_LOTS_OF_WEAPONS, WITH_LOTS_OF_ALIENS ...

well, you get the drift.

Take care,
Josh
Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
#201
Author: James Woodgate
Date: Sun, 26 Jul 1992 05:47
54 lines
2266 bytes
In article <l1hmxkp@lynx.unm.edu> iuzzolin@carina.unm.edu (Harold Iuzzolino) writes:
[Tons of stuff deleted]
>This is one nice thing about TP:
>
>function BoolTest(x,y:byte): boolean;
>begin
> ...
>end;
>
>begin
> if BoolTest(10,40) then InsertAnotherSpiffyProcedureNameHereIfYouWant;
>end.
> 
This is simple to do in C.
I always include

#define True -1
#define False 0
typedef char bool
typedef unsigned char byte

then you can just say

bool BoolTest(byte x,byte y) {
...
}

...
  if (BoolTest(10,40)) {
    foo();
    }

I think it's pretty funny when people argue about Pascal and C, when
I consider them about the same.  I think an argument about C/Pascal
against Lisp/Prolog would be more fun.  I think the one BIG argument
for C is portability.  I just saw a post for a Ray tracer that works
with Amigas, Macs, IBM's, and Unices, all with the same source code.
You just can't do that Pascal.  I don't think that this necessarily
means that C is better, it just happened that C became the "portable"
language.  Why hasn't the US switched to Metric yet???  Is it because
our system is better, no, it just happened.  It's the same way
as HAYES-compatible modems, EPSON-printers, etc. One language/thing
gets accepted by a number of people, and then someone says, hey
lets make a "standard".  The original Unix could have been written
in Pascal, why not, then maybe someone would have said, hey lets make
a "Standard" Pascal that will work on any machine, it just didn't
happen that way... 


-- 
-----------------------------------------------------------------------
           -Linux Rules-                |
  -"I've been Dos free for 30 days      |
    now."-Former Dos Addict             | Address: woody@cs.utexas.edu
Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
#207
Author: Stuart Woolford
Date: Mon, 27 Jul 1992 00:59
73 lines
3382 bytes
iuzzolin@carina.unm.edu (Harold Iuzzolino) writes:

>[Lots deleted]
>>
>>>I still like Pascal.  Everybody says, "it was originally intended only to teach
>>>people how to program".  And I say, "so what?"  C apparently wasn't "good
>>>enough" in it's original incarnation either.  Otherwise, why did they have to
>>>come up with ANSII C and C++?  And C does sacrifice readability in favor of
>>>flexibility.  The C "for" statement is especially weird; it's completely
>>>different from "for" statements I've seen in any other language.
>>
>>pity about the pascal code generation ( pascal is EASIER to optimize than
>>C, but no one (at least main-line compilers) seems to do it!!).compare
>>output of your favorite pascal compiler with the same ( functionally ) code
>>from MSC 6.0 (7.0??) or even watcom 9.0 ( with '486 code optimization ) and
>>you will see what I mean..
>>
>[Mac pascal nuked]
>>
>>also.. I just love the ability to use the_variable<<=3; instead of ( I think )
>>the_variable:=shl(the_variable,3);, which would not even be portable!!

>the_variable:=(the_variable shl 3)

>this is portable (at least to the amiga).  I have done it, I have proof,
>I have programs that don't crash.  I have also seen Stony Brook's Pascal
>(I own in it fact).  It is pretty good (optimization blows me away), but
>I still like Turbo Pascal 6.0 better.  As I already optimize my code,
>I don't need any compiler to do so.  (So I don't get flamed): This does
>not mean that everyone can optimize their code.  Yes it is nice to
>have a copmiler to do so.  Yes C does nicely.  However, if you guys
>are going to go with optimization and libraries...how about Fortran (Puketran
>to us)?  That is optimized, portable, and has millions of libraries.
>(Ok, maybe not millions...but a lot).  Turbo Pascal is still the best 
>language (I consider it to be a different language to normal Pascal) I
>have ever used.  The only problem with it is the compiler limitations.
>(i.e. that arrays have to be constant).  As far as I can tell, this
>is the only thing that separates C from Pascal.  On a final note,
>Pascal does have easier string handling and an ability to handle boolean
>functions.

>This is one nice thing about TP:

>function BoolTest(x,y:byte): boolean;
>begin
> ...
>end;

>begin
> if BoolTest(10,40) then InsertAnotherSpiffyProcedureNameHereIfYouWant;
>end.
> 
well..I guess you beat C there.. in C you  would have to go:

int BoolTest(x, y)
	int x, y;
	{
	if(x==y) /* or whatever... */
		return 1; /* or use TRUE, with stdio included.. */
	else
		return 0; /* or use FALSE,        ''            */
	}

main()
	{
	if( Booltest(10,40) ) DoTheRealProgammerThing;
	}

-------------------------------------------------------------------------------
stuartw@ccu1.aukuni.ac.nz

			>>In VI Where Available<<
-------------------------------------------------------------------------------
Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
#213
Author: psrjd
Date: Mon, 27 Jul 1992 06:15
35 lines
1607 bytes
In article <1992Jul27.005952.4167@ccu1.aukuni.ac.nz>, stuartw@ccu1.aukuni.ac.nz (Stuart Woolford) writes...
>well..I guess you beat C there.. in C you  would have to go:
> 
>int BoolTest(x, y)
>	int x, y;
>	{
>	if(x==y) /* or whatever... */
>		return 1; /* or use TRUE, with stdio included.. */
>	else
>		return 0; /* or use FALSE,        ''            */
>	}

Not really.  You could do this just as easily:

	int BoolTest ( int x, int y ) {

	   return ( x==y )
	}

The value is returned based on the condition.  0 if false, greater than zero
(or just any non zero value?) if true.

> 
>main()
>	{
>	if( Booltest(10,40) ) DoTheRealProgammerThing;
>	}
> 
>-------------------------------------------------------------------------------
>stuartw@ccu1.aukuni.ac.nz
> 
>			>>In VI Where Available<<
>-------------------------------------------------------------------------------

Ray J., PSRJD@ACAD2.ALASKA.EDU
Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
#214
Author: n liu
Date: Mon, 27 Jul 1992 10:11
32 lines
1303 bytes
psrjd@acad3.alaska.edu writes:

>In article <1992Jul27.005952.4167@ccu1.aukuni.ac.nz>, stuartw@ccu1.aukuni.ac.nz (Stuart Woolford) writes...
>>well..I guess you beat C there.. in C you  would have to go:
>> 
>>int BoolTest(x, y)
>>	int x, y;
>>	{
>>	if(x==y) /* or whatever... */
>>		return 1; /* or use TRUE, with stdio included.. */
>>	else
>>		return 0; /* or use FALSE,        ''            */
>>	}

>Not really.  You could do this just as easily:

>	int BoolTest ( int x, int y ) {

>	   return ( x==y )
>	}

What about
#define BoolTest(a,b) ((a)==(b))

>>main()
>>	{
>>	if( BoolTest(10,40) ) DoTheRealProgammerThing;
>>	}
>> 
-- 
nyet@cco.caltech.edu
nyet@aerospace.aero.org
Re: TP or C ? (was: Languages to program in and ports and blah and etc...)
#229
Author: Stuart Woolford
Date: Mon, 27 Jul 1992 21:57
31 lines
1520 bytes
psrjd@acad3.alaska.edu writes:

>In article <1992Jul27.005952.4167@ccu1.aukuni.ac.nz>, stuartw@ccu1.aukuni.ac.nz (Stuart Woolford) writes...
>>well..I guess you beat C there.. in C you  would have to go:
>> 
>>int BoolTest(x, y)
>>	int x, y;
>>	{
>>	if(x==y) /* or whatever... */
>>		return 1; /* or use TRUE, with stdio included.. */
>>	else
>>		return 0; /* or use FALSE,        ''            */
>>	}

>Not really.  You could do this just as easily:

>	int BoolTest ( int x, int y ) {

>	   return ( x==y )
>	}

>The value is returned based on the condition.  0 if false, greater than zero
>(or just any non zero value?) if true.

Very true...but I was trying to make it simple for the Pascal people ;-)
( and I HATE ANSI headers !!!!!! )
-------------------------------------------------------------------------------
stuartw@ccu1.aukuni.ac.nz

			>>>>UNIX - and PROUD of it<<<<
-------------------------------------------------------------------------------
Re: <None>
#261
Author: GMM
Date: Wed, 29 Jul 1992 15:36
1 lines
438 bytes
What is Stony Brook?
Re: <None>
#271
Author: sl8nl
Date: Wed, 29 Jul 1992 23:20
9 lines
694 bytes
In article <36572@uflorida.cis.ufl.edu>, gmt@reef.cis.ufl.edu (GMM) writes:
> What is Stony Brook?

Stony Brook is a software company that does a lot of compilers.  Pascal+
a TP6 globally optimizing compiler is available from them.

Stony Brook Software
187 East Wilbur Road, Suite 9
Thousand Oaks, California 91360
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads