38

I studied Turbo Pascal in 1997 and I liked it very much as a language. Everything was very structured and the compiler made sure you did things the right way. I later tried Delphi but never got very interested in it.

Since then I've used a lot of different programming and scripting languages (C, C++, PHP, Python, Perl, TCL) and recently I started thinking of my old Turbo Pascal days.

So, I am wondering for what practical purposes Pascal could be useful today and what API's and frameworks are available. Does anyone have experience using Pascal in a modern development environment or is it just a dead language?

To clarify my question: Can Pascal be used for modern application development. Is it being used and how?

Wikipedia links or quick Google searches will not help, I've been there. That is why I am asking the 'experts'.

Andrioid
  • 3,362
  • 4
  • 27
  • 31
  • It would be nice to know why you didn't like Delphi? – tekBlues Jun 08 '09 at 23:11
  • The applications I created in Delphi just always looked kind of ugly and out of place. I also didn't have the necessary background in databases, networking in order to create anything useful. Not Delphi's fault :) – Andrioid Jun 08 '09 at 23:14
  • 1
    Wow Android, you must look at it know, it's very powerful, I just learned to program in Delphi 3 months ago, it's great (the only thing I don't like it's the Pascal syntax :-) – tekBlues Jun 08 '09 at 23:16
  • Heh, on my shelf here I have a little book from Borland called "Teach yourself Delphi 2 in 21 days". Maybe I will :) – Andrioid Jun 08 '09 at 23:18
  • 1
    This questions belongs on programmers.stackexchange.com – TimothyP Dec 27 '12 at 03:32
  • Pascal and Delphi are far from dead. Both Delphi and FreePascal seem to be doing very well, and are being used for projects of any scale, hobby just as well as huge professional software packages. And unlike @tekBlues, I think the syntax is what makes the language so clean and usable. There is hardly any problem I can't express and solve best in Delphi, much better than in any other language I know (and I know many, after 37 years of programming). A good second would only be Python. – Rudy Velthuis Sep 28 '18 at 11:04
  • @Andrioid: Dunno. I have seen beautifully made programs produced in Delphi. The new FMX and several styling options make it even easier to make good looking, easy to use programs. Of course it does depend on your UI design skills too ;-). FWIW, are you not confusing Delphi with Java? Those programs always looked out of place to me. – Rudy Velthuis Sep 28 '18 at 11:10

11 Answers11

35

Note that older (1.0.x) versions of the Free Pascal compiler sources were effectively Turbo Pascal compatible (as in could be debugged with TP), which demonstrates basic Pascal capabilities.

The question of use of Pascal as a basic language is roughly the same as for C, since they are nearly equivalent on a language level. The only difference is the amount, versatily and quality of compilers.

I would strongly recommend to go in the direction of the Delphi dialect though (either using Delphi or Lazarus/FPC), and not go back to Turbo.

The DOS-isms and 16-bitisms would seriously limit you, and nearly the entire dialect that is free from DOS-isms and 16-bititms is supported by FPC or Delphi.

Turbo Pascal was one of the (if not THE) main compilers of the DOS era, and Delphi is still the second most sold IDE in the world (after visual studio), so I think the "dead language" and "teaching language" bits are a bit exaggerated.

JustJeff
  • 12,640
  • 5
  • 49
  • 63
Marco van de Voort
  • 25,628
  • 5
  • 56
  • 89
  • 1
    I like the terms "DOS-isms" and even more "16-bitisms". Otherwise, I fully agree. Modern Delphi and FreePascal are not nearly like TP anymore. They have evolved considerably. **Plain Pascal started out as teaching language, but hey, most people start out as a baby too, and yet most of them evolve.** – Rudy Velthuis Sep 28 '18 at 11:14
  • 2
    FWIW, Pascal did **not** start out as a language to *teach programming*, it started out as a language to *teach compiler building*. The current Delphi and FreePascal compilers are many many times more complex and versatile. – Rudy Velthuis Sep 28 '18 at 11:22
  • Afaik to teach algorithms to math students. There was often no CS as separate department back then, but those math students (with a programming bent) were probably equivalent to CS masters students now. – Marco van de Voort Sep 28 '18 at 11:25
23

An opinion from a satisfied user who switched to FPC from Java/C/C++:

Pascal, Free Pascal (FPC) in particular, is useful for absolutely everything. Application programming with good performance (since it is compiling), game programming (e.g. through OpenGL), and also for web programming since it can compile to Java bytecode. It runs on all important platforms (MS, Linux, Mac, iOS, Android and more).

FPC is highly updated, it is a very modern language compared to the 70's/80's language that some may think we are discussing. It has OOP extensions (including a "Objective Pascal" mode for using Objective-C classes), and OOP is non-mandatory just like C++. It also has operator overloading, function overloading, dynamic arrays, a limited garbage collection, automatic namespaces... Moreover, it is a modular language (like Java), while C/C++ are, after all these years, still non-modular (fakes it with #include). (I would be interested in a serious discussion about what features a "modern" language must have today.)

Did I mention portability? FPC comes with a big runtime library, much of it cross-platform, including a class library (mostly use with Lazarus AFAIK). FPC is highly suited for writing portable code.

As a teaching language, a major advantage is how close it is to C/C++. It really only differs in the most trivial syntax (and different object model) but is really pretty close to C++. Porting between C/C++ and Pascal is easier than porting between ObjC and C++. But FPC has the advantage of being easier to learn, with easier syntax.

So I claim that FPC is perfectly useful both as teaching language and for serious application programming. (I think it is ideal but that is more an opinion.)

There have always been Pascal haters who make uninformed flames usually referring to the 70's original language. Personally I don't think that neither the 70's Pascal nor 20 year old problems (back when portability was the problem) are worth discussing at all. What is interesting is what you can do now, pros and cons between languages beyond "but everybody else does..." arguments.

  • 1
    If there are no libraries with APIs for Pascal, how is it "useful for absolutely everything"? FPC is not "very modern". It lacks type inference, closures, lambdas, memory management, packing/unpacking, multiple assignment, list comprehensions, generators, slice notation, tuples, design by contrast, filter/map/reduce, dicts and lists as native types, bigints, etc. The runtime library does not compare to JVM, .NET or Python. There are no more books, magazines, jobs, live conventions, in most countries, online classes, etc. Why would one choose Pascal today over Python, Nim, D, Go, Rust, etc? – alcalde Aug 25 '15 at 01:50
  • 4
    @alcalde wake up, kid. there are many libraries in Pascal, both shipped by implementations and available from 3rd party sources. even you don't know the language well (you mention Pascal doesn't have memory management which is 100% wrong), don't ever think you can judge the libraries. – LeleDumbo Jan 08 '16 at 09:44
  • 2
    @LeleDumbo There are not "many libraries for Pascal". Torry.net has less than 13000 files, most of those being commercial demos or dating back to Delphi 3-5. Python? Over 72K in its repository. Java? 128K. Go? 106K. node.js? Over 200K! Delphi does not have automatic memory management of objects. I've been programming in Pascal for almost 30 years, I certainly know the language well. One can't honestly defend the language today's viability today without exaggerating. When Amazon ships an API for Pascal, then we can talk about support. Crystal Reports dropped Delphi support after the 1990s, etc. – alcalde Jan 09 '16 at 03:29
  • 1
    @alcalde "Useful for everything" is not true. But "best for some kind of programs" is absolutely true. And I mean BEST. You list things that you think are good, but they are not - at least not always. For example type inference, multiple assignments, memory management. It's lower level than python, for example, but faster and cleaner. Perhaps you are too young to understand? – linuxfan says Reinstate Monica Jan 02 '17 at 18:58
  • 1
    @alcalde Just found this: http://stackoverflow.com/questions/41446833/what-is-the-difference-between-i-i-1-and-i-1-in-a-for-loop -- these ambiguities CAN NOT happen in pascal. – linuxfan says Reinstate Monica Jan 04 '17 at 16:52
  • @linuxfan I'm 44 years old. What am I supposed to not yet understand? No statically typed language has been released in the 21st century without type inference! Even older languages such as C++ are adding it in. There are no computer scientists who preach against it; on the contrary it originated in type theory. Let's not be so wedded to Delphi that we begin calling its drawbacks strengths. Look at what RemObjects did with Oxygene; they were able to bring Pascal into the modern world. They don't preach against modern convenience features. – alcalde Jan 05 '17 at 02:56
  • @linuxfan I'm not sure what your numpy library example is supposed to show. The question involves someone who doesn't understand the difference between the two operators. For a genuine ambiguity, how about "Uses X, Y, Z" and then "SomeFunction(whatever)". What module is SomeFunction imported from? We don't know! I don't see what either of these would have to do with ecosystem support or the lack of modern language features in Delphi. – alcalde Jan 05 '17 at 03:23
  • @alcalde Thank you for the news about Oxygene, I went to see it. I would not call it pascal, but a modern language which stole much syntax from pascal. Syntax - nothing else. You see, I write software for embedded systems; I can write a pascal program which fits in 4K rom and 1024 bytes ram, while I cannot with python, c# or java. And I use pascal to write desktop and internet applications, and they perform better (yes, better) than those written in c#, python or java. Pascal is not simply a syntax, is a high level abstraction of what a computer *really* is. – linuxfan says Reinstate Monica Jan 05 '17 at 07:17
  • @alcalde That said, I've nothing wrong with "modern" languages. I really appreciate elegance and productivity of python, for example. But when I write in pascal or in C, I *know* that if the compiler validates my code, the code will do *exactly* what I wrote. I have full control of everything, and I know everything because the language is precise, transparent and, why not?, simple. This is big value in programming. – linuxfan says Reinstate Monica Jan 05 '17 at 07:24
13

Pascal isn't used for anything practical because the library support isn't there.

What a load of bull. There's a plethora of libraries out there that can be used by Delphi, FreePascal and Lazarus.

As McWafflestix says, there is value in having a simplified environment

"Simplified environment"? That's just derogatory. I would say it is, and has always been, pretty sophisticated.

  • 2
    There are not a "plethora of libraries" available for Delphi/FreePascal. Torry.net, the package collating site for Pascal since the '90s, hasn't quite broken 13,000 packages yet. A great deal of what's there is either written for old versions of Delphi or is trialware. In comparison, Python's package management site, PyPI, adds over 12,000 (free, open source) packages in ONE YEAR. Similarly, my analysis shows that Torry adds a new, free or open source package at a rate just under 0.5 package per day. Modulecounts.net shows 158/day for Go, 115 for Java, 47 for .Net, 59 for Python, etc. – alcalde Aug 25 '15 at 01:45
  • 1
    @alcalde: yes there are. Perhaps compared to C++ or Python, not so much, but still a plethora of libraries. **But don't go looking just on Torry anymore, it is not what it used to be**. Just google, or look on GitHub and similar sites. Take a look at the JEDI site too. In Delphi, one of the most popular implementations of Pascal, you can also use the GetIt manager to find software for Delphi (paid, trial and open source software). Read sites like "begin end" or "DelphiFeeds.com" to learn more about Delphi and FreePascal. Again, what happens on Torry is not so relevant anymore, for Pascal. – Rudy Velthuis Sep 28 '18 at 10:59
11

Nobody has yet mentioned that TeX (and METAfont and other TeXware) is written in Pascal.

In the early 90s, I developed commercial X/Motif CAD applications using a custom dialect of Pascal.

Ðаn
  • 10,934
  • 11
  • 59
  • 95
11

Well let's remember Lazarus a free clone of Delphi:

http://www.lazarus.freepascal.org/index.php

And FreePascal:

Free Pascal (aka FPK Pascal) is a 32 and 64 bit professional Pascal compiler. It is available for different processors: Intel x86, Amd64/x86_64, PowerPC, PowerPC64, Sparc, ARM.

http://www.freepascal.org/

tekBlues
  • 5,745
  • 1
  • 29
  • 32
5

Can Pascal be used for modern application development. Is it being used and how?

Of course it can, and it is widely used. Just take a look at Lazarus CT (free Delphi clone) which generates modern cross platform native applications from the single source. It has tons of components and many, many examples. It is RAD and has 8 host OS/CPU layers (win32/64, lin32/64, freebsd 32/64, solaris 32/64) and 22 target OS/CPU layers (i386-win32, x86_64-win64, i386-linux, x86_64-Linux, arm-wince, arm-linux, powerpc-linux, powerpc64-linux, sparc-linux, i386-freebsd, x86_64-freebsd, sparc-solaris, i386-solaris, x86_64-solaris, i386-haiku, arm-gba, arm-nds, arm-embedded, armeb-linux, arm-android, i386-android, powerpc-wii). What other tool can match that?

p.s. Just remember to install it as admin/root.

avra
  • 3,690
  • 19
  • 19
5

I have been using Pascal since version 1 all the way up to RAD Studio XE3 in 2012. That was my first language. Knowledge in pascal is almost the knowledge in the system it runs.

It is an amazing language which laid me the foundation to be a mastered in C, Embedded C and Analog/Digital Circuit Design - all self studied. I later studies PHP, JS and TCP Model without any difficulty in comprehending any of the core concepts behind them.

Of course Pascal is now Object Pascal like Basic is Visual Basic. Following are the things Pascal does in 2012 in it's commercial product. (non commercial versions of pascal does as good, if not better)

Supports almost all Web technologies. Supports almost all database technologies. Cross Platform in single code base. Large community, components and libraries.

One popular application developed in Pascal is Skype.

Microsoft, having had their own languages, bought Skype last year for, I think, $800M.

5

The main one is the Pascal-derivative Delphi (from Embarcadero, formerly owned by Borland).

See Wikipedia for a list of some more, mostly open source.

Jason Kresowaty
  • 16,105
  • 9
  • 57
  • 84
4

Searching the keyword 'pascal',filtering the results with 'programming language' => 'pascal',you'll find a bunch of applications of pascal,if not enterprise level,at least serious programmer's level.

With so many open-source and cross-platform ides, libraries, I think pascal is still alive(except the popular delphi dialect) and could do practical tasks.As the results implies,pascal could do Operating System,Compiler,Cross-Platform Library, Desktop-Programming.So,it seems that pascal at least could do a lot of serious tasks,if not too pratical to make moeny back instantly.

Anyway,I like this language,though I havn't done any serious programming with it.

Jichao
  • 40,341
  • 47
  • 125
  • 198
  • Well, the popular ones are mostly Delphi oriented, so if you exclude Delphi from Pascal, "pascal" collapses magnitudes in size. – Marco van de Voort May 28 '11 at 10:24
  • maybe instead of "except" you meant "especially"? because delphi is the most lively form of it. – eis Feb 18 '13 at 18:02
2

I think the main reason of the popularity of Turbo Pascal was not the Pascal language but the IDE. As far as I remember it was really easy to work with it, it was fast, and even debugging was fun.

On the other hand Pascal language was a but outdated, so Borland added quite a few things to the Pascal language (and made their language more similar to Module-2).

asalamon74
  • 6,120
  • 9
  • 46
  • 60
  • 2
    Not entirely correct. The Pascal Ansi/ISO committees were studying (with Wirth) on modular systems. Afaik Borland mostly borrowed from their early proposals. – Marco van de Voort Sep 29 '10 at 11:52
-1

Pascal is useful as a teaching language; it illustrates some of the more fundamental computer science precepts, with less obscurity than C.

Paul Sonier
  • 38,903
  • 3
  • 77
  • 117
  • 3
    But why isn't it used for anything practical? Isn't it powerful enough for real work applications? Kind of seems like a waste of time to learn a language you can't (or shouldn't) use in your (maybe future) profession as a programmer. – Andrioid Jun 08 '09 at 23:22
  • 1
    Learning environments can be very useful; how often do you use that wide-ruled paper with the guidelines that you used to learn to write your ABCs? Yet, it was useful for what it was. Sometimes, a simplified environment can allow better learning by providing for fewer distractions to the student. – Paul Sonier Jun 09 '09 at 00:14
  • Pascal isn't used for anything practical because the library support isn't there. As McWafflestix says, there is value in having a simplified environment in order to learn the basics of software development. A good engineer can apply those concepts easily to any other high-level language. – Steve Madsen Jun 09 '09 at 00:58
  • Wouldn't exactly compare Pascal to the ABCs, thats more like Basic. Pascal is more like grammar. But valid points here, thanks. – Andrioid Jun 09 '09 at 07:33
  • 3
    I realize that this question is focused on Pascal not the Delphi variant, but Delphi has almost all of Pascal's strengths and is used for many things practical, e.g. http://en.wikipedia.org/wiki/CodeGear_Delphi#Products_developed_with_Delphi – Argalatyr Jun 10 '09 at 10:34
  • Madsen: I think FPC and Delphi (which account for more than 98%+ of the Pascal usage) have more in common than any two random toolchains (that have independant codebases) for any other language. See e.g. Lazarus' compatibility to Delphi GUI apps. – Marco van de Voort Jun 11 '09 at 19:38
  • Adding to Argalatyr's comment, Pascal (Delphi in particular) is used a lot more than it's given credit for. The Windows Skype client is one high profile example. http://delphi.wikia.com/wiki/Good_Quality_Applications_Built_With_Delphi – Bruce McGee Jul 22 '09 at 21:20
  • 5
    I want to avoid any sort of language debate here, but Pascal is very much usable for large, real-world projects. For example, Pascal was the de facto language of choice on the Mac for many years - the OS itself was written in it and most apps were, as well, and there are still folks who write commercial Mac apps in Pascal. Over on Windows, Delphi was extremely popular and remains fairly popular, and has been used for plenty of real projects. The first version of Pascal was indeed relatively simple and intended as a teaching language, but the language evolved over time to become very advanced. – mr. w Oct 01 '10 at 20:58
  • @mr.w It's not usable in large, real-world products if it doesn't have a viable ecosystem anymore - books, magazines, courses, jobs, conventions, libraries, people younger than 40 who have ever seen it, etc. Pascal was the choice of Mac in the 1980s, not today. It's also not popular at all on Windows anymore either. It has priced itself way out of the mainstream, yet doesn't offer enterprise-grade support or features. There is no compelling reason to choose it *today* (as opposed to 1990s) over C#, C++, Java, Python, or new tools Rust, Go, D, Nim (based on Pascal), etc. – alcalde Aug 25 '15 at 01:57