[fpc-pascal] Stack alias for ARC like memory management?

Ryan Joseph ryan at thealchemistguild.com
Wed Apr 25 15:38:33 CEST 2018



> On Apr 25, 2018, at 8:06 PM, Marco van de Voort <marcov at stack.nl> wrote:
> 
> Fundamental changes in the object model are never minor. Delphi/Object
> Pascal does not allow static objects, so that is a big thing.

I guess I’m not seeing this same way as others are. It seems like if we have a stack of static memory we should we able to use that instead of GetMem if we want to (like is possible for all other types). GetMem just find a memory address from RAM so why can’t there be a function that finds a memory address from the stack? In my mind I’m seeing this as a transparent implementation detail that the class handles for you inside the class method which allocates the classes internal pointer. Something in me says that we have this memory mapped at compile time so we should be able to access it. 

well having said all that I understand why it’s easy to dismiss because it’s frankly one of dozens of new features you could add to FPC.
> 
>> All the talking about manually memory management is a thing of the past
>> for most programmers out there today.  Pascal will get left behind but it
>> can still survive as a low-level performant language like C++ so that?s
>> where my motivations are for Pascal.
> 
> Maybe, but then I think creating a new dialect that takes these features to
> the core is preferable, rather than some crutches to a dialect/compiler with
> a different bent. Because you risk having the worst of both worlds
> otherwise.

Certainly this is a crutch because there isn’t a full ARC system. I see it as an easy solution and a quick fix to get a little more utility out of the language without overhauling everything. Are there actual plans to make a new dialect of FPC? At this point I don’t know what the language would need to do to make it competitive with new entries into the market. Even if it was easy to use Pascal in Xcode and make iOS apps with native frameworks I don’t think new users would trade Swifts ease of use for a faster, albeit cumbersome old school language like Pascal.

Regards,
	Ryan Joseph



More information about the fpc-pascal mailing list