I was tasked with building a small utility for copying out a few GB of files from a super-complicated folder structure, and convert it into a different structure, with the requirement that it should have an interactive GUI (to do various selections interactively), and run natively on Windows and Mac.
Couldn't have found an easier route than to build this in FPC with Lazarus.
Even though I had hardly coded a line in the language before, it was built from scratch to "happy end-user" in 80 hours, including learning the language.
I built it on Xubuntu, then imported it on my Windows VM and compiled, WITHOUT A SINGLE CHANGE! On Mac, I needed to add a missing import statement or so.
Simply an outstandingly productive tool for open source, cross-platform GUI development.
Btw, a shoutout to the awesome OmniPascal project, which allows you to write Delphi and FreePascal in the Visual Studio Code editor (when you are not building GUI apps, and and/or don't need a full blown visual IDE, or just for navigating around in legacy code bases): http://www.omnipascal.com
Unfortunately, code completion is so far only available on Windows [1], but will hopefully come in due time (you can vote for the issue in [1]).
(Correction: A few hundred GB of files actually ... an extraction took like 7-8 hours in total, so the progress bar was kind of crucial for the users :) )
Nice little intro, everything there would compile fine with Free Pascal on Linux, Windows or OSX
BTW Shoutout to the FreePascal/Lazarus team, the improvements over the past 12 months have been great and finally convinced me to make the move from Delphi. I even created my first Real Linux desktop program two months ago to replace an XP status display screen in a factory.. A real big step for me :-)
This is interesting - I knew work was ongoing on FPC/Lazarus - but not so much that it might draw people away from Delphi. Could you say something more about what you used to miss, that's now available - and how you use Delphi/Pascal?
Wonderful! I've long been a fan of end-of-life Turbo Pascal and Object Pascal thereafter. I love the language's simplicity, type safety, and speed. To my eye, Object Pascal is the goto language for minimalist OOP. In the spirit of C, it's short, sweet, and sufficient.
I worked with different versions of Delphi for 7 years. I miss it sometimes. The language was quite good, but people would always judge it because of the IDE that made it "too easy"
But why. I don't understand why you'd use Pascal today when you could use C++. I jumped over 25 years ago and never missed Pascal the language, only the Turbo Pascal development environment. Many languages later I still have never wanted to go back and write in any Pascal variant. It's a verbose, weak, and inexpressive language.
Compared to any other OOPL, C++ is simply ghastly -- a grossly overcomplex mishmash of hacks in the key of C inspired to repent for the multitude of sins that historically bedeviled C, and have since led to a never ending cascade of ill-fated hacks to shoehorn a nearly 50 year old unsafe high level assembly language into the guise of a modern type safe OOPL. History has since shown this to have been a tragically quixotic quest which inevitably and catastrophically spun wildly out of control, mutating and metastasizing into a disgusting chimeric monster that now strikes fear and loathing into the soul of even the most stouthearted digital denizen, who only when lit by the faint glow of a failing CRT, oft have been heard to admit furtively and only under duress in the faintest of whispers:
I agree about the IDE of Turbo Pascal, but Delphi 1.0 was pretty RAD too. Only thing I don't like about Pascal of 20 years ago was the lack of proper lists and dictionaries, and the tedium of writing long keywords like begin and end all over the place.
If only programming had gone that way. It almost did. The original Macintosh was programmed mostly in Apple Pascal. Wirth's original Pascal had some serious limitations, which led to far too many Pascal variations. Unfortunately, none of them won out over C.
This is like a blast from the past. My first interaction with programming was with Borland Delphi 6 which had its own dialect of Object Pascal. Poor internet connection and no stackoverflow had me figuring out programming on my own, mainly by using Delphi's help books and looking at code examples. Which is probably why I eventually lost interest - I couldn't figure out complex OP concepts on my own at that age.
Fast forward to the present, I really envy the people learning programming today for the first time. The amount of possibilities and resources now is many orders of magnitude bigger, making learning so much more enjoyable.
I had a memory lane trip few months ago. Got to run turbopascal 7.0 in dosbox. It's an amazing piece of software. The included help is great. And the language was deceptively simple. I didn't understand the value of intervals, set types, even ordinals (succ and prec)... Pretty neat.
Small sidenote: even QBasic was amazing for a free code environment in these days. The language is bare, but QBasic had some form of modularization. I thought nothing of it at the time, but it feels they tried to make people think in terms of isolated "objects" not large source files full of global variables.
Does anyone use Pascal for web development (cgi, dynamically generated web sites)?
I would love to use a fast, low-memory, natively-compiled, strongly typed language with a clear, readable syntax. Pascal meets all these requirements.
Golang is the other language I'm considering. It has many web-related libraries, excellent documentation and a lot of momentum. Free Pascal, unfortunately suffers from fragmented documentation (the wiki is often out-of-date and hard to navigate). Despite that, I still prefer Pascal syntax over Go (yes, really).
So, if you are using Pascal for web development, what has been your experience? Would you recommend it?
The IDE/compiler/web server used in Elevate Web Builder were written using Delphi. We've also written two small database engines, as well as two ODBC drivers and a .NET data provider, using Object Pascal and Delphi. Object Pascal is a very versatile and useful language that allows you to write applications that do just about anything from front-end UIs to back-end server code. Being able to debug server-side code in the IDE is a life-saver and allows one to get to the root of any coding issues immediately.
FreePascal is also equally nice, albeit a little rougher around the edges in certain places. But, every year it gets better and more polished and has come a very long way since its humble origins.
I'm considering building a high performance pascal wrapper around libuv, which should let me get the same pipeline performance that you can currently get out of asp.net core's "kestrel" web server. In a word, fast. Right now if people are using Indy as their HTTP component they will first of all have some strong limitations on what they can do with certificates and https, and secondly they will not have a very fast stack.
I do. I don't use CGI, though. As I find the embedded web server is more reliable. However, changing between CGI, FastCGI amd embedded server is a matter of changing a single uses clause entry.
It's applicable for both the preshipped fpWeb and Brook, which is my choice of web framework due to its simpler and shorter hand coding.
The feature you really want for web-development is closures. I can't imagine writing event-handling code without them. As far as I know, Pascal does not have closures.
Unfortunately, with closures you need good memory handling. And this means either a complicated type-system such as Rust's, or a garbage collected environment. The way C++ does closures is too dangerous for event-driven code, imho.
Manual memory management is the weak point of Pascal. It limits functions to never returning newly constructed objects, which really limits the expressiveness of APIs both in the standard library and in custom code.
The manual reference counting system in old objective-c provides a better solution which while still cumbersome, doesn't prevent good powerful APIs.
The automatic reference counting capability of Delphi interfaces always seemed like a good idea to me, but seems to be rarely used.
> It limits functions to never returning newly constructed objects, which really limits the expressiveness of APIs both in the standard library and in custom code.
How? Set the return type of the function to be the object type you want, then result := TYourObjectType.Create; and you'll return a newly constructed object.
Note that Free Pascal does have automatic reference counting for interfaces, although it is not a good idea to use it for memory management because (like with Delphi) it is very easy to pass around an instance that isn't counted and end with memory leaks.
However one of the compiler's designers has an experimental branch which allows you to mark classes as being automatically managed and any instance and use of those classes becomes reference counted. So at some point it might become part of the main compiler (although it is probably far from now since AFAIK it isn't something people really ask for from FPC and there are other things to do).
Interesting with the new FreePascal and Lazarus foundation, which was just started a week ago, to support development of it as an alternative to Delphi [1] (Source [2])
I assure you, it can. Be it through API, custom socket protocol, bindings, no problem. When one doesn't exist yet, creating yourself is not a big deal.
It's a nice thought, but Pascal's age and its verbose (but highly readable) syntax means that many programmers will never give it more than a passing glance (regardless of the modern features it has to offer).
Last time I've been programming on Pascal was almost 20 years ago, just before I've learned Java. The Delphi was a breakthrough in 90s, but today, when we have MLoC-size apps, this language is just too outdated, fighting the wars of the past and preserving some unnecessary legacy. Memory management? Dependency management? Reflection and generative programming support? There are some things, of course, that are still nice to have in languages like Java (I liked the class helpers), but, thinking about development productivity and code quality, I'm not sure this can be called anything else but a steampunk toy, as modern as contemporary replica of some Art Nouveau thing.
If you haven't touched Pascal in 20 years you should refrain from making comments about the language not being fit for development productivity and code quality, it simply isn't true.
The vast majority of apps today are still small, and certainly nowhere near MLoC-size.
It certainly lacks features many of us takes for granted. But people e.g. still write C, that is far more primitive, so if people want to do Object Pascal, why not.
Though it's a shame to see it effectively win over a language like Oberon (if one first is to stay in the Pascal lineage).
[+] [-] samuell|9 years ago|reply
Couldn't have found an easier route than to build this in FPC with Lazarus.
Even though I had hardly coded a line in the language before, it was built from scratch to "happy end-user" in 80 hours, including learning the language.
I built it on Xubuntu, then imported it on my Windows VM and compiled, WITHOUT A SINGLE CHANGE! On Mac, I needed to add a missing import statement or so.
Simply an outstandingly productive tool for open source, cross-platform GUI development.
(The tool: https://github.com/NBISweden/mdc-file-export )
[+] [-] samuell|9 years ago|reply
Unfortunately, code completion is so far only available on Windows [1], but will hopefully come in due time (you can vote for the issue in [1]).
[1] https://bitbucket.org/Wosi/omnipascalissues/issues/6/add-ric...
[+] [-] samuell|9 years ago|reply
[+] [-] boznz|9 years ago|reply
BTW Shoutout to the FreePascal/Lazarus team, the improvements over the past 12 months have been great and finally convinced me to make the move from Delphi. I even created my first Real Linux desktop program two months ago to replace an XP status display screen in a factory.. A real big step for me :-)
[+] [-] dejv|9 years ago|reply
I can't easily migrate my biggest project (25 years in making 300k+ LOC), but I am going to use Lazarus for smaller utilities and new projects.
Currently it is best tool for making cross-platform desktop applications.
[+] [-] e12e|9 years ago|reply
[+] [-] randcraw|9 years ago|reply
[+] [-] hudell|9 years ago|reply
[+] [-] r00fus|9 years ago|reply
Always got pushback, but it was quite maintainable code and it ran fast.
[+] [-] alayne|9 years ago|reply
[+] [-] randcraw|9 years ago|reply
Compared to any other OOPL, C++ is simply ghastly -- a grossly overcomplex mishmash of hacks in the key of C inspired to repent for the multitude of sins that historically bedeviled C, and have since led to a never ending cascade of ill-fated hacks to shoehorn a nearly 50 year old unsafe high level assembly language into the guise of a modern type safe OOPL. History has since shown this to have been a tragically quixotic quest which inevitably and catastrophically spun wildly out of control, mutating and metastasizing into a disgusting chimeric monster that now strikes fear and loathing into the soul of even the most stouthearted digital denizen, who only when lit by the faint glow of a failing CRT, oft have been heard to admit furtively and only under duress in the faintest of whispers:
Ahem. Anyway, that's why I use Pascal.[+] [-] clouddrover|9 years ago|reply
Here are some "whys":
1. https://news.ycombinator.com/item?id=11005203
2. http://ian.hixie.ch/programming/
3. http://ziotom78.blogspot.com/2015/01/lfi-data-analysis-with-...
4. http://freepascal.org/advantage.var
5. https://www.embarcadero.com/products/delphi/features
Object Pascal has changed a lot in the last 25 years. You should check out modern Object Pascal. It's pretty nice.
[+] [-] pjmlp|9 years ago|reply
But the Turbo Pascal 6.0 from 25 years ago certainly was more expressive, feature rich and safer than C of today.
The verbosity of Pascal is welcomed by those that had to maintain programs written by others.
[+] [-] visarga|9 years ago|reply
[+] [-] Animats|9 years ago|reply
[+] [-] solidsnack9000|9 years ago|reply
[+] [-] crypt1d|9 years ago|reply
Fast forward to the present, I really envy the people learning programming today for the first time. The amount of possibilities and resources now is many orders of magnitude bigger, making learning so much more enjoyable.
Edit: grammar
[+] [-] agumonkey|9 years ago|reply
Small sidenote: even QBasic was amazing for a free code environment in these days. The language is bare, but QBasic had some form of modularization. I thought nothing of it at the time, but it feels they tried to make people think in terms of isolated "objects" not large source files full of global variables.
[+] [-] vanilla-almond|9 years ago|reply
I would love to use a fast, low-memory, natively-compiled, strongly typed language with a clear, readable syntax. Pascal meets all these requirements.
Golang is the other language I'm considering. It has many web-related libraries, excellent documentation and a lot of momentum. Free Pascal, unfortunately suffers from fragmented documentation (the wiki is often out-of-date and hard to navigate). Despite that, I still prefer Pascal syntax over Go (yes, really).
So, if you are using Pascal for web development, what has been your experience? Would you recommend it?
[+] [-] TimJYoung|9 years ago|reply
http://www.elevatesoft.com
(it needs a face-lift, for sure)
Our product Elevate Web Builder allows you to write client web applications using Object Pascal and a RAD IDE:
http://www.elevatesoft.com/products?category=ewb&type=web
(examples are at bottom of the page)
The IDE/compiler/web server used in Elevate Web Builder were written using Delphi. We've also written two small database engines, as well as two ODBC drivers and a .NET data provider, using Object Pascal and Delphi. Object Pascal is a very versatile and useful language that allows you to write applications that do just about anything from front-end UIs to back-end server code. Being able to debug server-side code in the IDE is a life-saver and allows one to get to the root of any coding issues immediately.
FreePascal is also equally nice, albeit a little rougher around the edges in certain places. But, every year it gets better and more polished and has come a very long way since its humble origins.
[+] [-] Artlav|9 years ago|reply
I used Pascal to write some web apps, i.e. computer graphics explanations [0], visual philosophy [1], and simple games [2].
It's a nice ability to have - being able to share complex programming as you share written text.
However, i wrote my own compiler that among other things output C, which is then Emscripten-translated to asm.js you see.
This is the complete opposite of an easy, low friction path you'd want for web development.
[0] http://orbides.org/apps/superslow.html [1] http://orbides.org/apps/motion.html [2] http://orbides.org/apps/the_bits.html
[+] [-] wpostma|9 years ago|reply
[+] [-] sevo|9 years ago|reply
docs: http://synopse.info/files/html/Synopse%20mORMot%20Framework%...
forum: http://synopse.info/forum/viewforum.php?id=2
[+] [-] leledumbo|9 years ago|reply
It's applicable for both the preshipped fpWeb and Brook, which is my choice of web framework due to its simpler and shorter hand coding.
[+] [-] elcapitan|9 years ago|reply
[+] [-] martinrame|9 years ago|reply
[+] [-] amelius|9 years ago|reply
Unfortunately, with closures you need good memory handling. And this means either a complicated type-system such as Rust's, or a garbage collected environment. The way C++ does closures is too dangerous for event-driven code, imho.
[+] [-] johnthuss|9 years ago|reply
The manual reference counting system in old objective-c provides a better solution which while still cumbersome, doesn't prevent good powerful APIs.
The automatic reference counting capability of Delphi interfaces always seemed like a good idea to me, but seems to be rarely used.
[+] [-] clouddrover|9 years ago|reply
How? Set the return type of the function to be the object type you want, then result := TYourObjectType.Create; and you'll return a newly constructed object.
[+] [-] revanx_|9 years ago|reply
No it doesn't.
The automatic reference counting capability of Delphi interfaces always seemed like a good idea to me, but seems to be rarely used.
You mean rarely used by people who are amatures, developers have always been pushed towards programming against interfaces.
[+] [-] badsectoracula|9 years ago|reply
However one of the compiler's designers has an experimental branch which allows you to mark classes as being automatically managed and any instance and use of those classes becomes reference counted. So at some point it might become part of the main compiler (although it is probably far from now since AFAIK it isn't something people really ask for from FPC and there are other things to do).
[+] [-] unknown|9 years ago|reply
[deleted]
[+] [-] samuell|9 years ago|reply
[1] http://foundation.freepascal.org
[2] https://plus.google.com/105481197125997414290/posts/FnLvMteQ...
[+] [-] philippeback|9 years ago|reply
I wrote a ton of Pascal a long time ago and always liked OWL for Windows development. Compared to MFC, well, that was much better to they eye.
The main issue to wider adoption is that there are lots of integrations to do in modern applications and I am not sure that FreePascal can catch up.
Still, it is great for coding, as compilation is super fast and one can pretty much understand what's going on.
[+] [-] leledumbo|9 years ago|reply
[+] [-] regularfry|9 years ago|reply
[+] [-] nickpsecurity|9 years ago|reply
https://en.wikipedia.org/wiki/Modula-3
[+] [-] vanilla-almond|9 years ago|reply
[+] [-] ivan_gammel|9 years ago|reply
[+] [-] revanx_|9 years ago|reply
[+] [-] vidarh|9 years ago|reply
It certainly lacks features many of us takes for granted. But people e.g. still write C, that is far more primitive, so if people want to do Object Pascal, why not.
Though it's a shame to see it effectively win over a language like Oberon (if one first is to stay in the Pascal lineage).
[+] [-] vanilla-almond|9 years ago|reply
- fast compilation
- fast program execution
- compiled to small (or smallish) native executables (including GUI apps)
- cross-platform
- low-memory usage executables (does depend on code)
- strongly typed
Now ask yourself: how many modern or popular languages can match all the features above. Surprisingly, not that many.
[+] [-] clouddrover|9 years ago|reply
So high time to give it another look. It's changed a lot in 20 years. Check it out:
1. Free Pascal: http://www.freepascal.org/
2. Delphi: https://www.embarcadero.com/products/delphi
[+] [-] boznz|9 years ago|reply
[+] [-] SmokyBorbon|9 years ago|reply
[deleted]