Pascal in Delphi / Lazarus in its current form is a full featured language that implements large amount of common concepts expected from a modern language. I do not see anything weird in it.
Pascal in Delphi / Lazarus in its current form is a full featured language that implements large amount of common concepts expected from a modern language. I do not see anything weird in it.
They always implement some language feature, but then put some weird, arbitrary restriction on it. It is twice as weird in FreePascal, because the developers cannot decide if they want to make their own language or be Delphi compatible.
Some weirdness examples:
There is automated reference counting to get memory safety, but only for strings and arrays (and also interfaces but we get to that later)
There is mutability xor aliasing, but only for strings
There is a type to store sets of integers, but you cannot have more than 256 elements
There is a type to store a slice of an array, but it can only be used during function calls, so no one ever uses it. Also it looks like it cannot be used with a slice of length 0, unless it is a slice of an array of length 0.
Interfaces are a very common concept in OOP languages. They specify some methods, but not their implementation. Everyone here knows how they work and in Pascal they work in the same way. Except, in Pascal they are also COM interfaces and add automated reference counting to a class. It is weird in the reverse, too. You can have classes with ARC which are almost memory safe, but only if you use an interface.
Array indices start with 0, string indices start with 1. It is already weird, but you can get used to it. But now they added OOP like string functions and it became weirder. Copy(Str, ...) becomes Str.Copy(..). And all the new methods use 0-based indices for strings.
>"they added OOP like string functions" - not sure / forgot what is official name for it but it is not unique to pascal.
Again we have totally different perspective on weirdness.
But I am not a master Pascal programmer by any means. You sound like an expert.
I think in terms of fair amount of languages (including JS) so I do not get hung up on any particular one. My business is product development from scratch. I do it for clients or my own company. Because of that I could not care less about what "most of the world" prefers. I use what I think is most suitable given constraints for each particular project.
Original Pascal was dire at anything except learning Pascal. Strings were type alfa- 10 character strings. Turbo Pascal was the first decent implementation and whipped the pants off its rival UCSD-Pascal. Delphi has been dead though since about 2000 but there's a lot of legacy code around and I'm one of a team of four that look after (maintain and enhance) a 1.35 million Lines of code property management application. A business laptop from 2020 can compile all 1.35 millions lines in around 11 seconds.
Unless you were an ace C++ Windows developer, Delphi was the next best programming language for using the Win32 API and doing low level COM stuff.
It is and it is not. It is used in many industrial companies for example to write windows based desktop applications. I have couple of my own Windows based products that bring some money. Even though those are about 10 years old I keep them up to date with all new technologies that make sense and port to every new version of Delphi. This is actually very easy and does not require much time. There is also more than enough libraries and components to do just about anything. FFS I do interrupt based device control with the rate of 256 requests / s over USB.
Still for servers / NO GUI I very much prefer C++.
It's too bad Modula-2 didn't come along earlier to compete with C. We could have avoided most of the security problems with C and C++ programs.
Instead, here we are, 50 years later, finally moving toward safe languages again. Took long enough.