General Purpose Programming Language

People sometimes use the term, "general purpose programming language". Measuring "general purpose" can be tricky. Any TuringComplete language could technically be called general purpose. However, there seems to be other features implied. Some focus on hardware constraints, some on implementation such as availability of compilers for different operating systems or devices. If you look at it from the perspective hardware and implementation, then the CeeLanguage is the best candidate I can think of. However, C is not very developer-friendly in my opinion. Although it might run on or compile to almost any system, I would not choose it for the majority of applications I may work on. I have only found it worth-while if I have to be closer to the machine, such as making device drivers or accessing system services not available to any other language. But few would chose it to write some "quick script". "General purpose" in one domain may not be genaral purpose in another.

That misses the point altogether. "General purpose in one domain" should be instead called "domain specific"!

A "general purpose programming language" theoretically should be usable in multiple domains, but not specialized for any of them.

So the major contrast should simply be "general purpose" versus "domain specific" (plus of course degenerate cases like toy languages, and other ways of categorizing, e.g. application vs systems, or scripting language -- hard to pin down, but perhaps a language that primarily runs other applications and only incidentally does computation).

Most TuringEquivalent languages have been used, abused, and misused for just about every purpose, e.g. Cobol compilers have been written in RPG, which is purely a domain specific report writing language. So people always argue "but my favorite language has been used for X, Y and Z, proving it is general purpose!" And thus holy wars begin.

There are some common perceptions, though, whether true or not. E.g. it is widely believed that Fortran and APL are suitable for mathematical programming but not general purpose programming. It is widely believed that Snobol is only good for text processing. It is widely believed that ML/OCAML/Haskell are only good for research. It is widely believed that Lisp is only good for AI-related symbol processing. It is widely believed that C and Forth are only good for systems programming.

It is of some interest to note that some languages have in fact been extremely commonly used for a large variety of things; this is presumably a better indicator than a tour de force one-off demonstration.

In this vein, C and C++ have been extremely widely used in both systems programming and for writing applications in every conceivable domain, so although these languages can be critiqued in a variety of ways, it would be strange to claim that they are not general purpose.

Java has recently been touted as sort of an ultimate language, and in fact has been widely used in many application domains, so it certainly seems general purpose. It does not appear to have been widely used for systems programming, note.

Smalltalk and Lisp are somewhat similar in usage to Java (widely used for many things), and therefore general purpose. Both have also been used in systems programming, but mostly in language-centric environments (e.g. Lisp as a systems programming language on a Lisp machine). They do not seem to have been widely used a systems programming language in non-language-centric environments.

Perhaps there is no such thing as "general purpose" then. Every language has weaknesses. The easier it is to program with the slower it tends to run. If this rule is a "truth of nature", then there can be no general purpose language. There are generally 3 contradicting factors:

The C family does well on speed, but scores low on the friendly scale. Thus, it is not often used for "quick scripting" (unless it is the only language you know or are allowed to use).

I don't follow your thinking. First, say again, why is there no such thing as general purpose?

As for your generally contradicting factors, this is unclear. The programmer-friendly and easy-to-learn factors are very subjective, and most languages have opposing claims made on those subjects by insiders vs outsider.

Indeed. But that would probably also make determination of General Purpose Language subjective if it is tied to that factor.

E.g. although at first glance C seems less friendly for quick one-off programs than even Basic, nonetheless I prefer C even for that purose, because its greater generality makes friendlier to me than the typical feature-starved version of Basic.(Never mind "visual basic", I can't speak to that.) But to a non-C programmer, they'd think I was crazy, no doubt. I do know lots of languages, though, so that's not to say C is my first choice either.

As for speed...take Lisp, for instance. There are very fast implementations, such that at least some programs run faster than those in C or Fortran, but insiders say they love it for rapid prototyping.

But it has a long learning curve for the most part.

I think the number one thing needed to be potentially viewed as suitable for rapid prototyping is to have an interactive front end available, as is typical of Lisp, Basic, Bash, APL etc. The number two thing is for declarations to be at a minimum, as is often true of dynamically typed languages. There may not be a #3 requirement.


See Also: InstantLanguageForm



EditText of this page (last edited November 23, 2014) or FindPage with title or text search