[fpc-pascal] FPC + Mobile development: the String type
Michael Schnell
mschnell at lumino.de
Thu Jul 10 10:41:00 CEST 2014
On 07/10/2014 07:24 AM, Graeme Geldenhuys wrote:
> Is this issue the same for FPC? ie: is the String type zero based for
> mobile development?
>
While I (doing a lot of C) don't like the one-based String paradigm in
Pascal, I think it's absolutely horrible to introduce zero-based Strings
(other than pchar) and break a many years old tradition.
Moreover, IMHO it's an extremely nasty idea to introduce any difference
between a "Desktop" and a "mobile" language ! Do we want additional
incompatible "embedded", "multicore", ... or whatever language dialects ???
fpc (and Lazarus) have set out for arch and platform independence, and
thus the syntax (and the programming paradigms and - as far as possible
- the GUI widgets) need to compatible.
Even regarding the GUI, Lazarus does a great job trying to provide
compatible widgets for all supported platforms. (If some widgets are not
supported by a some platforms I don't mind if I just get an error message.)
Delphi does a very bad job on the compatibility front, not supporting
VCL Widgets on so called "mobile" platforms, to me seems unacceptable.
If you want "Firemonkey" as an alternate Widget Set to create a "fancy"
GUI, maybe more appropriate for "mobile" use (the hell knows why this is
supposed to be different on mobile vs Desktop, now as many mobile
devices provide a huge screen resolution), both Widget Sets (or a decent
part of the widgets) should be provided for any supported platform.
Anyway "forking" fpc in such a way seems catastrophic.
Regarding strings, there were several discussions to completely kill the
"index" syntax for a strings. As with an unknown encoding, the index
does not make much sense, and, with certain frameworks (such as CIL)
strings are unalterable and need to be recreated when modified (which
seems to make sense performance-wise in some cases). IMHO, killing the
index syntax would be more acceptable than modifying the meaning of a
"visible" index into a string under the hood.
-Michael
More information about the fpc-pascal
mailing list