What are the performance benefits? It sounds like this is a proposal for a
compiler optimization which we can explicitly opt in to, but what exactly is
the optimization?
If nothing else I like the idea as a way to enforce a function is not accessing
global state. Kind of like const for functio
sure I could have used that
at some point over the years.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
anyone interested in helping me do this or
answering basic questions on the compiler architecture?
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> On Jul 9, 2018, at 3:25 AM, Sven Barth via fpc-devel
> wrote:
>
> It would allow you to declare constants that use those functions with the
> compiler evaluating them at compile time.
That’s a double win then. Very good idea this is.
Regards,
intend to builda similar system to handle pure
> functions.
I’ve looked at the FPC sources recently but I still don’t understand the
basics. I see lots of TDef,TSym,TSymTable classes. What are those used for? You
mentioned nodes and I wonder if that’s w
Looking at the FPC source now and it appears FreeInstance is a hidden method
which is not called from the TObject destructor.
Where/how is this method called in the source? I’ve been in the debugger for
over an hour and I still can’t find it.
Regards,
Ryan Joseph
oes it get invoked then? there must be some node added somewhere but
I can’t find it.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> On Jul 31, 2018, at 9:56 AM, Ryan Joseph wrote:
>
> then how does it get invoked then? there must be some node added somewhere
> but I can’t find it.
I’m still trying to find this with no luck. I suspect there’s a call node added
when the compiler detects a destructor was call
cdef.proctypeoption=potype_destructor) then
begin
if is_class(current_structdef) then
begin
srsym:=search_struct_member(current_structdef,'FREEINSTANCE');
Regards,
Ryan Joseph
___
fpc-d
destructor.
Thanks guys.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
);
begin
end;
so I could call the procedure with a parameter and have a block node (I think
begin/end is a block node) so I could add some statements inside that. I’m
having fun learning how the compiler works but it’s pretty complicated without
any guidance.
Thanks.
Regards,
Ryan
> On Aug 2, 2018, at 2:41 PM, Ryan Joseph wrote:
>
> So the way FreeInstance is called by adding it within a destructor isn’t
> exactly what I needed because it requires a destructor actually be present in
> the class.
>
> The next thing I’d like to try is adding a
parameter list and return a found
or not found answer? I could start pulling stuff out of do_typecheckpass() but
I suspect there’s already a way to do this.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http
e preferred method?
p1:=csubscriptnode.create(default_property,p1); { p1 being the load node for
“wrapper” }
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
_EQ:
p1:=caddnode.create(equaln,p1,p2);
_GT :
p1:=caddnode.create(gtn,p1,p2);
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/ma
> On Sep 10, 2018, at 4:23 PM, Ryan Joseph wrote:
>
> I think I can use tcallcandidates.create_operator to test this but what do I
> pass for the call param node?
I didn’t get an answer on this but I was able to figure it out for myself,
albeit only for arithmetic operators,
> On Dec 2, 2018, at 4:00 PM, Sven Barth via fpc-devel
> wrote:
>
> Please report as a bug.
I don’t get a bug on this in the trunk version I’m using. Maybe it was fixed?
Regards,
Ryan Joseph
___
fpc-devel maillist
eric specialize or <> is in the
>
> class generic x: TObject;
>
> Can it be shared across all generics of a kind?
>
> The code density in the cache would be good for all common generics.
I don’t get what this is trying to accomplish o
e testsuite can be
> finished as well. There are still some extra failures that do not happen with
> the built-in code generator, but most tests work fine.
What does this mean for end users? Do we get better debugging support in LLDB?
Regards,
Ryan Joseph
__
pecial switches to show compiles times more
accurate?
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
ail?
> On Dec 9, 2018, at 8:36 AM, Ryan Joseph wrote:
>
> Couldn’t figure out the patching. I tried a dry run but it doesn’t seem to
> find the file.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.free
ing copy)
--
File to patch:
> On Dec 9, 2018, at 7:11 AM, J. Gareth Moreton
> wrote:
>
> Had any luck with this?
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal
Got everything building finally but the time difference is so small I'll need
to make a script to compile multiple times and average all the runs. Is it even
worth the time doing that?
Regards,
Ryan Joseph
___
fpc-devel maillist -
a. Kit
The reason is that PPU versions changed so I can’t use the units at the default
system locations. Not sure how the compiler decides but it was looking for
units at the 3.1.1 install location which is an older PPU version.
There should be a single command to specify a top-level direct
?
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
ng -vs when it got to the
linking phase.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
AM, J. Gareth Moreton
> wrote:
>
> The overhaul primarily increases the speed of compilation, but it makes some
> minor improvements to conditional branches here and there. Nevertheless, I'm
> always happy to find a saving here and there in the compiled assembly
> langua
rtup and return to
the pool instead of freeing. It would make the compiler utilize more memory but
that’s a good trade off for me personally. This is especially a good idea
because the compiler is a one pass program so leaks over the long term aren’t a
problem.
Regards,
hed, at least on a per-block level. That’s a
particularly wasteful detail I noticed and there’s probably many more like this.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/ma
> On Dec 12, 2018, at 7:59 PM, Ryan Joseph wrote:
>
> For example every time you it parses “1 + 1” a large code block is entered
Correction, 1+1 doesn’t enter a large code block unless there’s an overload
present. Once you add overloads however that’s when a caching solution wou
C so
shouldn’t this be turned off? I may not understand what you mean by exception
frame though.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
t for him. I’ve been hearing about it almost being
done for a few years now and like Ben this is the probably the most needed
feature to make our lives easier.
As an intermediate measure I was able to make nested functions anonymous but
Sven wanted to wait for the real th
eNext and GetCurrent!
>
Here’s this implicit try/finally block on heap allocation thing again. Can
someone please explain this? Some months ago someone complained FPC was doing
this on all TObject.Create calls. Is that true?
Regards,
Ryan Joseph
___
ure bloat like in other languages). I would suggest we make
this a compilers switch that is on by default but can be disabled.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
o recompile the system unit with
> that switch, since the code for TObject's c
How can I test to verify if this works or not? Martin makes it sound like
there’s some other considerations for subclasses.
Regards,
Ryan Joseph
___
fpc-devel
ram actually uses
exceptions or not.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
Sending this again to see if it gets through (posts getting blocked again).
> On Feb 26, 2019, at 2:43 PM, Ryan Joseph wrote:
>
> In my implicit generic specialization code I have one place where I get a
> string const node (stringconstn) which the resultdef is arraydef (not
>
);
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
rocsym(context.sym).procdeflist.count=0 then
internalerror(2015061203);
result:=tstoreddef(tprocsym(context.sym).procdefList[0]);
end;
end;
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
question) but that is specific to string constants.
For normal function calls this isn’t a problem because the type is always
specified but for implicit specializations the type may need to be declared in
order for the specialization to be possible.
Regards,
Ryan Joseph
thinking about this too much. :)
So anyways look it over and see if this is acceptable. It does at least work
though which is pretty great because it’s a crucial addition for generics imo.
https://github.com/genericptr/freepascal/tree/generic_implicit
Regards,
Ryan Joseph
ed the patch for constants in generics and uploaded again
(https://bugs.freepascal.org/view.php?id=35140). Not sure if they added it yet
or they were waiting for my to fix things. Let me know if that patch is in the
correct format so I can fix the other one for multi-helpers.
Re
omething along these lines is absolutely sorely lacking in FPC currently,
> don't let anyone tell you otherwise.
Sounds exciting progress for FPC. Btw what happened to the development of
“pure” function modifier that would make it possible to use functions in
compile time expressions? I
g and the "pure" feature are blocked
> until the XML debug node dump feature is approved.
>
That’s too bad. Knowing if a function is “pure” or not seems deceptively simple
but what were the big challenges btw?
Regards,
Ryan Joseph
,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
DoThis(param: integer = I);
end;
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> On Mar 18, 2019, at 11:23 AM, Ryan Joseph wrote:
>
> type
> generic TUnaryOp = record
>const
> d0 = -I;
> d1 = +I;
> d2 = not I;
> end;
>
> type
> generic TBinaryOp = record
>const
> d0 = I + I;
> d1 =
support for pure functions so that one’s a
go for sure.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
been just sitting there for 3+
years. Hope we can get this resolved sooner than later.
https://github.com/maciej-izak/freepascal/tree/closures
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http
rom what I saw in that repo the captures are stored in an interfaced object
which has reference counting right? Maybe expand on the lifetime management
issues more.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
> On Mar 21, 2019, at 5:01 PM, Blaise Thorn wrote:
>
> Thursday, March 21, 2019 11:48 PM +03:00 from Ryan Joseph
> :
>> Then maybe he’ll hear this and respond.
>
> I just did.
Oh, you’re the author! I recognize the email now. Yes, please tell me what the
status is a
types from the parameters.
I have no preference either way but I wanted to ask the list if they had any
better ideas to contribute. If there’s nothing better I’ll just defer to what
Florian wants.
Regards,
Ryan Joseph
___
fpc-devel maillist
kunit/units_bs/x86_64-darwin -Fu../rtl/units/x86_64-darwin
-Fd -n
ld: file not found: /usr/lib/crt1.10.5.o
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
es ("+") }
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
array elements
start (which is aligned). It would complicit the code to some extent however
because the current design relies on lots of pointer math.
Is this ok that I add this? Marco said in the comments there was a need so I
assume this is a go but I wanted to ask first.
Regards,
Ryan
> As for extending the array header, maybe introduce a new data type "aligned
> array".
> So normal arrays do not have that field in there header.
The plan was to make a “SetLengthAligned” or add an extra parameter to
“SetLength”, i.e, SetLength(arr,100,true).
alignment calls the new one
> with alignment 1.
>
> Note: the compiler can call the new one for both variants, but the old one is
> required for bootstrapping, so you could surround that with {$if not
> defined(ver3_0) and not defined(ver3_2)}.
You mean if the compiler is &
Now I’m using “cd /rtl; make all FPC=/path/to/compiler” to build the RTL but
this is obviously slow and unnecessary. Is there a quicker way to build just
the unit which contains dynarr.inc and have all the objects files to be put in
the correct location?
Regards,
Ryan Joseph
make variants like InsertAligned() and ignore + operators
for aligned arrays
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
return an
aligned block that had x number of bytes directly before it. No idea if that’s
feasible for memory managers.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
ler
directive could be used.
var
{$push}
{$dynamic-array-align 4096}
a: array of integer;
{$pop}
begin
SetLength(a,10); // just use normal SetLength now
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
h
thout pointers.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
k for me.
{$push}
{$align 16}
type
TVertex = record
pos: TVec2;
col: TVec2;
end;
{$pop}
Why not use a similar directive for array alignment? That would solve the
problem I discovered with insert/concat.
{$push}
{$align-array 4096}
type
TIntArray = array of integer;
{$pop}
Regards,
t crazy to implement in Pascal.
int& getter() {
return i;
}
function getInt: integer; var;
begin
result := i;
end;
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
recedent for it (i.e. $align).
Can you give some examples of the vector type? I don’t exactly know what you
guys are referring to.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
n be okay as well
>
> That only works in {$mode delphi}
Oh that’s why! How does this work in Delphi mode without pointers and why
wasn’t it added to ObjFPC mode? That would have saved me some headache in the
past if I knew this.
Regards,
Ryan Joseph
__
> On Mar 30, 2019, at 12:53 PM, Mattias Gaertner via fpc-devel
> wrote:
>
> I guess you mean auto dereferencing.
> {$ModeSwitch AutoDeref}
Yeah I just found this by looking around in the compiler. Mind. Blown. No idea
that existed!
Regards,
rstand users who like the compiler syntax,
which is cleaner and probably faster.
So what should I do going forward? Should I abandon the idea or do any of the
other core team members want to me pursue this further?
{$push}
{$dynarrayalign 4096}
type
left;
end;
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
o why is this really a problem? It just means the
operator needs to mutate the actual class instead of making a copy like for
records, but those are the rules anyways. Given that I still don’t understand
why "class operator” isn’t included in classes.
Regards,
Ryan Joseph
ice so I think most people know how to be safe.
What this means is that’s it harder for more advanced programmers to do things
like add + and := operator to collection classes like arrays and that’s pretty
unfortunate. At this point it’s already been smuggled in via operator fun
> On Apr 20, 2019, at 9:56 AM, Ryan Joseph wrote:
>
>> On Apr 16, 2019, at 8:43 PM, Ryan Joseph wrote:
>>
>> I see why that could be a problem but aren’t users reasonable for not doing
>> dangerous things in a language like Pascal with low-level memory access
Any new news on the LLVM code generator? I wanted to test this but the old link
posted seems to be dead. Is there an updated link and instructions to build?
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http
yObject
>
> very good!
>
> This feature deserves a bold announcement. Now we are only missing Lazarus
> IDE codetools support for it :)
>
> Again - big thanks.
You’re welcome. I’m looking forward to fixing up some old code myself. :)
Regards,
Ryan Joseph
___
end;
procedure THelper2.DoThis(msg: string);
begin
writeln('DoThis:', msg);
end;
var
obj: TObject;
begin
obj := TObject.Create;
obj.DoThis; // < ERROR: Wrong number of parameters specified for
call to "DoThis"
end.
Regards,
Ryan Joseph
__
ite, tests that need to
successfully run, merely successfully compile or even need to fail to
compile (look at the files in tests/test/ to see what I mean).
}
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> On May 18, 2019, at 11:41 AM, Blaise Thorn wrote:
>
> Saturday, May 18, 2019 8:32 PM +03:00 from Ryan Joseph
> :
>> After 2 months now I’ve not been able to get the required sources to help
>> finish the closures branch.
>> The author Blaise did manage to
s just
> "lazy programming", like it or not...
>
> Ralf
Then should all if statements have an else? Should constructors give warnings
if you don’t initialize all fields? It’s a slippery slope.
Regards,
Ryan Joseph
__
it all
tested and it’s fully functional now (another user has been tested it also as
you’ll see in the notes).
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo
TMyObject.Destroy;
begin
end;
var
o: TMyObjectPtr;
begin
// new(o, Create);
o := TMyObject.Create;
// what to do here???
o^.destroy;
// implicit free method?
o^.free;
end.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel
to support
classes also. I already spent a good amount of time working on “default
properties” but that was done in leu of the fact that only records support
management operators.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel
ult properties.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
to a TNotifyEvent or store it in a
> TStringList's Objects property.
Isn’t this what fully ARC languages like Swift do though? I would think this
would be an interesting option to at least be available for particular use
cases.
Regards,
Ryan Joseph
___
work? I was thinking
enabling management operators for classes would have basically the same
performance impact as those compiler types (which is actual ARC in Pascal
unless I misunderstand).
Regards,
Ryan Joseph
___
fpc-devel ma
routes to variety of different functions based on the type
and could simply be extended like it was for records. I liked the idea of
management operators for classes because users can opt in for classes that
aren’t doing performance critical stuff.
Regards,
Ryan Joseph
_
got blocked }
I thought FPC was trying to keep them alive? Objects are still the only way to
do inheritance for records but they lack operator overloads. The syntax for
new/dispose certainly feels legacy but that’s not as important as the class
operato
ads it’s not possible.
Also, since we’re not getting ARC classes it looks like, management operators
for objects would make it possible to use a base class for “boxing” managed
classes.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel
the same also). Operator overloads simply aren’t
enabled for objects because apparently they’re a legacy syntax but as you
pointed out they’re still useful. Being able to use subclassing for TVec2 ->
TVec3 -> TVec4 objects would be really useful. I hope the compiler
worked
remarkably well (nested proc vars already do all the work required but they
used records for the backing store).
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> On May 30, 2019, at 4:18 PM, Ryan Joseph wrote:
>
> I didn’t realize generic functions were in the trunk. I’m not sure I got this
> implemented properly so it requires some code review but can we try to
> include “implicitfunctionspecialization” mode switch in the next relea
7;,msg.ClassName);
end;
generic procedure DoThis(msg: T);
begin
writeln('DoThis:',msg.ClassName);
end;
begin
DoThis(TMyClass.Create);
DoThis(TObject.Create);
end.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@list
n
end;
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> On Jun 2, 2019, at 4:36 PM, Sven Barth via fpc-devel
> wrote:
>
> Am 02.06.2019 um 16:39 schrieb Ryan Joseph:
>> I just tried to declare these 2 procedures in 3.3.1 and got an error. You
>> can declare them in the reverse order with no problem. A bug?
>>
>
es (which are just as "inline", I'd say) work
> just fine.
>
I don’t get this either. It feels to me like ^ is a modifier more than an
actual new type. That’s just me feeling though as a long time Pascal programmer.
Regards,
Ryan Joseph
___
nagement operators …
class operator postfix: T;
end;
class operator TAuto.postfix: T;
begin
result := m_obj;
end;
var
a: TAuto;
begin
writeln(a.ClassName); // a.m_obj.ClassName
Regards,
Ryan Joseph
___
fpc-devel maillist - f
dition to type declarations though because it makes it
more clear what they are.
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
d be an exception to the rule?
Regards,
Ryan Joseph
___
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
> On Jun 7, 2019, at 4:47 PM, Sven Barth via fpc-devel
> wrote:
>
> Am 07.06.2019 um 22:41 schrieb Ryan Joseph:
>> Does that make sense? I’d like to scratch the idea of default properties and
>> do this instead if it was permitted.
> No. FPC is not going down tha
kinds of expressions containing specializations that mode ObjFPC
> supports.
Then maybe it could be optional within type declarations? Delphi mode achieves
this so I think ObjFPC could also. Yet another modeswitch like “autoderef”? :)
Regards,
Ryan Joseph
_
en
;
end.
=
All the postfix operator allows is “.” access. That’s like 90% less intrusion
into the compiler. Much smaller can of worms. Sorry C++ had the smarter idea
here. Limit the access to “.” and if the user wants assignments or equality
etc… they overload other operators. Plea
1 - 100 of 328 matches
Mail list logo