Re: [fpc-devel] Published record

2024-08-17 Thread Kostas Michalopoulos via fpc-devel
On 8/16/24 8:40 PM, Michalis Kamburelis via fpc-devel wrote: If we could instead just put TVector3 in the published section, and make it exposed in the object inspector (maybe adding some additional code to use RTTI, but that is made *once*, not every time we need to expose TVector3) this would b

Re: [fpc-devel] make OPT= OPTFPC= NEWOPT=

2023-10-07 Thread Kostas Michalopoulos via fpc-devel
On 10/6/23 16:11, Marco van de Voort via fpc-devel wrote: OPT= always to my best knowledge NEWOPT is opt only for later cycles and the rest, iow not for the first FPC bootstrap cycle (that might be started with an older compiler version).  So it is for additional options that are not supporte

[fpc-devel] rtl_do_close is not called in the embedded and freertos targets

2023-08-21 Thread Kostas Michalopoulos via fpc-devel
Hi all, I was looking at the RTL code to see if the embedded target could be used as a workaround for unsupported OSes (e.g. some custom kernel) and noticed that there are some global function pointers used as callbacks for system-specific functionality - which is neat. However i also notice

Re: [fpc-devel] WebAssembly compilation problems - Wasm32 symbol xxx without index value error

2023-03-28 Thread Kostas Michalopoulos via fpc-devel
On 3/28/23 02:12, Michalis Kamburelis via fpc-devel wrote: We're experimenting with compiling Castle Game Engine using FPC WebAssembly target. [..] x3dcamerautils.pas(344,0) Error: Wasm32 symbol X3DFIELDS$_$TSFROTATION_$__$$_SETVALUE$TGENERICVECTOR4 without index value error FWIW i experienced

Re: [fpc-devel] Is this supposed to work (generic)?

2023-03-28 Thread Kostas Michalopoulos via fpc-devel
On 3/26/23 14:30, Martin Frb via fpc-devel wrote: >generic GenLinkedList = class > Data: D; > Next: T; >end; >TSome = class; >TSome = class(specialize GenLinkedList); AFAIK "specialize" essentially "pastes" the parameters (after some checking) so it'd be as if you had d

Re: [fpc-devel] Additional generic type constraints

2023-02-23 Thread Kostas Michalopoulos via fpc-devel
On 2/22/23 15:11, Sven Barth wrote: Kostas Michalopoulos via fpc-devel <mailto:fpc-devel@lists.freepascal.org>> schrieb am Mi., 22. Feb. 2023, 10:37: > Because Delphi doesn't have them and when constraints were implemented > they were implemented for

Re: [fpc-devel] Additional generic type constraints

2023-02-22 Thread Kostas Michalopoulos via fpc-devel
Because Delphi doesn't have them and when constraints were implemented they were implemented for Delphi compatibility. Can they be added? The original announcement ~13 years ago mentioned that those could be added at some point. "object" and "operator X" would be quite useful for me. I tried

[fpc-devel] Wasm/embedded target compilation error

2022-07-28 Thread Kostas Michalopoulos via fpc-devel
Hi all, I was trying to use the Wasm/embedded target to port a game i made some time ago[0] to WebAssembly to run inside a browser, but i am getting a bunch of errors that i can't figure out the issue. When compiling with the embedded wasm assembler i get errors like: SndEmit.pas(171) Error

Re: [fpc-devel] Defer keyword

2021-05-10 Thread Kostas Michalopoulos via fpc-devel
On 5/11/2021 4:09 AM, Ryan Joseph via fpc-devel wrote: On May 10, 2021, at 5:59 PM, Kostas Michalopoulos via fpc-devel wrote: You do not need any special language feature for that, you can simply do something like ReleaseLater(TObject.Create) yes but we can't get back the refe

Re: [fpc-devel] Defer keyword

2021-05-10 Thread Kostas Michalopoulos via fpc-devel
On 5/8/2021 8:27 PM, Ryan Joseph via fpc-devel wrote: That was a bad example. It's for ANY class really. o := TObject.Create.AutoRelease; Then next event cycle the autorelease pool frees all the objects added to it. Very simple but effective however we can't do this in Pascal without a new pe

Re: [fpc-devel] Allow object type property getter to expose a field as one of its base/parent types (patch included)

2020-08-11 Thread Kostas Michalopoulos via fpc-devel
e example in my last message). Not having it feels like going back to pre-generics FP or pre-dynamic arrays Delphi; sure, you do not need the functionality, but it is better when the compiler enables you to avoid busywork and let you focus on more important parts :-P Kostas On Sun, Jun 14

Re: [fpc-devel] Advanced objects

2020-07-23 Thread Kostas Michalopoulos via fpc-devel
There should be at least support for operators. I have a custom dynamic array object type (i use objects instead of classes to avoid unnecessary heap allocations) which would benefit a lot from such support. I worked around not having management operators by putting the data fields and core functio

Re: [fpc-devel] Advanced objects

2020-07-22 Thread Kostas Michalopoulos via fpc-devel
Hi, I'd also like to repeat that question since i was just trying to use management operators for a generic object type (not class, not record) that i want it to automatically initialize/shutdown itself (right now i'm doing it manually but i'd prefer it if the compiler would do that for me) and fo

Re: [fpc-devel] Allow object type property getter to expose a field as one of its base/parent types (patch included)

2020-06-13 Thread Kostas Michalopoulos via fpc-devel
On Sat, Jun 13, 2020 at 12:07 PM Sven Barth via fpc-devel wrote: > I'm against it. It would essentially mean that you can't use the same > field for the setter or that you'd need to go through a method. > Exchanging one restriction (can't use a base class for the property) for > another (can't use

[fpc-devel] Allow object type property getter to expose a field as one of its base/parent types (patch included)

2020-06-03 Thread Kostas Michalopoulos via fpc-devel
to compare_defs doesn't return an adequate value to see if the relevant defs are compatible objects, which should not introduce any additional overhead in existing code (initially i considered modifying compare_defs_ext but i noticed that it is used in several places so i found this special

Re: [fpc-devel] FPC 3.2.0RC1 released!

2020-04-01 Thread Kostas Michalopoulos via fpc-devel
Hm, for me the new compiler produces slightly slower results. The difference is tiny, but consistent. I use my raytracing benchmark from here: http://runtimeterror.com/tools/raybench/ The results on my AMD Ryzen 3700X are: FPC 3.0.4: 3.984 seconds FPC 3.2.0RC1: 4.047 seconds As i wrote, the dif

Re: [fpc-devel] Object upgrades

2019-05-26 Thread Kostas Michalopoulos
Do records support inheritance in next FPC? 3.0.4 doesn't seem to allow that and this is the main reason i use objects when i need value types. Actually, what are the differences between records and objects that make it impossible for records to get objects' features or objects to get records' fea

Re: [fpc-devel] "Blank slate" next version of FPC

2019-02-20 Thread Kostas Michalopoulos
> and Niklaus Wirth might not throw a curse in us. Considering we're talking about a dialect with three different incompatible yet mostly overlapping object systems, i think the curse has already been cast long long ago :-P. ___ fpc-devel maillist - fp

Re: [fpc-devel] Multiple inheritance

2017-08-25 Thread Kostas Michalopoulos
Yeah, that would be helpful for when you need to use a more compositive approach and when you want an object to take on multiple roles (e.g. some sort of mediator or controller). Currently you need to create subclasses for every role but those classes are only use once with the mediator for a singl

Re: [fpc-devel] OpenGL 3.3 Core

2017-05-26 Thread Kostas Michalopoulos
On Fri, 26 May 2017 18:21:47 +0300 > Kostas Michalopoulos wrote: > > >[...] > > I think the control should gain a Profile attribute to solve this. > > How would that "Profile attribute" look like? > > > And > > while at it, also a ForwardCompatible at

Re: [fpc-devel] OpenGL 3.3 Core

2017-05-26 Thread Kostas Michalopoulos
The biggest problem you may have with this is requesting a post 2.1 context in Mac OS X since Apple decided to create a schism in versioning and only supports either 2.1 and below or 3.2 core and above. They do not have ARB_compatibility. Same with Mesa, meaning that on Linux you can use either 2.

Re: [fpc-devel] Address size compiler

2014-11-19 Thread Kostas Michalopoulos
Yes this is what i meant. I'd expect that the sizeof(pointer) to return the target architecture's pointer size, not the architecture of the compiler's own executable. On Wed, Nov 19, 2014 at 5:22 PM, Sven Barth wrote: > Am 19.11.2014 16:15 schrieb "Kostas Michalo

Re: [fpc-devel] Address size compiler

2014-11-19 Thread Kostas Michalopoulos
On Mon, Nov 10, 2014 at 4:07 PM, Michael Van Canneyt wrote: > > For a cross-compiler, sizeof(pointer) <> sizeof(pointer on target arch) > So wait, the following code: {$if sizeof(pointer)=8} Code1 {$elseif sizeof(pointer)=4} Code2 {$endif} will evaluate Code1 for a FPC compiler that is itself

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Kostas Michalopoulos
On Mon, Oct 27, 2014 at 5:17 PM, Hans-Peter Diettrich wrote: > Then the compiler can safely generate refcounting code for *all* objects > and non-weak references, and the counting methods take care of required > operations > Wouldn't that cause all objects to "pay" (both in terms of performance

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Kostas Michalopoulos
On Mon, Oct 27, 2014 at 11:50 AM, Marco van de Voort wrote: > There are multiple existing ones already see e.g. > http://www.freepascal.org/docs-html/ref/refse21.html > But all of those (and "absolute" that Sven mentioned) are not used in function parameters (something that i already mentioned)

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-27 Thread Kostas Michalopoulos
On Mon, Oct 27, 2014 at 11:32 AM, Michael Schnell wrote: > > So you suggest cyclic references should be forbidden (erroneous > programming technique). Are they ? > IMO if a program takes care to avoid cyclic references (with a heaptrc-like unit to find such cases), it shouldn't pay for the overh

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-26 Thread Kostas Michalopoulos
On Sun, Oct 26, 2014 at 8:32 AM, Sven Barth wrote: > Definitely not. We are in Pascal and there such directives are placed > afterwards. > But there are tons of left-sided keywords, like specialize, const, pointer, array, file, var, out, etc. And as i said, "weak Foo" reads better than "Foo weak"

Re: [fpc-devel] Proof of Concept ARC implementation

2014-10-25 Thread Kostas Michalopoulos
Looks good, this will certainly help simplify some of my code :-). My only comment will be about the placement of "weak"... wouldn't make more sense to put it in front of the type (ie "weak TTest" instead of "TTest weak"), similar to how other stuff like const, var, specialize, etc work? It looks

Re: [fpc-devel] Dumping the syntax tree

2014-10-24 Thread Kostas Michalopoulos
tax >>> tree. >>> It is used to generate (a currently limited version of) javascript, and >>> used to create documentation. >>> >>> so it should be usable to generate C code... >>> >>> The test program re-dumps a pascal program. Presumably

Re: [fpc-devel] Dumping the syntax tree

2014-10-23 Thread Kostas Michalopoulos
Lazarus has a Pascal tokenizer unit under components\mpaslex\mpaslex.pp. It seems old and doesn't look like it supports the full FPC syntax, but it might be a starting point since most likely you can convert the code to C++ with GNU GCC extensions (nested functions, etc) straightforward. On Thu, O

Re: [fpc-devel] Suggestion: reference counted objects

2014-09-22 Thread Kostas Michalopoulos
I prefer the TARCObject approach too, i don't want anything to be refcounted unless i *explicitly* ask for it (yes i know some things are already refcounted and at the past i was bitten by that which is a big reason why i don't want hidden things to do magic stuff behind my back). Also i don' want

Re: [fpc-devel] Suggestion: reference counted objects

2014-09-22 Thread Kostas Michalopoulos
Although TBH what i'd prefer more than the above is language features that would allow me to implement refcounted objects myself. Stuff like automatic destruction when a generic variable goes out of scope, etc. On Mon, Sep 22, 2014 at 5:45 PM, Kostas Michalopoulos < badsectorac...@g

Re: [fpc-devel] DOS GUI

2014-01-14 Thread Kostas Michalopoulos
e found at http://opensource.org/licenses On Mon, Jan 13, 2014 at 9:23 PM, Anton Kavalenka wrote: > On 13.01.2014 15:30, Kostas Michalopoulos wrote: >> >> Is it/will be open source? Under what license? > > Author said so. > He gives it away for community for free. > He even did not re

Re: [fpc-devel] DOS GUI

2014-01-13 Thread Kostas Michalopoulos
Is it/will be open source? Under what license? On Fri, Jan 10, 2014 at 3:51 PM, Anton Kavalenka wrote: > On 07.01.2014 12:19, Michael Schnell wrote: >> >> What is the difference between this and the TUI that comes up when you >> start "tp". (Same obviously already is part of the fpc source code >

Re: [fpc-devel] Improving i8086 performance..

2013-12-29 Thread Kostas Michalopoulos
> That emulator is not cycle-exact, so it doesn't have the same > characteristics as the real hardware. PCem comes closer, but is also not > exact. Well, it is better than nothing when you have no access to a real 808x machine. ___ fpc-devel maillist -

Re: [fpc-devel] Improving i8086 performance..

2013-12-27 Thread Kostas Michalopoulos
If you want to do speed tests, try some emulator. For example PicoXT (which emulates an XT clone): http://www.picofactory.com/free/software/pc-xt-emulator/ On Mon, Dec 23, 2013 at 5:27 PM, Jim Leonard wrote: > On 12/23/2013 7:34 AM, Max Nazhalov wrote: >> >> Hello, Everybody! >> >> Can anyone hav

Re: [fpc-devel] Multithreading under DOS

2013-09-27 Thread Kostas Michalopoulos
I suppose something like this: http://www.commell-sys.com/Product/SBC/LE-330.htm ? Also i see some 64MB devices on other sites, although those run Linux fine. On Fri, Sep 27, 2013 at 10:15 AM, Marco van de Voort wrote: > In our previous episode, Nikolay Nikolov said: > > > if you aim to use 32-b

Re: [fpc-devel] Unit for handling UTF-8 strings

2013-04-07 Thread Kostas Michalopoulos
On Sun, Apr 7, 2013 at 5:59 PM, Mattias Gaertner wrote: > On Sun, 7 Apr 2013 13:35:40 +0200 > Kostas Michalopoulos wrote: > > >[...]I looked around in FPC 2.6.2's units and found nothing beyond > > utf8encode/decode (which in linux requires a C widestring manager th

Re: [fpc-devel] Unit for handling UTF-8 strings

2013-04-07 Thread Kostas Michalopoulos
s RTL units, not what other people think about UTF-16, UCS-2, ASCII, EBCDIC or whatever :-). On Sun, Apr 7, 2013 at 3:09 PM, Jonas Maebe wrote: > > On 07 Apr 2013, at 13:35, Kostas Michalopoulos wrote: > > But still no UTF8 in FPC, despite all the different implementations > fl

[fpc-devel] Unit for handling UTF-8 strings

2013-04-07 Thread Kostas Michalopoulos
Hi all, Yesterday i came up with the need to use some UTF-8 handling (string parts, length, etc). I looked around in FPC 2.6.2's units and found nothing beyond utf8encode/decode (which in linux requires a C widestring manager that i'd like to avoid... and doesn't really help in all cases since Uni

Re: [fpc-devel] Re: Comparison FPC 2.6.2 - Kylix 3

2013-03-04 Thread Kostas Michalopoulos
On Mon, Mar 4, 2013 at 9:26 AM, Vittorio Giovara wrote: > Don't use fpc if you don't like it, or send patches to improve it ;) > http://programmers.stackexchange.com/questions/68740/whats-the-canonical-retort-to-its-open-source-submit-a-patch ___ fpc-d

Re: [fpc-devel] State of extended RTTI

2013-02-19 Thread Kostas Michalopoulos
AFAIK FPC doesn't support lambdas (yet?) On Mon, Feb 18, 2013 at 9:02 PM, Boian Mitov wrote: > As example this enumerates all attributes of certain type for any public > or published member (function, field, or property) for a component: > > > for LMember in TRTRtti.GetType( Component.ClassType

Re: [fpc-devel] Same 64bit assembly code compiles under windows but not in linux (fpc 260)

2012-10-04 Thread Kostas Michalopoulos
It depends on the compiler mode, not the platform - at least according to the docs in http://www.freepascal.org/docs-html/ref/refsu5.html: --- The integer type maps to the smallint type in the default Free Pascal mode. It maps to either a longint in either Delphi or ObjFPC mode. The cardinal type

Re: [fpc-devel] Offer to repair and maintain the FPC community website (repeat msg, no HTML)

2012-09-26 Thread Kostas Michalopoulos
It should run only as an easter egg when you move the mouse over it, not all the time :-P On Wed, Sep 26, 2012 at 5:13 PM, Sven Barth wrote: > Am 26.09.2012 16:26, schrieb Cephas Atheos: > >> Kostas and Doug, I agree that even a few little things (like the, er, >> "distracting" running pussycat t

[fpc-devel] A bug in FPC 2.4.x for accessing object methods from local functions?

2011-06-02 Thread Kostas Michalopoulos
Hi all, I've found a bug that causes FPC 2.4.2/2.4.4 to create invalid code. It seems to be caused when a method of a packed* object is called from a local procedure and the object is declared on the procedure above (although it might be caused in other cases too - i just found it in my Lazar