My definition of general purpose is a bit specific: a general purpose programming language should be able to handle all problem domains, including implementing operating system kernels, device drivers and all sorts of programming language facilities. This definition basically excludes all mandatory garbage collected languages (including LISP, Java, Ocaml etc), as you cannot fully implement a garbage collector in a fully garbage collected language.
The priorities I'm talking about here are:
- Simplicity. It should follow a small set of simple rules without many exceptions. It should be simple but not simpler. (C is quite simple but could be simpler. C++ is anything but.)
- Safety. It should not have any undefined behavior in any of its operations. It's often called type safety as safety is tightly coupled with type system. Both C and C++ are not safe, as there're many undefined behaviors resulting from casts alone.
- Performance - It should be at the same order of magnitude as C, less than 1.2x (taking 1.2x amount of time for the equivalent C program) slower is desirable, 1.5-2x slower is acceptable,
>=
10x is undesirable. - Expressiveness - It should support language constructs to express solutions to common problems succinctly. Examples: type inference, RAII, objects, closure, (hygienic) macro system and garbage collection. My ideal language would allow me to express scripting as easily as system programming in the same language, so I don't have to rely on any shell/perl scripts to build/deploy my programs.
The above is my order of priorities. What are your priorities? I think that (Walter Bright's) D language is a step in the right direction but far from my goals. Are there any other modern alternative general purpose languages besides D (and maybe Ada?)
Would you be interested in such a general purpose programming language that's as easy to use as a scripting language and as fast as C? With the advancement of modern dynamic compiling techniques/tools such as JIT and LLVM and dynamic loadable personas, I think these goals should be achievable in foreseeable future (10 years). What do you think? (I'll vote up all your serious answers :)
The question is inspired by my past projects that always involves multiple programming languages. Unlike many people who use the cliches like "best tools for the job" to stick to the status quo, I think there are better ways to do it. Having to maintain similar libraries in multiple languages is completely counter productive. A well defined general purpose language that could be a configurable collection of personas, can potentially solve all the problems in a consistent and DRY manner across all the domains of a project.