Sign in Join
Wiki copytemporary

Language related articles: what changed

Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.

Title: Language related articles

OldNewLine
1+Back to [[Compiler development articles]]
2+
3+For a better updated language support list, see also [[Delphi language features missing from the Free Pascal Compiler|Delphi language features which FPC does not have]].
4+
5+## Things FPC 2.x.x currently doesn't support
6+
7+- The "implements" style delegation. see ( <https://web.archive.org/web/20070806104804/http://info.borland.com/techpubs/delphi/delphi5/oplg/objintrf.html> )
8+- ~~dispinterface~~
9+- packages
10+- ~~slice (dynarray) <http://www.freepascal.org/bugs/showrec.php3?ID=2856>~~
11+
12+## Things FPC 1.9.x partially support
13+
14+- The more advanced variants support is missing or buggy (detail bugs, custom variants support missing, vararray stuff stil in development)
15+- currency support needs testing (there was some work done recently afaik)
16+- ~~Dynarrays, inclding Slice function seems to have problems~~
17+- Reintroduce; is only skipped not processed (at least the compiler says so)
18+ - im pretty sure that reintroduce just suppresses a warning in delphi Plugwash
19+ - According to the Delphi 2010 documentation reintroduce affects the behavior of a method when it's called from a object casted as his ancestor, if the method has overloaded the overloaded version is called else (when you use reintroduce) the original version of that method is called. Zazula 23:15, 8 September 2012 (UTC)
20+- [[Widestrings|widestrings]]. The default conversion routines for ansistring\<\>widestring only convert chars in the ascii (code points 0-127) range. The routines can be replaced through procvars but they are designed in a way that makes them useless for any local charset that doesn't have a 1:1 mapping to unicode.
21+
22+02:56, 1 Jan 2005 (CET)
23+
24+The heavily variants using package DECAL has been ported recently and worked fine. So I think the variants problems are mostly over, and only atypical conversions miss. (that can be usually fixed easily if you submit a bug with a simple example that works in Delphi and not in FPC). However some RTL support (the wrapper classes) are largely unimplemented
25+
26+## New in 1.9.x (not yet in the docs)
27+
28+- {\$fputype xxx) to select a certain fpu style or -Cfxxx on command line/cfg file
29+ - all: soft (not yet implemented)
30+ - i386: x87, sse, sse2
31+ - code compiled with sse uses the sse to do calculations with the single data type. This code runs only on Pentium III and above and AthlonXP and above
32+ - code compiled with sse2 uses the sse unit to do calculations with the single and double data type. This code runs only on PentiumIV and above and Athlon64 and above
33+ - x86-64: sse64
34+ - powerpc: standard
35+ - arm: libgcc, fpa, fpa10, fpa11, vfp
36+
37+- procedural property support (property outside a class with normal procedures as getters/setters.
38+- A -Fa parameter that lets you USES an unit as first unit in each unit. Great for e.g. redefining base types etc.
39+- reuse keywords imports all units the reused unit imports.
40+- reintroduce omits warning about hidden methods
41+- Some mac pascal extensions, see [[Mode MacPas]].
42+- `system.prefetch(const mem);` depending on the target processor the compiler generates a prefetch hint on the given memory location. On iA32 this is the sse instruction prefetchnta which is supported by Pentium3/AthlonXP and above. If the intruction set, selected with -Cp (on iA-32, prefetch instructions are generated for -Oppentium3 and above) doesn't support this instruction, no code is generated for prefetch.
43+- Interface type selection: The commandline switch -SI and the directive \$interfaces (possible values: corba and com) allow you to choose the type of interfaces which has no parent. Interfaces with parent inherit the style from their parent regardless of the currently selected interface type.
44+ - COM style interfaces work like Delphi interfaces: they inherit implicitly from IUnknown and they are reference counted.
45+ - CORBA style interfaces are neither ref. counted nor do they inherit from IUnknown.
46+
47+For new rtl related stuff have a look at [[New in the 1.9.x rtl (not yet in the docs)]].
48+
49+### SSE Usage
50+
51+To determine the supported instruction set, use the is_sse_cpu and is_sse2_cpu of the mmx unit. Because the sse code is usually faster than x87-fpu code, it's recommended to use these switches for heavy floating point calculations. If you want an application which runs on all fpu architectures, a possible solution is to put the code into an include file and include this file twice into your program: once compiled with e.g. -Cfsse2 and once without. Use the e.g. is_sse2_cpu variable to select the appropriate code:
52+
53+``` pascal
54+{$fputype x87}
55+procedure calc_x87;
56+{$i mymathcode.inc}
57+```
58+
59+``` pascal
60+{$fputype sse2}
61+procedure calc_sse2;
62+{$i mymathcode.inc}
63+```
64+
65+``` pascal
66+begin
67+ if is_sse2_cpu then
68+ calc_sse2
69+ else
70+ calc_x87;
71+end;
72+```
73+
74+## New in 2.0.x
75+
76+### UTF-8 support
77+
78+Support for utf-8 strings inside '...' has been added. The encoding can be either selected by passing -Fcutf8 on the command line, using the directive \$codepage utf8 or adding the utf-8 signature \$ef \$bb \$bf at the beginning of a file. Strings with chars\>=\$80 are converted to widestrings and handled internally as widestrings. Unicode chars \> 65535 can't be represented this way, this will cause an error message.
79+
80+## New in 2.1.x
81+
82+### Unaligned Keyword
83+
84+When typecasting a variable as "unaligned" you tell compiler that this variable should be read or write to one byte at a time.This is usefull on those systems that require aligned data accesses. This is currently only implemented on arm cpus.
85+
86+## Ideas for new stuff
87+
88+- [[Generics proposals]]
89+- [[Modernised Pascal]]
90+- [[Mac Local Procedure Parameters]]
91+- [[OpenMP support]]
92+- [[ThreadEvent]]
93+
94+---
95+*From the Free Pascal wiki, page "Language related articles", as it stood on 2022-09-22 after a change by SamB, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
96+Category: FPC

Back to history