Recent

Author Topic: New "features" in Delphi XE8  (Read 17918 times)

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
New "features" in Delphi XE8
« on: June 19, 2015, 11:45:34 am »
The most breaking one being:

"LongInt and LongWord are now platform-dependent integer types."

See: http://docwiki.embarcadero.com/RADStudio/XE8/en/What%27s_New_in_Delphi_and_C%2B%2BBuilder_XE8
« Last Edit: June 19, 2015, 11:49:18 am by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: New "features" in Delphi XE8
« Reply #1 on: June 19, 2015, 11:59:02 am »
I think that means they started giving meaning to longint and longword (e.g. size_t) or something and the ABI of aarch64 made that 64-bit.

Still it is a bit silly, they'd better define a new type that more clearly reflected the meaning (like native* in the past). I read through the docs you reference, and couldn't really find any meaning there, so maybe the reasons are FM related, rather than compiler+rtl.

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: New "features" in Delphi XE8
« Reply #2 on: June 19, 2015, 12:45:26 pm »
Two new platform independent 32-bit integer types are introduced in XE8:
FixedInt: 32-bit signed integer type.
FixedUInt: 32-bit unsigned integer type.
FixedInt and FixedUInt ensure portability, better integration and interoperability with 32-bit and 64-bit platforms. These two new types ensure cross-language support between Delphi and C++ for your applications.

Frankly, I've lost the plot a bit with native, fixed, longint etc.
At least this one will break code. In that case, why not fix Native, integer and uint?
« Last Edit: June 19, 2015, 12:48:39 pm by Thaddy »
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

serbod

  • Full Member
  • ***
  • Posts: 142
Re: New "features" in Delphi XE8
« Reply #3 on: June 19, 2015, 01:27:22 pm »
Very bizzare decision to name ordinal integer as FixedInt.
Why not Int32/UInt32 (same, as Int64/UInt64)?

Leledumbo

  • Hero Member
  • *****
  • Posts: 8757
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: New "features" in Delphi XE8
« Reply #4 on: June 19, 2015, 03:07:33 pm »
It's embarcadero. If anders is still there, he won't do such a stupid backward compatibility breaking changes.

BeniBela

  • Hero Member
  • *****
  • Posts: 906
    • homepage
Re: New "features" in Delphi XE8
« Reply #5 on: June 19, 2015, 06:57:24 pm »
FixedInt?

Omg, I hope you are not going to add this crap to FPC

rtusrghsdfhsfdhsdfhsfdhs

  • Full Member
  • ***
  • Posts: 162
Re: New "features" in Delphi XE8
« Reply #6 on: June 28, 2015, 09:35:53 am »
How about GetTypeKind for generics? So i can actually know the type at compile time?

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: New "features" in Delphi XE8
« Reply #7 on: June 28, 2015, 11:01:44 am »
For that to work you need RTTI and ultimately a Tpersistent descendant I guess.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rtusrghsdfhsfdhsdfhsfdhs

  • Full Member
  • ***
  • Posts: 162
Re: New "features" in Delphi XE8
« Reply #8 on: June 28, 2015, 11:27:14 am »
That's resolved at compile time not runtime no need for RTTI...

Thaddy

  • Hero Member
  • *****
  • Posts: 14373
  • Sensorship about opinions does not belong here.
Re: New "features" in Delphi XE8
« Reply #9 on: June 28, 2015, 11:42:53 am »
In that case your suggestion doesn't add much  value.
is, as, cast, assignments will do the job.

Why would you want that? You KNOW the type because YOU compiled the code.
Object Pascal programmers should get rid of their "component fetish" especially with the non-visuals.

rtusrghsdfhsfdhsdfhsfdhs

  • Full Member
  • ***
  • Posts: 162
Re: New "features" in Delphi XE8
« Reply #10 on: June 28, 2015, 11:52:11 am »
Heh why? Because if the compiler knows the type at compile time it can inline better? An example is quicksort algorithm and other algorithms. THATS WHY!

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: New "features" in Delphi XE8
« Reply #11 on: June 28, 2015, 01:55:29 pm »
Two new platform independent 32-bit integer types are introduced in XE8:
FixedInt: 32-bit signed integer type.
FixedUInt: 32-bit unsigned integer type.
FixedInt and FixedUInt ensure portability, better integration and interoperability with 32-bit and 64-bit platforms. These two new types ensure cross-language support between Delphi and C++ for your applications.

Hmm, reading the C++ reference, then maybe they are comparable to our ctypes.cint and cuint then.  Maybe they are working on some arch where "C" int=8bytes or so.

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: New "features" in Delphi XE8
« Reply #12 on: June 28, 2015, 06:41:45 pm »
My I remind you of the history of integer:
integer was supposed to hold that amount of bits the the processor could handle with one register.
e.G: on 16-bit machine it was 16-bit
on 32-bit big endian it was 32-bit big endian
and 32-bit little endian it was 32-bit little endian.
exception were the 64-bitter where integer stayed 32-bit.
So ...
Maybe they introduced FixedInt to ensure not only the bit-ness but also the endian-ness of a stored variable.
But since most modern prozessors can switch their endian-ness I personally see no need for this.
it's just another def in my jedi.inc:
Code: [Select]
{$ifdef fpc}
type FixedInt=longint; //[EDIT]
{$endif}
;)

To me there are much more compelling things in Delphi which I still miss/haven't found in Lazarus.
e.G: Having a really good Project-Group-Management, to handle HUGE amount of Source-files, their test- and production-files (.lpi).
« Last Edit: June 29, 2015, 12:58:03 am by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: New "features" in Delphi XE8
« Reply #13 on: June 28, 2015, 07:33:45 pm »
My I remind you of the history of integer:
integer was supposed to hold that amount of bits the the processor could handle with one register.
e.G: on 16-bit machine it was 16-bit
on 32-bit big endian it was 32-bit big endian
and 32-bit little endian it was 32-bit little endian.
exception were the 64-bitter where integer stayed 32-bit.

Integer is the base integer type of Pascal. The connection to register is implied, but only because the calculations of the base type must be fast. And a x86_64 has 32-bit (sub-)registers too, so that is not the problem.

Those processors can't switch endianess, but some are agnostic to it, iow the wiring to the chipset/memory determines endianess.  Those processors can't switch endianess runtime.

If the types had an associated endianess, there would be directives {$endianess} or so to signal  and define such types.

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: New "features" in Delphi XE8
« Reply #14 on: June 28, 2015, 09:17:18 pm »
Integer is the base integer type of Pascal. The connection to register is implied, but only because the calculations of the base type must be fast. And a x86_64 has 32-bit (sub-)registers too, so that is not the problem.

Those processors can't switch endianess, but some are agnostic to it, iow the wiring to the chipset/memory determines endianess.  Those processors can't switch endianess runtime.

If the types had an associated endianess, there would be directives {$endianess} or so to signal  and define such types.
So we agree in the fact that integer, despite of it being a base-type of Pascal, changed it's representation over the years.
(I personally know, with BP7 and the ability/need  to write 32-bit-code I had to change a HUGE amount of code to be compatible to old data-files.)
With modern processors, I don't mean new representation of old architectures.
I am talking of ARM (e.G), Arcon did a good job designing this Beast. And ARM-processors are aware of endianess, and can act accordingly.
Emdarcadero just felt the need to introduce this new type.
About the x64 - I think you also got me wrong.
I am REALLY glad that integer stayed 32-bit for more than 20 years.
And I am also glad about that binary-datafiles are less important nowadays, thanks to CSV, XML and JSON (and lots of cheap storage-space ;) ).
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

 

TinyPortal © 2005-2018