6 ms·
In my experience Free Pascal, that is what the article refers to as "modern pascal", is a great language and compiler. It compiles to native code, to JVM byteco
by sysrpl 6y ago
In my experience Free Pascal, that is what the article refers to as "modern pascal", is a great language and compiler. It compiles to native code, to JVM bytecode, and there is even a tool to transpile to Javascript.
Unfortunately it suffers from a stigma inherited from it's origins as an old "teaching you how to code" language rather than a real language. Never mind the fact that Delphi (the precursor to "modern pascal") was the brain child of Anders Hejlsberg before he was snatched from Borland by Microsoft, when Anders had remade Turbo Pascal (already great) into a fantastic product. Bill Gates said "The only thing wrong with Delphi is that it's not made by Microsoft".
In short, Free Pascal a fantastic multi platform language and compiler, but suffers from a lack of popularity due to being considered something old and not very modern, even though it has all the modern features one might need.
- unnouinceput 6y ago"..remade Turbo Pascal..." - translation: C#. Yup, that's right, C# is a clone of Delphi and then some. Anyone knowing Pascal will have no problem jumping to C# because it will swim in familiar waters, only difference is that being a Microsoft product has C style syntax.
- sysrpl 6y agoWell 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.
- boznz 6y agoAnyone knowing pascal will have made the jump to C# in 2006, everyone left are quite happy with Pascal, nobodies going to make the jump in 2020 IMHO
- rishav_sharan 6y agoIs this some inside joke that I am not getting? C# is nothing like Pascal. Java is the language closest to C#.
- SideburnsOfDoom 6y agoOne person, Anders Hejlsberg, was a leading architect on Delphi and then on C# His work on C# is widely thought to be a continuation of his work on Delphi. https://en.wikipedia.org/wiki/Anders_Hejlsberg https://en.wikipedia.org/wiki/Anders_Hejlsberg
- mhd 6y agoThere's also plenty of other cross-pollination, e.g. the influence that Cedar or even Modula-3 had on Java. Still, I can understand the issues. Let's not forget that despite his work in the field, Hejlsberg isn't Mr. Pascal, that would be Niklaus Wirth. Who always had a way more minimalistic design perspective than others, starting with Algol-W and ending with Oberon-7. Comparing that to the kitchen sink approach of C# (and arguably even Object Pascal) shows two philosophies that can hardly be more different.
- SideburnsOfDoom 6y agoI think that Delphi took a bit of a "kitchen sink" approach when compared to classic Pascal, for practical reasons of being most useful to a working programmer, rather than being academic. Specifically the infamous yet influential essay "Why Pascal is Not My Favorite Programming Language" has a laundry list of reasons why academic Pascal is hard to use "for serious programming", and many of them have been corrected in Delphi.
- pjmlp 6y agoMany of them were already corrected in ISO Extended Pascal, UCSD Pascal and Apple's Object Pascal, before Borland happened.
- badsectoracula 6y ago
- pjmlp 6y agoFirst he did J++, though.
- brnt 6y agoAs an IDE, Freepascal does seem dated, not including many details that we've gotten used to in recent decades. The language itself feels also frozen in the early 00's, have a look at string handling for instance. Very verbose methods, and a problem that's true for the Freepascal dialect in general: small incompatibilities with Delphi Pascal, the dialect any old veteran will be used to and as such also much documentation/discussion online. Add to that a near invisibily in places like Github, and it does not make for a very attractive platform, compared to some others. Freepascal/Lazarus has a nice forum, and if you happen to be working in the same niches as other guests, that may be enough, but otherwise... I also couldn't help but notice that the practices passing around zipped code bases/fragments is alive and well on there, mirroring the culture of small but closed source tools the Delphi ecosystem was famous for around 2000. While friendly, very dated and 'source hidden' in its ways.
- badsectoracula 6y agoThe textmode IDE is largely a fallback for platforms that Lazarus doesn't support yet, pretty much everyone nowadays uses Lazarus which is very featureful (and very fast, IMO it puts pretty much other IDE to shame considering the functionality it has and its responsiveness and resource requirements). Verbose methods are a convention that you'll find in other languages too (e.g. Java and C# and also some C++ projects). What is the issue with string handling? Free Pascal has several language modes, one of them being Delphi which should be compatible enough to share and port code between the the two compilers (though the default mode in Lazarus is ObjFPC which is different and IMO the better mode). In practice the differences are small enough that unless they refer to very internal stuff (e.g. memory layout of RTTI data), anything you find online about Delphi also applies to Free Pascal (assuming of course that FPC has implemented the functionality, but since you refer to old veterans, i think everything those veterans and old discussions will be there). I'm not sure what you mean with passing around zipped codebases, there are a ton of projects on GitHub. And how can a codebase be 'source hidden' when it is available as a zip?
- brnt 6y agoI did mean Lazarus. Just the text editor component feels alien. Things like block selection by default. It just doesn't work the same as any other text edit component I've ever used. The issue with string handling is (or was) that there seem to be different string types but that 'string' is used to describe all of them. Some of those methods require or produce ASCII, and it may be difficult to know what your problem is when you have one The language modes suffer from incomplete support. The differences aren't large,but that does mean they re easy to fix. My previous employer, a Delphi shop for more than 2 decades, was unable to be compatible with Freepascal over some of these issues. With limited source I mean that things like history will not be there, or its just a single file of part of a single file bundled up, so you're missing out on context. All makes it hard for a newbie, even for someone with some experience.
- pjmlp 6y agoActually he decided to go to Microsoft after being disillusioned how things were going at Borland. Also what people keep forgetting, J++ was actually what he first did after joining Microsoft.
- pjmlp 6y agoSince I cannot edit it any longer, here is one of the podcasts where he mentions it (first episode). https://www.microsoft.com/en-us/behind-the-tech https://www.microsoft.com/en-us/behind-the-tech
- badsectoracula 6y agoOne thing i find interesting about J++ (i have Visual J++ that came with VS6, though i never used it myself - and i do not think it even works in modern Windows) is that it also had its own relatively big framework that pretty much died with the language. It is like this language was made, existed for one or two versions and then the entire effort was thrown out of the window.
- pjmlp 6y agoThey couldn't have done otherwise given Sun's lawsuit. If you read Ext-VOS paper and the history of F#, that was how the upcoming COM Runtime was rebooted to use a managed language runtime. Hence why when one knows all these puzzle pieces, UWP seems so close to what they were trying out back then.
- int_19h 6y agoIIRC parts of that framework were the basis for .NET libraries, e.g. WFC -> System.Drawing / WinForms. Just compare the class names: https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-6.0/aa286472(v=vs.60) https://docs.microsoft.com/en-us/previous-versions/visualstu... https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms https://docs.microsoft.com/en-us/dotnet/api/system.windows.f... https://docs.microsoft.com/en-us/dotnet/api/system.drawing https://docs.microsoft.com/en-us/dotnet/api/system.drawing