Re: [fpc-devel] Raw ARC objects preview

2016-11-08 Thread Michael Van Canneyt



On Tue, 8 Nov 2016, Jonas Maebe wrote:


On 08/11/16 21:44, Maciej Izak wrote:


One person from FPC core team suggested me to switch to C++/C# instead
of discussing with them.


Please quote me correctly.

I did not make this suggestion.

I said I am surprised that people feel the need to change pascal to look and
act like C++ or C#. This surprise not only concerns you, but many others.

I have voiced it many times on the mailing lists:
Why not simply use those languages if you want the features of those languages?

The "You" is meant impersonal in this question.

I also did ask for your personal motivation to use Pascal anyway - despite the
heavy discussions you experience with the core team, which must indeed be
demotivating - but in no way I meant the question as a suggestion to switch.

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


Re: [fpc-devel] Raw ARC objects preview

2016-11-08 Thread Jonas Maebe

On 08/11/16 21:44, Maciej Izak wrote:


One person from FPC core team suggested me to switch to C++/C# instead
of discussing with them.


Keep in mind that unless explicitly stated otherwise, everyone of us 
always speaks for themselves.



I am [..] problematic community member for
FPC core team.


I don't think you are.


More info about my reasoning:
https://plus.google.com/u/0/115782878581272923715/posts/gmeysvbJiZS


Just to clarify: it seems to indirectly suggest that Boian Mitov is part 
of FPC core, which he is not.


Regarding that we require large patches to be cleanly split: that is 
true (I guess you are referring to, a.o., my comment at 
http://bugs.freepascal.org/view.php?id=30687 ). Those are the standards 
we hold ourselves to as well. I understand that this can be 
demotivating, especially if you first already had to argue and wait 
quite a bit for it to be accepted in principle, but it is the only way 
to keep the compiler maintainable in the long run (and to avoid 
frustrations by other people that will work on the compiler after you/in 
addition to you).


In any case, I wish you the best of luck in your future endeavours, and 
am sorry it didn't work out.



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


Re: [fpc-devel] Can FPC at least give a hint/warning?

2016-11-08 Thread Gennady Agranov

Hi,


Or what are the conditions when you want to emit the hint?


I thought that hint could come from some layer that actually allocates 
the record - on the stack or on the heap - this layer may actually know 
the "effective" alignment


Heap allocation should be aligned to the largest required alignment (is 
it 8?) - i.e. it should relatively simple to validate that offset of 
some "double" field is properly aligned


I actually do not know how stack allocation works - i.e. when and how 
compiler aligns double, extended or record values (packed or unpacked)


So if in your opinion this hint would report too many false positives - 
case is closed :)


>>> if the bug is closed - is there any way to add a note to it?

Yes, I found this button after I have went to the URL again and 
inspected the available UI  more thorough :(

I did not want to send another e-mail to FPC list - that I have found it :)

Sorry about it,
Gennady
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Raw ARC objects preview

2016-11-08 Thread Maciej Izak
2016-11-08 17:56 GMT+01:00 silvioprog :

> NewPascal is now on my wishlist. :-)
>

Thanks. But sadly that was my last job for Pascal community.

One person from FPC core team suggested me to switch to C++/C# instead of
discussing with them. Time to start new adventure!  I am banned Delphi user
(thanks to Lars Fosdal) and problematic community member for FPC core team.

More info about my reasoning:
https://plus.google.com/u/0/115782878581272923715/posts/gmeysvbJiZS

Btw. You can test early (but working very well without regressions)
implementation of nullable types and smart pointers (examples and sources
attached):
https://github.com/maciej-izak/PascalSmartPointers

Compilable and runable with latest and last NewPascal release.

-- 
Best regards,
Maciej Izak
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Can FPC at least give a hint/warning?

2016-11-08 Thread Florian Klämpfl
Am 07.11.2016 um 03:42 schrieb Gennady Agranov:
> Hi,
> 
> I have submitted a bug - http://bugs.freepascal.org/view.php?id=30872 
> (misaligned data exception on
> ARMv7)
> 
> And this big was resolved as "won't fix"
> 
> 1. I understand that one has to work really hard to encounter this bug - and 
> there are easy
> workarounds, but it there are also different ways to resolve this bug - e.g. 
> just giving a hint
> would suffice - IMHO

While this is possible, if you - as said below - use packrecords 1, you will 
get a hint on every use
of such a cardinal as the compiler normally does not know the final address of 
a variable in a
program but only its alignment requirements. So even if a cardinal is the first 
element of a such a
record, the compiler cannot assume that this field is actually properly aligned 
because packrecords
1 relaxes also the alignment requirements of the whole record, so the record 
itself might be start
at an unaligned address. This makes imo such a hint useless. Or what are the 
conditions when you
want to emit the hint?

> 
> 2. All our units use {$PACKRECORDS 1} in order to be layout compatible with 
> Delphi and we always can
> add padding or change the field order - if only compiler warned us that field 
> is not properly
> aligned for the target platform...
> 
> 3. And a separate question - if the bug is closed - is there any way to add a 
> note to it?

You can reopen it to add the note.

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


Re: [fpc-devel] Raw ARC objects preview

2016-11-08 Thread silvioprog
On Tue, Nov 8, 2016 at 1:24 PM, Maciej Izak  wrote:

>
> 2016-11-08 17:02 GMT+01:00 silvioprog :
>
>> I need to test this new features soon... Can I use nextPascal on Linux?
>> (I'm using latest Xubuntu version)
>
>
> sure! try this: https://github.com/LongDirtyAnimAlf/Reiniero-fpcup/
> releases/tag/0.99
>
> Great tool made by Alf :)
>
> --
> Best regards,
> Maciej Izak
>

Awesome!

NewPascal is now on my wishlist. :-)

-- 
Silvio Clécio
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Raw ARC objects preview

2016-11-08 Thread silvioprog
On Tue, Nov 8, 2016 at 6:10 AM, Maciej Izak  wrote:

> I became outlaw (permanent ban) on Delphi G+ for this :D . Seems my work
> is serious danger for Delphi (single programmer can kill their business? I
> have no idea).
>
> ARC objects preview for newpascal.org (will be probably used for Delphi
> NEXTGEN mode in NewPascal). Fully compilable and backward compatible. Some
> work is still required (additional Delphi compatible interface, compiler
> magic and and few changes in RTL):
>
> https://github.com/maciej-izak/PascalSmartPointers/blob/
> master/examples/SmartObj01.pas
> https://github.com/maciej-izak/PascalSmartPointers/blob/
> master/sources/SmartObj.pas
>
> --
> Best regards,
> Maciej Izak
>

Great job!

I need to test this new features soon... Can I use nextPascal on Linux?
(I'm using latest Xubuntu version)

Thank you for sharing that with us! (y)

-- 
Silvio Clécio
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Can FPC at least give a hint/warning?

2016-11-08 Thread Mark Morgan Lloyd

On 08/11/16 10:26, Marco van de Voort wrote:

In our previous episode, Mark Morgan Lloyd said:

The Solaris and C communities appeared to take the line that a correct
compiler "could not" generate unaligned accesses, although they held off
clarifying whether "could" in that context means "if it does it's an
error" or "it must rearrange data to avoid an error".

I believe that Solaris and in some cases Linux can handle unaligned
accesses in the kernel, although there's obviously a significant
performance penalty.


I can remember the early powerpc ports where I came into trouble with the
NetBSD port because the Linux kernel used emulation to fix unaligned float
loads/stores, while NetBSD didn't.


I believe the Linux ARM kernel can intercept some alignment traps, the 
SPARC kernel can do something similar but only for kernel code (I don't 
know whether that will change with the current push to get Debian onto 
SPARC-64, it could be an artifact of the kernel being 64-bit but the 
userspace 32-bit).


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Can FPC at least give a hint/warning?

2016-11-08 Thread Marco van de Voort
In our previous episode, Mark Morgan Lloyd said:
> The Solaris and C communities appeared to take the line that a correct 
> compiler "could not" generate unaligned accesses, although they held off 
> clarifying whether "could" in that context means "if it does it's an 
> error" or "it must rearrange data to avoid an error".
> 
> I believe that Solaris and in some cases Linux can handle unaligned 
> accesses in the kernel, although there's obviously a significant 
> performance penalty.

I can remember the early powerpc ports where I came into trouble with the
NetBSD port because the Linux kernel used emulation to fix unaligned float
loads/stores, while NetBSD didn't.

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


[fpc-devel] Raw ARC objects preview

2016-11-08 Thread Maciej Izak
I became outlaw (permanent ban) on Delphi G+ for this :D . Seems my work is
serious danger for Delphi (single programmer can kill their business? I
have no idea).

ARC objects preview for newpascal.org (will be probably used for Delphi
NEXTGEN mode in NewPascal). Fully compilable and backward compatible. Some
work is still required (additional Delphi compatible interface, compiler
magic and and few changes in RTL):

https://github.com/maciej-izak/PascalSmartPointers/blob/master/examples/SmartObj01.pas
https://github.com/maciej-izak/PascalSmartPointers/blob/master/sources/SmartObj.pas


-- 
Best regards,
Maciej Izak
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel


Re: [fpc-devel] Can FPC at least give a hint/warning?

2016-11-08 Thread Mark Morgan Lloyd

On 08/11/16 06:30, Dennis wrote:

Gennady Agranov wrote:

Hi,

I have submitted a bug - http://bugs.freepascal.org/view.php?id=30872
(misaligned data exception on ARMv7)

And this big was resolved as "won't fix"

1. I understand that one has to work really hard to encounter this bug
- and there are easy workarounds, but it there are also different ways
to resolve this bug - e.g. just giving a hint would suffice - IMHO


a compiler warning or hint would be nice.


Alignment was a major issue back when SPARC was still a realistically 
viable platform.


The Solaris and C communities appeared to take the line that a correct 
compiler "could not" generate unaligned accesses, although they held off 
clarifying whether "could" in that context means "if it does it's an 
error" or "it must rearrange data to avoid an error".


I believe that Solaris and in some cases Linux can handle unaligned 
accesses in the kernel, although there's obviously a significant 
performance penalty.


Working on the principle that the FPC community would do well to avoid 
antagonising people with expectations derived from experience with other 
compilers and languages, I'd suggest that a warning when 
potentially-misaligned code is generated is in order.


--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]
___
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel