9 ms·
"You can also define your own types", "classes can also inherit other classes", "Pascal is modular"... Not to say these are not valid reasons, or expectations
by V-2 9y ago
"You can also define your own types", "classes can also inherit other classes", "Pascal is modular"...
Not to say these are not valid reasons, or expectations one may have from a language, but - what exactly is Pascal being compared to? I mean, it's 2017.
- oblio 9y agoWell, C is still top-5 in all the programming language rankings I've ever seen, so... :)
- V-2 9y agoOK, but "it's not C" doesn't really make Pascal stand out ;)
- leledumbo 9y agoC has its root buried deep in programming world. A lot of things were written in C, big things, that people don't want to touch but they have to use. It's no longer as popular as, say 5 years ago. Along with Java, the popularity is being decentralized as communities of other languages get stronger (including Pascal).
- TremendousJudge 9y agoneither javascript nor C++ are modular in 2017
- mdhughes 9y agoC has no classes, and everything's in one global namespace. Scheme & LISP have no built-in classes, and one can argue that CLOS isn't what we normally describe as OOP. Both normally have a global namespace. Inheritance in JavaScript is possible but very hard to implement correctly before ES6. Node has namespaces (sort of) but client-side JavaScript generally doesn't. PHP in theory has namespaces, but the standard libraries are just dumped in global.
- ansible 9y ago... and one can argue that CLOS isn't what we normally describe as OOP. Well, yes, though I consider it far superior to most other object systems out there.
- V-2 9y agoI'm not saying these are features provided by every modern programming language - obviously eg. there are FP languages that are not object-oriented, as you pointed out. Still, the selection of languages that do is so vast that such reasons hardly answer the question "why Pascal, of all the options".
- mdhughes 9y agoThere are only a few "popular" languages that have both, many that don't; those are not mandatory features for everyone. I care about performance (ruling out any GC language), multi-platform native binaries, language readability, dev community, and a bundle of other factors. Pascal turns out to hit most of my needs and not annoy me too much. Of the thousands of more obscure languages, I'm sure there's one that'd be perfect, except I'd have a worse time with libraries.
- emodendroket 9y ago> I care about performance (ruling out any GC language) [Citation needed]
- CiPHPerCoder 9y ago> PHP in theory has namespaces, but the standard libraries are just dumped in global. Modern PHP development almost exclusively uses Composer libraries rather than the standard libraries, which overwhelmingly use namespaces in Vendor\Project format. There's going to be a push to clean up the standard library in the coming years. The plan is to introduce a namespaced alternative to the standard library in the global namespace which also cleans up a lot of nits (e.g. phpsadness.com posts). Maybe in PHP 8? Then when the ecosystem catches up, we can discuss deprecating/removing the "just dumped in global" way of doing things in PHP 9. Source: I'm very likely going to be the main person driving this push.
- oneweekwonder 9y ago> Not to say these are not valid reasons, or expectations one may have from a language, but - what exactly is Pascal being compared to? I mean, it's 2017. I have been searching for it for 15 min now, but last month or so on hn there was a article comparing programming languages and compilers. fpc performance was comparable to c. Also a mvp production exe will be 2.5 MB, no stdlib/.net/qt needed.
- cies 9y ago> 2.5 MB, no stdlib/.net/qt needed. This is a pro of Pascal then :) I was also looking for the pros of Pascal in contrast to what we've come to expect of languages while skimming the article.
- oneweekwonder 9y agoLazarus on ubuntu and windows is usable, i'm still struggling with macOS and there is legends and lore of ios/android support. It even seems to support qt, but I have not went there yet. Something else to mention about lazarus is you can hot compile the ide too add in components, fix issues; While using lazarus. It takes a couple of minutes to recompile and there a fail safe cli method to restore. But rather amazing if you wonder how long it takes to compile visual studio professional or qt. http://wiki.freepascal.org/IDE_Window:_Configure_Build_Lazarus#The_Parts http://wiki.freepascal.org/IDE_Window:_Configure_Build_Lazar...
- cies 9y agoThat's some interesting pros! Thanks man.
- vram22 9y ago>Also a mvp production exe will be 2.5 MB, no stdlib/.net/qt needed. And a hello world Free Pascal EXE can be as small as 57KB: $ dir fpc_hello.exe 07/26/2016 09:43 PM 57,402 fpc_hello.exe Source and output: $ type fpc_hello.pas program hello_1; { uses ; } var i: integer; BEGIN for i := 1 to 10 do begin writeln(i:4, ' Hello from Free Pascal'); end; END. $ fpc_hello 1 Hello from Free Pascal 2 Hello from Free Pascal 3 Hello from Free Pascal 4 Hello from Free Pascal 5 Hello from Free Pascal 6 Hello from Free Pascal 7 Hello from Free Pascal 8 Hello from Free Pascal 9 Hello from Free Pascal 10 Hello from Free Pascal I also checked the size of similar programs in C and D. C was about 22KB, IIRC. D was something more, don't exactly remember, but not a lot more, probably.