Re: [fpc-pascal] Pointer question

2023-08-09 Thread Hairy Pixels via fpc-pascal
Playing around I had a more questions about pointer operations I've never used myself. 1) what does "i := x - x;" do and what is it's purpose and why doesn't "x + x" work the same? 2) I've used pointer equality of course but what does "x > p" do and what is its purpose? === var

Re: [fpc-pascal] Pointer question

2023-08-09 Thread Hairy Pixels via fpc-pascal
> On Aug 9, 2023, at 2:54 PM, Tomas Hajny via fpc-pascal > wrote: > >> >> 1) what does "i := x - x;" do and what is it's purpose and why doesn't "x + >> x" work the same? > > Pointer subtraction is a reverse operation to adding a number to a pointer; > the result of the subtraction is the

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Hairy Pixels via fpc-pascal
> On Aug 9, 2023, at 4:37 PM, Tomas Hajny via fpc-pascal > wrote: > > No, the offset is not a memory address but just a number of bytes (which is > also the reason why you cannot add the pointers together, but you can add a > number to a pointer. As an example, you could use this operation

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Hairy Pixels via fpc-pascal
> On Aug 10, 2023, at 5:43 AM, Bernd Oppolzer via fpc-pascal > wrote: > > PTRADD (p, i) - p is type ANYPTR, i is integer, result is of type ANYPTR > PTRDIFF (p1, p2) - two pointers, the result is integer > ANYPTR is a predefined type, compatible with every (typed pointer) > ADDR (x) is a fun

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Hairy Pixels via fpc-pascal
> On Aug 10, 2023, at 10:49 AM, Sven Barth via fpc-pascal > wrote: > > Then you simply aren't using them often enough. E.g. the RTTI internal code > is full of them and additional typecasts would simply muddle up otherwise > relatively clear code. > Here's a question, what is the full li

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Hairy Pixels via fpc-pascal
> On Aug 10, 2023, at 2:18 PM, Michael Van Canneyt via fpc-pascal > wrote: > > https://www.freepascal.org/docs-html/current/ref/refse15.html#x42-620003.4 This document doesn't really do a great enumerating all the operators so I'm not sure if the list is complete. I think the list is: var

Re: [fpc-pascal] Pointer question

2023-08-10 Thread Hairy Pixels via fpc-pascal
> On Aug 10, 2023, at 4:23 PM, Hairy Pixels wrote: > > // 4) subscript (inc and dereference in one step) > v := i[1]; > > > #4 was not in the list for example so I wonder what others exist. I found another one in the typinfo.pp unit. What does, 1) taking the address of a type (@TAlignChec

Re: [fpc-pascal] Pointer question

2023-08-11 Thread Hairy Pixels via fpc-pascal
> On Aug 10, 2023, at 11:37 PM, Michael Van Canneyt via fpc-pascal > wrote: > > This is a very dirty trick to get the offset of a field in a record. > > Note that you're not dereferencing a type but a variable of type TAlignCheck > located > at memory address zero. The address of w (this is

Re: [fpc-pascal] Visual studio code

2023-08-11 Thread Hairy Pixels via fpc-pascal
> On Aug 11, 2023, at 11:24 AM, Darius Blaszyk via fpc-pascal > wrote: > > Quick question for you all. Has anyone here worked with Visual Studio Code > for Free Pascal? I've got the Free Pascal Toolkit plugin up and running, but > I'm hitting a bit of a roadblock with setting up GDB debuggin

[fpc-pascal] Closure hangs compiler

2023-09-23 Thread Hairy Pixels via fpc-pascal
This program hangs during compiling. Does this happen to you too? === Free Pascal Compiler version 3.3.1 [2023/03/03] for aarch64 {$mode objfpc} {$modeswitch anonymousfunctions} {$modeswitch functionreferences} program test; type TProc = ref

Re: [fpc-pascal] Closure hangs compiler

2023-09-24 Thread Hairy Pixels via fpc-pascal
> On Sep 24, 2023, at 2:51 PM, Michael Van Canneyt via fpc-pascal > wrote: > > I can confirm. Please create a bugreport. 👍 https://gitlab.com/freepascal.org/fpc/source/-/issues/40446 Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lis

Re: [fpc-pascal] All methods vitrual ?

2023-10-10 Thread Hairy Pixels via fpc-pascal
> On Oct 10, 2023, at 4:18 PM, Adriaan van Os via fpc-pascal > wrote: > > Interesting ! If I am correct, the docs referred to at > say > > ; visibility-clause: > ; METHODS|PROPERTIES|FIELDS (visibility-expression) > > Does that m

Re: [fpc-pascal] "Modern Pascal is Still in the Race"

2023-10-12 Thread Hairy Pixels via fpc-pascal
Pascal still fits a niche as being a lower level language like C or C++ but with nicer syntax. For making modern software it's going to be hard to use though since no major OS's support it directly. > On Oct 12, 2023, at 7:18 PM, Liam Proven via fpc-pascal > wrote: > > « > A recent poll on th

[fpc-pascal] Creating capturers

2023-10-31 Thread Hairy Pixels via fpc-pascal
I'm curious how the capturer is created in the case of anonymous functions. I know the function needs to create a capturer when nested functions are declared but what happens if there is an anonymous function which is declared in the code section? I think the compiler will only know about the r

Re: [fpc-pascal] Creating capturers

2023-11-02 Thread Hairy Pixels via fpc-pascal
> On Nov 2, 2023, at 1:44 PM, Sven Barth wrote: > > The most important piece of knowledge is that in a routine with nested (or > anonymous) routines the nested (or anonymous) routines aren't compiled down > to machine code right away. The compiler first parses the whole hierarchy > until it'

Re: [fpc-pascal] Creating capturers

2023-11-02 Thread Hairy Pixels via fpc-pascal
> On Nov 2, 2023, at 1:44 PM, Sven Barth wrote: > > Now for nested as well as anonymous routines the compiler determines whether > a capturer is required at the point that the nested or anonymous routine is > assigned to a function reference (cause otherwise it can be handled as a > nested f

Re: [fpc-pascal] Creating capturers

2023-11-03 Thread Hairy Pixels via fpc-pascal
> On Nov 3, 2023, at 2:08 PM, Sven Barth wrote: > > By default the purpose of anonymous functions assigned to function references > *is* that they can escape their scope. This will not change, because they > were after all introduced for Delphi-compatibility and there won't be any > designat

Re: [fpc-pascal] Creating capturers

2023-11-03 Thread Hairy Pixels via fpc-pascal
> On Nov 3, 2023, at 8:31 PM, Sven Barth wrote: > > If you need a catch all type, then you should use function references. There > is no need to invent yet another type. > The only thing it can not handle is the assignment of nested function > pointers (in contrast to nested functions directl

Re: [fpc-pascal] Creating capturers

2023-11-04 Thread Hairy Pixels via fpc-pascal
> On Nov 4, 2023, at 4:22 PM, Sven Barth wrote: > > Then don't assign them every "frame". If you just keep them around then they > aren't more expensive than a virtual method call. > And any other mechanism would involve the heap as well, because that's how > anonymous functions that capture

[fpc-pascal] Incompatible procedure types

2023-11-07 Thread Hairy Pixels via fpc-pascal
What does this error mean? It's comparing a pointer to a procedure to a procedure variable (a callback). The signature appears exactly the same "function(TSymbol;TSymbol):LongInt is nested" so what's the problem? error: Incompatible type for arg no. 2: Got "", expected "TSList$1$crcCC4DE170_crc

Re: [fpc-pascal] Incompatible procedure types

2023-11-08 Thread Hairy Pixels via fpc-pascal
> On Nov 8, 2023, at 1:50 PM, Sven Barth via fpc-pascal > wrote: > > Please provide example code so that one can look at it. Such messages without > example are more often than not simply useless. > So this ended up being because I didn't enable the "nestedprocvars" mode switch and you ge

Re: [fpc-pascal] method-definition

2023-12-15 Thread Hairy Pixels via fpc-pascal
> On Dec 15, 2023, at 8:56 PM, Adriaan van Os via fpc-pascal > wrote: > > What complicates things, is that many conflicting rules have the same name in > the Language Reference. For example, conceptually we have object-methods, > record-methods, class-methods, interface-methods and objcclass

[fpc-pascal] Double finalize

2023-12-20 Thread Hairy Pixels via fpc-pascal
I feel like this was addressed but I couldn't find any references. The program below prints the following: Initialize Create Finalize Finalize Why is Finalize called twice? I thought those were supposed to be called in pairs with initialize? == {$mode objfpc} {$modeswi

Re: [fpc-pascal] Double finalize

2023-12-20 Thread Hairy Pixels via fpc-pascal
> On Dec 21, 2023, at 1:53 AM, Michael Van Canneyt via fpc-pascal > wrote: > > If you look at the generated code, you see that there is an implicit > try/finally block > and the finally block does a finalize. Maybe I misunderstood but I thought they were supposed to be balanced with init c

Re: [fpc-pascal] Double finalize

2023-12-20 Thread Hairy Pixels via fpc-pascal
> On Dec 21, 2023, at 6:11 AM, Hairy Pixels wrote: > > Maybe I misunderstood but I thought they were supposed to be balanced with > init calls. Is it the design of the compiler to allow multiple finalize calls > and have the user keep track of it the underlying structure is really > finalize

Re: [fpc-pascal] Double finalize

2023-12-21 Thread Hairy Pixels via fpc-pascal
> On Dec 21, 2023, at 12:06 PM, Hairy Pixels wrote: > > Here's another example of this. If I use an array Finalize is called 4 times > but Initialize is never called, unless you assign a record to the array and > then it's called once. > > This makes even less sense. What's the idea behind

Re: [fpc-pascal] How to avoid Copy

2023-12-31 Thread Hairy Pixels via fpc-pascal
> On Dec 30, 2023, at 3:18 PM, Michael Van Canneyt via fpc-pascal > wrote: > > And try to avoid "for r in data" because it will create a copy for each > element > in the list. This seems more like bad compiler design than anything. From the users perspective a for loop is a read-only operat

Re: [fpc-pascal] How to avoid Copy

2024-01-01 Thread Hairy Pixels via fpc-pascal
> On Jan 1, 2024, at 3:50 PM, Michael Van Canneyt > wrote: > > You can't optimize that. As said, a generic is convenient but slow. I don't know about that. Like was mentioned the enumerator needs to return a pointer, preferable without ^ so it feels like a record and only use that in the fo

[fpc-pascal] Virtual methods on sealed classes

2024-01-08 Thread Hairy Pixels via fpc-pascal
Do sealed classes actually call virtual methods statically or are they just for compiler warnings? Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

[fpc-pascal] "Address of" question

2024-01-14 Thread Hairy Pixels via fpc-pascal
I just noticed it's possible to do @Byte in FPC. Are these 2 lines even different? It doesn't exactly make sense to take the address of a type identifier so I'm curious what this may mean. var b: Byte; p: PByte; begin p := @Byte(b); p := PByte(@b); Regards, Ryan Joseph __

[fpc-pascal] IntToStr implementation

2024-01-17 Thread Hairy Pixels via fpc-pascal
Can anyone show me where to find the IntToStr implementation in SysUtils? There's so many level of indirection and macros I have no idea where to look for it! Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org htt

Re: [fpc-pascal] IntToStr implementation

2024-01-17 Thread Hairy Pixels via fpc-pascal
> On Jan 17, 2024, at 10:15 PM, Marco van de Voort via fpc-pascal > wrote: > > > Op 17-1-2024 om 15:57 schreef Hairy Pixels via fpc-pascal: >> Can anyone show me where to find the IntToStr implementation in SysUtils? >> There's so many level of indirection an

Re: [fpc-pascal] IntToStr implementation

2024-01-18 Thread Hairy Pixels via fpc-pascal
> On Jan 18, 2024, at 1:51 PM, Sven Barth via fpc-pascal > wrote: > > There is no source for Str() in that sense, because Str() is a compiler > intrinsic implemented in the compiler's ninl.pas. > Well that explains everything now! What is this an intrinsic? I was curious how it was impleme

Re: [fpc-pascal] Division by zero when running SDL program on GPU (NVIDIA)

2024-01-30 Thread Hairy Pixels via fpc-pascal
I don't think this has anything to do with the compiler. You should probably ask on the SDL forums. They've been helpful for me before. > On Jan 30, 2024, at 6:45 PM, Rafael Picanço via fpc-pascal > wrote: > > Hi everyone, how are you doing? > > I am receiving an "FLT divide by zero" error wh

[fpc-pascal] AnsiString address changed

2024-03-17 Thread Hairy Pixels via fpc-pascal
Curious, why did the address of "s" change here? Shouldn't the AnsiString be incrementing a reference count and not actually changing the actual pointer or copying? Correct me if I'm wrong, AnsiString is ref counted when passing in/out functions but copies on assignment so technically no two A

Re: [fpc-pascal] AnsiString address changed

2024-03-18 Thread Hairy Pixels via fpc-pascal
> On Mar 18, 2024, at 1:52 PM, Michael Van Canneyt via fpc-pascal > wrote: > > An ansistring is a pointer to a memory block. > > You are printing the address of S1 and the address of S, i.e. the address of > the pointer itself, not the address of what S (or s1) points to. Obviously > the add

Re: [fpc-pascal] AnsiString address changed

2024-03-18 Thread Hairy Pixels via fpc-pascal
> On Mar 18, 2024, at 3:27 PM, Hairy Pixels wrote: > > Oh, it's a pointer to a pointer? I guess that explains how it can resize > itself and not invalidate shared references, if those are even possible with > AnsiString. Wait, that's totally wrong. :) @s is the address of the local variable

Re: [fpc-pascal] AnsiString address changed

2024-03-18 Thread Hairy Pixels via fpc-pascal
> On Mar 18, 2024, at 5:29 PM, Michael Van Canneyt via fpc-pascal > wrote: > > Of course there must be, that's the whole point of copy-on-write. > > As soon as one reference is changed, a copy is made if the reference count > is larget than 1, and this copy is changed. Oh, it does copy on wr

[fpc-pascal] Custom NewInstance allocator

2024-06-04 Thread Hairy Pixels via fpc-pascal
In the manual it at https://www.freepascal.org/docs-html/ref/refse38.html it says "Calling the constructor will provoke a call to the virtual class method NewInstance, which, in its default implementation, calls GetMem, to allocate enough space to hold the class instance data, and then zeroes ou

Re: [fpc-pascal] Custom NewInstance allocator

2024-06-04 Thread Hairy Pixels via fpc-pascal
his implies to me it will be done by Object somewhere higher up in the chain. It should read: "If memory was allocated it must be initialized by a call to InitInstance" > On Jun 4, 2024, at 7:06 PM, Sven Barth via fpc-pascal > wrote: > > Hairy Pixels via fpc-pascal s

[fpc-pascal] Ordinal casting to enums

2024-06-05 Thread Hairy Pixels via fpc-pascal
This program below crashes because the value 12 is not in the enum. I was curious though, how does it know this? Does it have to do a linear search through the enum to find the value? I know "succ" fails at compile time because the enum has assignments but how this works at runtime is another qu

Re: [fpc-pascal] Ordinal casting to enums

2024-06-06 Thread Hairy Pixels via fpc-pascal
oh, it's writeln which is doing the runtime check, thanks. Doing math on enums is probably not a smart idea though. I wonder why a subscript like [] was never added to enums. It would be nice to do: f := Fruit[banana.index + 1]; instead of dealing with raw values. A runtime check for creating e

[fpc-pascal] Sub-millisecond time measuring

2024-06-28 Thread Hairy Pixels via fpc-pascal
I had a large function which I was profiling with MilliSecondsBetween but I split it to be called many different times and now it's not accumulating the total time correctly because time is being lost to due millisecond precision. Is there anything in the RTL I can use which is more accurate? I

Re: [fpc-pascal] Sub-millisecond time measuring

2024-06-28 Thread Hairy Pixels via fpc-pascal
i, Jun 28, 2024 at 2:34 PM Hairy Pixels via fpc-pascal > wrote: > I had a large function which I was profiling with MilliSecondsBetween but I > split it to be called many different times and now it's not accumulating the > total time correctly because time is being lost to due

[fpc-pascal] Heap trace on mac still not working?

2024-06-28 Thread Hairy Pixels via fpc-pascal
One more thing that's getting to me today. Heap trace on macOS still seems to be broken, i.e. using -gh I only get addresses and no line numbers. Has been for years it feels like. Is this is just broken forever? I see this issue from years ago still open. https://gitlab.com/freepascal.org/fpc/s

Re: [fpc-pascal] Sub-millisecond time measuring

2024-06-28 Thread Hairy Pixels via fpc-pascal
> On Jun 28, 2024, at 10:44 PM, Christo Crause wrote: > > It is based on TComponent from the RTL classes unit, so no dependency on LCL > or other Lazarus units. A quick check of the source code suggests that it > will probably call GetTickCount64 > (https://github.com/graemeg/epiktimer/blob

Re: [fpc-pascal] Sub-millisecond time measuring

2024-06-29 Thread Hairy Pixels via fpc-pascal
> On Jun 29, 2024, at 5:43 PM, Adriaan van Os wrote: > > Hairy Pixels via fpc-pascal wrote: >> I had a large function which I was profiling with MilliSecondsBetween but I >> split it to be called many different times and now it's not accumulating the >> tota

Re: [fpc-pascal] Heap trace on mac still not working?

2024-06-30 Thread Hairy Pixels via fpc-pascal
to add -Xg, or ‘Use external debug symbols file’ in Laxarus > > > Van: fpc-pascal namens Hairy Pixels > via fpc-pascal > Verzonden: vrijdag, juni 28, 2024 5:37 PM > Aan: FPC-Pascal users discussions > CC: Hairy Pixels > Onderwerp: [fpc-pascal] Heap trace on mac still not

Re: [fpc-pascal] Heap trace on mac still not working?

2024-07-01 Thread Hairy Pixels via fpc-pascal
the heap trace must be reading the dwarf info then I guess, which makes sense. > On Jul 1, 2024, at 4:12 PM, Sven Barth via fpc-pascal > wrote: > > Hairy Pixels via fpc-pascal schrieb am Mo., > 1. Juli 2024, 03:49: > oh it uses external debug symbols! Now it's

[fpc-pascal] Fwd: What to do to get new users

2024-10-15 Thread Hairy Pixels via fpc-pascal
FPC is not keeping up with trends in the industry which new programmings want despite all the older programmers who are settled in their ways. Even if there is a market for Lazarus type apps people in 2024 don’t want to use a massive legacy IDE and prefer better tools like VSCode. If you want to u

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 4:26:51 PM, Martin Frb via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Which IMHO, means another (potentially drastic) downside. > > If it would be possible and would be done, you end up with 2 > incompatible products. That would mean you split the community into 2 >

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 3:35:25 PM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > You are not taking the reasoning to its logical conclusion. > > These "new users" will want to have some standard library - the RTL and > packages. > > So the whole rtl/packages needs to

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 16, 2024 at 9:46:05 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I don't know, it could be the Nim to JS compiler, or the fact that the > previous plugin developer didn't use the LSP protocol, but direct > integration instead. But I don't like the whole id

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 16, 2024 at 4:44:35 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > > On 10/16/24 6:00 AM, Hairy Pixels via fpc-pascal wrote: > > FPC is not keeping up with trends in the industry which new programmings > want despite all the older progra

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 16, 2024 at 9:18:01 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I also have some experience from my day job on making a VS Code extension > for the Nim language (you can see my commits in the Nim language server > here https://github.com/nim-lang/langserv

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
Another point is that FPC doesn’t have an official forum except for the mail list and that in and of itself is a problem if you ask me. Most young people don’t use email and won’t like this. I myself don’t prefer the mail list over some of the very nice forums that allow posting code and very easy

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 16, 2024 at 8:50:21 PM, Ștefan-Iulian Alecu via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I don't blame someone coming at me and thinking Pascal's > old, when we're clinging on to Lazarus with *everything*. It is a bit > sad if you think about it: we're putting Lazarus on a pe

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 16, 2024 at 9:08:13 PM, Stefan-Iulian Alecu via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I'll revisit your extensions and give pascal-language-server yet another > shot, but I am not too confident. If I can make it work within a CI/CD > context, I'll send a PR. This would imp

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 16, 2024 at 8:50:21 PM, Ștefan-Iulian Alecu via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > 4. a proper VSCode extension (we can include Vim and Emacs there too, > but the main focus is VSCode) with all the bells and whistles more > established extensions have. I know we would a

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-18 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 2:31:36 AM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > This would mean that a new class type or some kind of additional attribute > would have to be introduced which would have to be incompatible to > non-reference-counted classes as otherwise there w

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-18 Thread Hairy Pixels via fpc-pascal
On Oct 18, 2024 at 3:41:49 PM, Karoly Balogh via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Maybe it was mentioned in the thread, I just glanced through it, but how > about ARC (Automatic Reference Counting), Objective C style? To be honest, > I really liked that, and we already have

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 7:53:14 PM, Rainer Stratmann via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I feel very safe with freepascal. I don't know what you are talking about. > It depends on the programmer who is in front of the computer. > We’re talking about new users and programmers th

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 8:10:02 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > For a class one can override NewInstance and FreeInstance. And with > TVirtualMethodInterceptor (I think not yet implemented in FPC) it might > even be possible to replace these on an existing cla

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 8:06:44 PM, Martin Frb via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > NOTE: the below is NOT about ARC. It is about the implication that ARC == > Safety (in the environment that we have) > Not following "in the environment that we have”. I’m just saying manual memo

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 7:24:15 PM, Martin Frb via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Who is forcing *everyone* ? > > To the day, that person has not knocked on my door. Am I the last free > (not forced) person on the planet? > I mean if there are two version of the RTL to be main

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 7:37:15 PM, Martin Frb via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Because if the latter, well I know some people who would shot the person > introducing that in a high performance software... > yes it’s bad except for UI apps which is what FPC and new users see

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 8:06:56 PM, Rainer Stratmann via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Sorry, but if you start then you start with a simple program and then you > have > to gain experience over time. That is the same case everywhere. > > There is a german sayword "Es ist noch

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 9:15:10 PM, Rainer Stratmann via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I really can not see where beginners have to struggle with memory > management. > If a project gets bigger you have to think about it, yes. It depends on the > coding style. In my project I

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-19 Thread Hairy Pixels via fpc-pascal
On Oct 19, 2024 at 9:37:49 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Counterexample 1: The growth of Rust. > which is the opposite of Pascal, total memory safety. Rust is one of the reasons that show people don’t want bug prone manual memory management anymor

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-20 Thread Hairy Pixels via fpc-pascal
On Oct 21, 2024 at 7:54:22 AM, Bernd Oppolzer via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > 3. Standard Pascal has only pointers, which point to the heap and are > created by the NEW procedure. > I am the maintainer of another Pascal dialect (Stanford Pascal) - and, > like many other

Re: [fpc-pascal] What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 17, 2024 at 4:12:08 AM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I have proposed this to the FPC core team, after some insistance I managed > to get a list of constraints from (if memory serves well?) 1 person. > > I admit I was put off by what I perce

Re: [fpc-pascal] Fwd: What to do to get new users

2024-10-16 Thread Hairy Pixels via fpc-pascal
On Oct 17, 2024 at 12:03:47 AM, Guillermo Martínez Jiménez via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Prease DON'T add garbage collector. IMO it isn't a good idea. I had > very bad experiences with it. Unless somebody found a new magic > algorithm in the last decade... > I used

Re: [fpc-pascal] What to do to get new users

2024-11-29 Thread Hairy Pixels via fpc-pascal
On Nov 29, 2024 at 8:11:11 AM, James Richters via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I'm intrigued by FPGUI, I'm trying to build FPGUI on Windows 10, and I'm > having some difficulty. When I follow the instructions from Install.txt I > get this: > This is very much on topic.

Re: [fpc-pascal] What to do to get new users

2024-11-17 Thread Hairy Pixels via fpc-pascal
On Nov 17, 2024 at 7:57:07 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > - how about allowing the same AS in unit declarations so we can do > something like [unit MyUnitWithABigName AS MyUnit] and then use > [MyUnit.TSomeClass] — this can already be done with MACROS, s

[fpc-pascal] GetMem slow in threads

2024-11-09 Thread Hairy Pixels via fpc-pascal
I diagnosed a threading performance problem down to merely calling GetMem. I did a test and it was 4x slower to call GetMem on 8 threads (my computer core count) than one thread. Due the large amount of allocations in the program it was actually slower to multithread the task. I assume the problem

Re: [fpc-pascal] What to do to get new users

2024-11-15 Thread Hairy Pixels via fpc-pascal
On Nov 15, 2024 at 9:23:41 PM, Steve Litt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > First of all, Joanna on #fpc (and other fpc related IRC channels) has > blown off over 100 potential fpc users, including myself. I'm learning > Ada now, and liking it a lot. > what authority doe

[fpc-pascal] Power operator fails in ordinal range definition

2024-11-13 Thread Hairy Pixels via fpc-pascal
This gives me "Error in type definition”. A bug? type TMyRec = record type T = 0..256**4; end; Regards, Ryan Joseph ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-p

Re: [fpc-pascal] What to do to get new users

2024-11-24 Thread Hairy Pixels via fpc-pascal
On Nov 24, 2024 at 4:21:21 PM, Michael Van Canneyt wrote: > Great work. This is exactly the kind of thing I was talking about. FPC team > should take notice. > > We do. Well, I did :). Request to Iwan, he have some new changes for “extended RTTI” like Delphi has and it would be nice to have an

Re: [fpc-pascal] What to do to get new users

2024-11-23 Thread Hairy Pixels via fpc-pascal
On Nov 24, 2024 at 4:12:03 AM, Iwan Kelaiah via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Hello, > > I'm not sure, but I am working on this one: > https://ikelaiah.github.io/free-pascal-cookbook/, and it mentions how to > install FPC and use FPC for common tasks for newcomers. > Gre

Re: [fpc-pascal] What to do to get new users

2024-11-30 Thread Hairy Pixels via fpc-pascal
On Nov 30, 2024 at 3:11:10 PM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > This is very much on topic. FPC has no build system > > Huh ? Of course it does, it has 2. fpcmake (older) and fpmake. > > Please don't spread incorrect information. > sorry but it’s not

Re: [fpc-pascal] What to do to get new users

2024-11-30 Thread Hairy Pixels via fpc-pascal
On Nov 30, 2024 at 11:54:21 PM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > sorry but it’s not really part of the compiler, just something that > generates commands it feeds to the compile right?. aren’t new compilers > doing away with this design and integratin

[fpc-pascal] Printing unicode characters

2024-11-30 Thread Hairy Pixels via fpc-pascal
ChatGPT is saying I can print unicode scalars like that but i don’t see it works and no compiler warnings even. Did it make this up or did I do something wrong? Writeln('Unicode scalar 1F496: ', #$1F496); // 💖 Writeln('Unicode scalar 1F496: ', WideChar($1F496)); // 💖 Regards, Ryan Josep

Re: [fpc-pascal] Printing unicode characters

2024-12-01 Thread Hairy Pixels via fpc-pascal
On Dec 1, 2024 at 2:23:08 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Here's how Free Pascal types map to Unicode terminology: > > WideChar = UTF-16 code unit > > UnicodeString = UTF-16 encoded string > > WideString = UTF-16 encoded string. On Windows it's not r

Re: [fpc-pascal] Power operator fails in ordinal range definition

2024-11-13 Thread Hairy Pixels via fpc-pascal
On Nov 14, 2024 at 1:53:17 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > The **-operator is not *implemented* by the compiler. It's provided > through the Math unit. Thus you can't use it in constant declarations. > Why is that? That means you can do powers in types o

Re: [fpc-pascal] What to do to get new users

2024-11-16 Thread Hairy Pixels via fpc-pascal
On Nov 16, 2024 at 7:24:01 PM, Michael Van Canneyt wrote: > That said, the Free Pascal website is not about the pascal language. > > It is about the compiler. The GNU compiler or LLVM C compiler also do not > contain code on their website. Not that I would recommend their sites, but > these tool

Re: [fpc-pascal] What to do to get new users

2024-11-16 Thread Hairy Pixels via fpc-pascal
On Nov 16, 2024 at 9:46:25 PM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > You never heard of Delphi, ElevateWeb, Smart Mobile Studio, PascalScript, > OxyGene ? > There are some others, can't recall the name. There is a Russian version, > called abcpascal or som

Re: [fpc-pascal] Power operator fails in ordinal range definition

2024-11-14 Thread Hairy Pixels via fpc-pascal
On Nov 14, 2024 at 8:11:53 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Because it wasn't deemed necessary that the compiler itself provides this > operator. > You can use it to create ordinal types from bytes using a generic. I was trying to do something like this.

Re: [fpc-pascal] What to do to get new users

2024-11-16 Thread Hairy Pixels via fpc-pascal
On Nov 16, 2024 at 3:13:26 PM, Nikolay Nikolov via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > If you know nothing about the language, the main page explains to you > quickly what's the point of the language, and gives you example code, so > you can immediately see how it looks like. T

Re: [fpc-pascal] Printing unicode characters

2024-12-01 Thread Hairy Pixels via fpc-pascal
On Dec 1, 2024 at 2:02:06 PM, Adriaan van Os via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > They call that "Unicode", which is plain nonsense. In the real world, one > can not stuff 21-bits > into 16-bits. > > For heaven's sake, let's stop talking about so-called "Unicode" and > inste

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-05 Thread Hairy Pixels via fpc-pascal
On Dec 5, 2024 at 12:27:37 AM, Michael Van Canneyt via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Yes, this is still on my todo list. The main problem is to have a really > minimal example that demonstrates the issue. (and with minimal I mean > something that doesn't require half the

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-04 Thread Hairy Pixels via fpc-pascal
On Dec 4, 2024 at 6:22:12 PM, James Richters via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > I don’t know what causes this, but I have experienced the same issue. > Just loading the IDE takes like 30 seconds on a version I installed in 2023 > and another in early 2024, and those also c

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-04 Thread Hairy Pixels via fpc-pascal
On Dec 4, 2024 at 6:29:36 PM, Hairy Pixels wrote: > I’m going to have to rollback and use my old version because it’s not > usable like. Event going to 4 second build times if you change a single > line is too painful. > and I just tried to rollback and the compiler crashes now on a particular

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-04 Thread Hairy Pixels via fpc-pascal
On Dec 4, 2024 at 6:29:36 PM, Hairy Pixels wrote: > My only thought is that my project makes extensive use of multi helpers > and implicit function specialization both of which were causing serious > crashes in the compiler (I think they were the cause at least). I’m talking > you change a top

Re: [fpc-pascal] Incremental compiling not working in new version

2024-12-04 Thread Hairy Pixels via fpc-pascal
On Dec 4, 2024 at 8:13:08 PM, Sven Barth via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > The likely candidate is the reworked module loading that still has its > problems. > > @Michael: do you think you can take a look? I also got the feeling that it > tries to compile more while nothi

Re: [fpc-pascal] Procedural parameters

2024-12-15 Thread Hairy Pixels via fpc-pascal
On Dec 15, 2024 at 5:15:33 PM, Jonas Maebe via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > It's because unlike in Borland Pascal, procvars in ISO Pascal captured > the stack frame and allowed you to access local variables of the caller. > By only allowing the declaration in the procedu

Re: [fpc-pascal] Procedural parameters

2024-12-14 Thread Hairy Pixels via fpc-pascal
On Dec 15, 2024 at 12:21:29 PM, Adriaan van Os via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > You mean the original pascal only allowed function declarations to be > parameter types? > > Yes. And it is still true in the ISO 7185 Pascal standard. > That doesn’t make any more sense tha

Re: [fpc-pascal] Procedural parameters

2024-12-15 Thread Hairy Pixels via fpc-pascal
On Dec 15, 2024 at 6:28:25 PM, Hairy Pixels wrote: > Also noteworthy is ISO standard can accommodate generics which Borland’s > design can not. Wait, I’m wrong on this, you can use generic proc types. The problem with generics are pointers to T. For example that below is not possible. type

Re: [fpc-pascal] Procedural parameters

2024-12-15 Thread Hairy Pixels via fpc-pascal
On Dec 15, 2024 at 11:19:40 PM, Sven Barth wrote: > It's not as if it is impossible to workaround this limitation: > > === code begin === > > program tpointerrec; > > {$mode objfpc} > {$modeswitch advancedrecords} > > type > generic TPointer = record > type > PT = ^T; > end; > > gene

Re: [fpc-pascal] Procedural parameters

2024-12-14 Thread Hairy Pixels via fpc-pascal
On Dec 15, 2024 at 1:22:25 AM, Adriaan van Os via fpc-pascal < fpc-pascal@lists.freepascal.org> wrote: > Similarly, you also cannot write: > function A(B : (one,two,three)) : double; > > Not really. The function type declaration is a Borland invention, not > original Pascal. > > Regards, > > Adri

[fpc-pascal] Incremental compiling not working in new version

2024-12-03 Thread Hairy Pixels via fpc-pascal
I just noticed I didn’t update my compiler since 2023/03/03 and finally did so today. After making some required changes I noticed the compile times went down from basically instant (after being fully built once) to taking 4+ seconds every build. Looking at the output it looks to me like it’s not

<    1   2   3   4   >