(loop for n = 1 then (+ n n-1)
and n-1 = 0 then n
while (<= n 4000000)
if (evenp n) ; predicates in CL end in 'p'
sum n)
You can add almost any (AFAIK any) paradigm you want. Initially Lisp did not have any object system. When OOP became a thing it was added to Lisp. Today it exists in the form of CLOS, a very powerful object system which at its core is two macros, defclass[0] and defmethod[1]. Logic programming can also be added through the use of macros[2]. Here is an example of append written using logic programming in Lisp (compare it to the Prolog version). (<- (append nil ?xs ?xs))
(<- (append (?x . ?xs) ?ys (?x . ?zs))
(append ?xs ?ys ?zs)
The thing is you can make Lisp any language you want it to be. Want a (better) language to write HTML, you can do that[3]. Want a language which can parse ATNs (augmented transition networks), you can do that[2]. You can add to Lisp almost any feature you can think of. This is what makes it appear (at least to me) as the "universal language".[0] http://www.gigamonkeys.com/book/object-reorientation-classes...
[1] http://www.gigamonkeys.com/book/object-reorientation-generic...
[2] http://ep.yimg.com/ty/cdn/paulgraham/onlisp.pdf
[3] http://allegroserve.sourceforge.net/aserve-dist/doc/htmlgen....
"The Mozart Programming System combines ongoing research in programming language design and implementation, constraint logic programming, distributed computing, and human-computer interfaces. Mozart implements the Oz language and provides both expressive power and advanced functionality."
The language that I know comes closest to a universal language is C#.
C# has a rich static typesystem with generics, is typesafe, has a garbage collector, can be precompiled and has runtimes for most operating systems.
C# also has a dynamic type system, that can be enabled with a keyword.
C# has an embedded functional language, has function references and lambda expressions.
C# has extensive libraries for Server applications, CLI applications and GUI applications, including asynchronous and syncronous I/O, events and accelerated graphics.
C# supports reflection and code generation at runtime.
Over the years Microsoft has managed to cram almost every programming paradigm that's out there into C#, yet has carefully avoided it becoming a multi-headed unusable monster like C++ is (I'm not saying you can't write beautiful code in C++, just saying there's a lot in there that you shouldn't do).
About the only thing that's not in C# as far as I am aware is predictable/high performance, like C and C++ have. You can not disable the garbage collector and can't embed machine language.
So why, if I think C# is such a cool language, don't I use it? Well.. I just really like Ruby's type system and syntax. And I just really like Haskell's typesystem and syntax. There's really no need to have all features in one language when you can do just as well with multiple programming languages that might have specific advantages.
Also, if you pool resources and use the reinitialization pattern rather than constantly destroying/reacquiring resources, then you can obviate a LOT of garbage collection. It's very common in game programming in C#.
Beyond the language and deployment factors, languages are optimized for different human factors. Some languages give up a lot of expressive power and flexibility in order to optimize the performance of large teams of developers with relatively poor code discipline. But for me personally on my side projects I prefer to have features like stronger static guarantees, less boilerplate and more expressive power. It seems hard to reconcile these different approaches in a single language.
The most obvious example is GOTO. It's a very powerful tool. A GOTO can do anything you can accomplish with an IF, WHILE, FOR, etc. yet we got rid of it because that incredible flexibility made it hard to reason about. The result was structured programming.
Object orientation can also be looked at as the removal of shared global state. There are multiple definitions of OO, but I like Alan Kay's definition best. He said the two primary principles are encapsulation and message passing. Encapsulation is obviously the one I'm touching on here. Some people include class hierarchies and open recursion in their definition of OO, and those certainly do constitute new functionality, but as I said, I prefer Alan Kay's definition.
Functional programming can be looked at as the removal of mutation. Where once we could create side-effects whenever we pleased, FP tells us that we probably shouldn't. Removing mutation makes it easier to reason about our programs, just like removing GOTO.
Haskell goes even further and removes implicit ordering of execution. Because the language is lazy it probably won't execute your code in the sequence you were expecting. Due to immutability and referential transparency everything works out just fine anyway. This makes certain kinds of algorithm much more performant (Huett zippers come to mind).
Instead of asking what new features we can add to languages, perhaps we should ask what else can be taken away.
I'd hesitate to point to Lisp, with its ability to be "programmable programming language". The modus operandi, explained by e.g. PG, is to create a domain-specific language and then solve the problem using that DSL. This way you can have a great variety of problems which are relatively accessible by such a language... Would like to know more alternatives to the topic.
Maybe? But who would want to use something like that? Good programming languages, like most useful tools, are specialized. They support modes of thinking that allow effective problem solving, each within its own domain. (Think Haskell vs Java).
In other words, programming languages are tools, and tools are useful because they are limited.
Joking aside, I think it is still to the point you are trying to make. A CNC router, despite looking like a general purpose tool, is actually a very specialized tool, meant for rapid prototyping at precision scale. You won't very often find a CNC router in the common garage workshop, primarily because they are so freaking expensive, but also because they are a might-bit dangerous.
Answer intentionally as vague as question.
The Java GC, no matter which way you tune it, fails at this in my experience.