On 04/22/2017 03:18 AM, Martin Schreiber wrote:
> On Saturday 22 April 2017 11:48:46 Graeme Geldenhuys wrote:
>> On 2017-04-22 10:37, Graeme Geldenhuys wrote:
>>> for the life of me I can't find that post.
>> Saying that, I did track down the Delphi blog post that sparked the
>> conversation on Google+ I'm looking for.
>>
>> https://web.archive.org/web/20170217114422/http://blog.marcocantu.com/blog/
>> 2017-february-delphi-linux-compiler.html
>>
> MSElang/MSEpas does not use basic datatypes with variable size. MSEpas has
> int8, int16, int32, int64, card8, card16, card32 and card64 which can be
> mapped to the traditional pascal type names as you like.
>
> Martin
Considering how many different architectures out there it is probably a 
wise choice to name types by size. I would. :-) Or maybe just two generic 
names followed by a bit size modifier like with C structures. That way you 
could use a 4 bit unsigned int where ever it might be convenient... not 
just in structures. The developer could "type" them too for type safety 
(type nibble = unsigned:4;).

However when I started with Delphi v1 & 2 (came as a bundle) you had size 
specific types like "Longint" and "ShortInt" and then the generic types 
like "integer" were mapped to the architecture /convenient/ types:

* Delphi 1 (16bit Win3x compiler) integer was 16bit signed (ShortInt).
* Delphi 2 integer was a signed 32 bit int (LongInt).

This was pretty much the norm for most compilers during the 16/32 bit 
transition. I still think its a good idea to have a type that shifts size 
based on architecture, for things like for loops you want to use the most 
machine efficient and its likely that the hardware is going to use a native 
size register regardless of whether you want less or not. Seems FPC lost 
site of this feature. I was surprised to read integer is always 32bit. I 
expected it to be Int64 on 64bit platforms.

And as you say, one could ifdef/type a platform convenient type if they so 
chose. But its nice if the compiler does that for you.


-- 
Sent from my Debian Linux laptop -- http://www.debian.org/intro/about

Jon Foster
JF Possibilities, Inc.
j...@jfpossibilities.com
541-410-2760
Making computers work for you!


-- 
Sent from my Debian Linux laptop -- http://www.debian.org/intro/about

Jon Foster
JF Possibilities, Inc.
j...@jfpossibilities.com
541-410-2760
Making computers work for you!

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
mseide-msegui-talk mailing list
mseide-msegui-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mseide-msegui-talk

Reply via email to