3 ms·
Well you have said what I always think. For those familiar C# feels like the next iteration of Delphi, but with curly braces. Both Delphi and Free Pascal haven'
by sysrpl 6y ago
Well you have said what I always think. For those familiar C# feels like the next iteration of Delphi, but with curly braces. Both Delphi and Free Pascal haven't stopped though. They've added generics, extension methods, attributes, and many of the other features that have also been added onto C#.
Free Pascal has gone further to add management operators, vector math intrinsics, and improved array features.
- Koshkin 6y ago> with curly braces ...and .NET in tow.
- yjftsjthsd-h 6y agoYeah, FPC can target an absurd collection of systems; can C# handle that level of portability?
- madhadron 6y agoOnly in the same way as Java can (run the .NET VM) and the GUI story is far less clear.
- int_19h 6y agoEarly .NET also copied liberally from VCL. The entire System.Windows.Forms namespace, with base classes like Component and Control, feels very familiar to anybody who made GUI apps in Delphi before.
- unnouinceput 6y agoDelphi has those too, and with latest iteration (read May 2020) they added inline variable declaration (which on Free Pascal will raise a syntax error)
- badsectoracula 6y agoNote that inline variable declaration had been discussed at the past by the Free Pascal developers and was rejected by most of them - this is a (rare) case where they decided that they wont follow Delphi. Reasons, IIRC, are mainly due to how weird the syntax is and it feels too un-Pascal-ish to have mixed declarations and code (in Pascal pretty much everything is declared in its own section) and with Pascal supporting nested functions/procedures and the IDE being able to autocomplete variable declarations for you, it is more of a code smell than something necessary.
- unnouinceput 6y agoFrom what I've read/understood, the reason Delphi folks decided to do this is to allow even better compiler optimization. This way it's easier for optimizer to see the local variable needs to be a CPU registry and no memory access, speeding its performance.
- badsectoracula 6y agoHm, i guess this depends on the compiler, but if that was the case then first use should be enough to figure out this. I guess classic Delphi had a very simple compiler so perhaps it needs this, but AFAIK modern Delphi has an LLVM backend whose optimizations shouldn't be affected by variable placement. In any case, i think Free Pascal does have variable lifetime analysis so its optimizations shouldn't need that either.