Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-22 Thread waldo kitty

On 1/22/2014 5:39 PM, Frederic Da Vitoria wrote:

2014/1/22 waldo kitty mailto:wkitt...@windstream.net>>

the string type is/was a 256 character array with the 0th (zero-th) element
containing the length of the string... this allowed one to immediately know
how many characters to read at once... it was much faster than iterating
thru the array looking for a nul byte as done in other languages...

it was quite innovative at the time and actually lead to the Hudson Message
Base format being developed by Adam Hudson of QuickBBS fame when he was in
high school (grades 10-12)... this message base format was the greatest
thing since sliced bread when it came out and many other BBS packages
adopted it because of its amazing speed and the large number of messages
that could be stored with it...


What was innovative?


the type, itself... it did not exist previously and if there was anything like 
it, it was written specially by coders needing... this is likely how it came to 
be included, too... i simply do not recall since that was what? some 35+ years ago?



Storing the length as byte 0? I believe old Basic had been doing it for
years  before. Basic is not a language I like, but still...


i don't know how BASIC (which BASIC??) did it... each implementation, like the 
various pascals, could do things their own way behind the scenes as long as the 
results were the same... witness FPC with what it does to achieve the same 
results as other pascal languages ;)


as for not liking BASIC, when i found TP and actually learned ASM, i left BASIC 
in the dust and never looked back... when i had to start writing dBase II code, 
it was like a huge step backwards to BASIC for me... i tended to write my dBase 
II code like i did my pascal code... going as low level as i could... oh well... 
that was then and dBase is not even around any more AFAIK...


--
NOTE: No off-list assistance is given without prior approval.
  Please keep mailing list traffic on the list unless
  private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-22 Thread Frederic Da Vitoria
2014/1/22 waldo kitty 

> the string type is/was a 256 character array with the 0th (zero-th)
> element containing the length of the string... this allowed one to
> immediately know how many characters to read at once... it was much faster
> than iterating thru the array looking for a nul byte as done in other
> languages...
>
> it was quite innovative at the time and actually lead to the Hudson
> Message Base format being developed by Adam Hudson of QuickBBS fame when he
> was in high school (grades 10-12)... this message base format was the
> greatest thing since sliced bread when it came out and many other BBS
> packages adopted it because of its amazing speed and the large number of
> messages that could be stored with it...
>

What was innovative? Storing the length as byte 0? I believe old Basic had
been doing it for years before. Basic is not a language I like, but still...

-- 
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-22 Thread waldo kitty

On 1/22/2014 1:00 PM, Jürgen Hestermann wrote:


Am 2014-01-22 07:41, schrieb leledumbo:

Jürgen Hestermann wrote

Realy?
But why that?
It cannot be negative.
Using integer instead of unsigned values reduces the possible (positive)
range
and produces such illogical (to me) compiler warnings.

Delphi compatibility and maximum data size limitation AFAIK (2 GB).



Sigh... all the bad things in FPC crept in from Delphi it seems...


it goes back much further than that... IIRC, Turbo Pascal was the first to 
introduce the string type... i don't remember if it was in TP1 or TP2... i do 
know if it was in TP3 because i was using them in my code then...



Why did they artifically limit the max number of array elements to 2^31when
it would have been very easy to have a maximum of 2^32 instead?


64k stack limitation is the first thing that comes to mind...

the string type is/was a 256 character array with the 0th (zero-th) element 
containing the length of the string... this allowed one to immediately know how 
many characters to read at once... it was much faster than iterating thru the 
array looking for a nul byte as done in other languages...


it was quite innovative at the time and actually lead to the Hudson Message Base 
format being developed by Adam Hudson of QuickBBS fame when he was in high 
school (grades 10-12)... this message base format was the greatest thing since 
sliced bread when it came out and many other BBS packages adopted it because of 
its amazing speed and the large number of messages that could be stored with it...


255 maximum areas
32k total messages
16M maximum size of message data file

in the days of 10M and new 20M hard drives, this was huge and message oriented 
BBSes sprung up all over the world along with evolving message oriented store 
and forward packet networks like fidonet, WWIVNet, RIME/PCRelay and others...


all because of the string type ;)

--
NOTE: No off-list assistance is given without prior approval.
  Please keep mailing list traffic on the list unless
  private contact is specifically requested and granted.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-22 Thread Sven Barth

On 22.01.2014 19:00, Jürgen Hestermann wrote:


Am 2014-01-22 07:41, schrieb leledumbo:

Jürgen Hestermann wrote

Realy?
But why that?
It cannot be negative.
Using integer instead of unsigned values reduces the possible (positive)
range
and produces such illogical (to me) compiler warnings.

Delphi compatibility and maximum data size limitation AFAIK (2 GB).



Sigh... all the bad things in FPC crept in from Delphi it seems...

Why did they artifically limit the max number of array elements to 2^31when
it would have been very easy to have a maximum of 2^32 instead?


You have to think back at that time. 64-bit was in the far future, on 
Windows you only had 2 GB RAM available to user mode (the 3GB switch was 
added with XP AFAIK). So you *could not* allocate more than 2 GB of RAM 
even if you wanted to. And you couldn't even reach that, because you 
still have other memory in use by the RTL.


The rest is history...

Regards,
Sven
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-22 Thread Florian Klämpfl
Am 22.01.2014 19:00, schrieb Jürgen Hestermann:
> 
> Am 2014-01-22 07:41, schrieb leledumbo:
>> Jürgen Hestermann wrote
>>> Realy?
>>> But why that?
>>> It cannot be negative.
>>> Using integer instead of unsigned values reduces the possible (positive)
>>> range
>>> and produces such illogical (to me) compiler warnings.
>> Delphi compatibility and maximum data size limitation AFAIK (2 GB).
>>
> 
> Sigh... all the bad things in FPC crept in from Delphi it seems...

... which is not true in this case.
- The unsigned types are something very unpascalish.
- Extended Pascal defines the result of length as integer
- Expressions like length(s)-1 are very common and would cause a lot of
trouble if length(s) would be unsigned.

> 
> Why did they artifically limit the max number of array elements to 2^31when
> it would have been very easy to have a maximum of 2^32 instead?

It is even easier to use a 64 bit OS in this case. Even more having a
data segment >2 GB might be a problem for 32 Bit OSes.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-22 Thread Jürgen Hestermann


Am 2014-01-22 07:41, schrieb leledumbo:

Jürgen Hestermann wrote

Realy?
But why that?
It cannot be negative.
Using integer instead of unsigned values reduces the possible (positive)
range
and produces such illogical (to me) compiler warnings.

Delphi compatibility and maximum data size limitation AFAIK (2 GB).



Sigh... all the bad things in FPC crept in from Delphi it seems...

Why did they artifically limit the max number of array elements to 2^31when
it would have been very easy to have a maximum of 2^32 instead?



___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-21 Thread leledumbo
Jürgen Hestermann wrote
> Realy?
> But why that?
> It cannot be negative.
> Using integer instead of unsigned values reduces the possible (positive)
> range
> and produces such illogical (to me) compiler warnings.

Delphi compatibility and maximum data size limitation AFAIK (2 GB).



--
View this message in context: 
http://free-pascal-general.1045716.n5.nabble.com/Strange-message-about-mixed-signed-expression-tp5718074p5718083.html
Sent from the Free Pascal - General mailing list archive at Nabble.com.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-21 Thread Jürgen Hestermann


Am 2014-01-21 18:43, schrieb Howard Page-Clark:

On 21/01/2014 17:33, Jürgen Hestermann wrote:

I always wondered why I get a compiler message for the following code
...

if i+length(M)

Length is declared in the compiler/RTL to return an integer result.


Realy?
But why that?
It cannot be negative.
Using integer instead of unsigned values reduces the possible (positive) range
and produces such illogical (to me) compiler warnings.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal


Re: [fpc-pascal] Strange message about mixed signed expression

2014-01-21 Thread Howard Page-Clark

On 21/01/2014 17:33, Jürgen Hestermann wrote:

I always wondered why I get a compiler message for the following code
...

if i+length(M)

Length is declared in the compiler/RTL to return an integer result.

Howard


___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal