by Animats · 9y ago · 0 comments
That may be a bug, not a feature. The Boost crowd won the battle, making extremely complex templates an essential part of the language. But they may have lost the war, as C++ loses market share.
LISP backed into typing, and it shows. Both typed variables and objects are painful in LISP. By the time LISP got both, the era of LISP was over. LISP is really dead now; there hasn't been a release of GNU Common LISP ("clisp") in 7 years.
Allegro CL 10.0 released on 2015-10-05
ABCL 1.4.0 released on 2016-10-08
CCL 1.11 released on 2015-11-06
ECL 16.1.3 released on 2016-12-19
Lispworks 7.0 released on 2015-05-05
MKCL 1.1.10 released on 2017-01-18
SBCL 1.3.15 released 2017-02-28a) Grateful for the extensive access to algorithms, lambdas, type inference;
b) Astounded at the complexity of template meta programming.
I imagine I'll get better at it with practice. But I'm operating at about 15% of the time efficiency of, say, Scala.
It sounds tongue in cheek, but I am serious. In the std library, boost and other sophisticated libraries there are tons of template shenanigans and there is little to be gain for most application developers. The single thing complex template meta-programs buy you is compile time evaluation for things in the middle of algorithms and classes.
Which is useful, but usually for things like deciding how many object should be allocated at once or how big a working set is to keep everything in cache. These are usually the performance optimizations you care about after all the algorithmic ones have been dealt with and often save only a constant number of instructions. When this seemingly insane level of optimization makes sense the author of a library will often accept the needed data as a parameter.
With constexpr things like lookup tables can easily be computed at compile with much more sane code.
(When it breaks, then you have to.)
In practice when the tools we rely on break, we have other alternatives. We tend to start with web searches and asking questions on SO. We can try different versions or libraries. Most problems have workarounds that may or may not be applicable.
Sometimes deep knowledge helps and I will tend to advocate for it. In the case of template metaprogramming, deep knowledge gains you very little and a common breakage will add 2 extra instructions to your runtime execution. If that matters you are already watching for it. As soon as you use COM, RPC, a web API or any scripting language you have already done something that would blow this cost away for an abstraction.
Knowing enough to fix a problem doesn't always mean a deep understanding of every library and tool even in C and C++ land. There is simply too much for any 1 person or any dedicated team to know, we must rely on division of labor. That is why we find abstractions like COM, RPC, web APIs and scripting languages worthwhile, they allow someone else to handle some part of our cognitive load at the cost of runtime performance.
Generally that is not required even in performance sensitive code. Perhaps a few conditionals a'la enable_if or direct use of SFINAE... but most everything else, not really.
Edit: Clarification, I am not actually having myself to do original metaprogramming, but in order to diagnose problems implementing the custom iterators, I have needed to delve into, and understand, the meaning of the Thrust library code.
GNU Common Lisp : https://www.gnu.org/software/gcl/
GNU CLISP : http://clisp.org
CLISP hasn't had a release in a few years, but the repository has a lot of activity these days:
https://sourceforge.net/p/clisp/clisp/ci/e4aba2ecdcf71968053...
> there hasn't been a release of GNU Common LISP ("clisp") in 7 years.
CLISP had a beta release a few days ago.
Just installed it on my Mac: this is GNU CLISP 2.49.50 from 2017-03-19.
$ clisp
i i i i i i i ooooo o ooooooo ooooo ooooo
I I I I I I I 8 8 8 8 8 o 8 8
I \ `+' / I 8 8 8 8 8 8
\ `-+-' / 8 8 8 ooooo 8oooo
`-__|__-' 8 8 8 8 8
| 8 o 8 8 o 8 8
------+------ ooooo 8oooooo ooo8ooo ooooo 8
Welcome to GNU CLISP 2.49.50 (2017-03-19) <http://clisp.org/>
Copyright (c) Bruno Haible, Michael Stoll 1992, 1993
Copyright (c) Bruno Haible, Marcus Daniels 1994-1997
Copyright (c) Bruno Haible, Pierpaolo Bernardi, Sam Steingold 1998
Copyright (c) Bruno Haible, Sam Steingold 1999-2000
Copyright (c) Sam Steingold, Bruno Haible 2001-2010
Type :h and hit Enter for context help.
[1]> (lisp-implementation-version)
"2.49.50 (2017-03-19) (built 3699208367) (memory 3699208818)"
Doesn't look dead to me...GNU Common Lisp is currently a bit less active: http://git.savannah.gnu.org/cgit/gcl.git/log/
Other 'free/open source' implementations are currently more interesting, especially ECL, Clozure CL and SBCL.
I have on my 32bit ARM under Linux the following implementations: GCL, ECL, LispWorks, SBCL, CCL, ABCL. LispWorks, CCL and SBCL are native compilers. I'd say that's enough choice.
> LISP is really dead now
Not more than usual.
Current version: 2.49 (2010-07-07).
Two people are still making source checkins, but there hasn't been a new release since 2010. It's nice to know that someone is still working on it, but they're not making it to a release version.
There is a beta version.
https://sourceforge.net/p/clisp/mailman/clisp-devel/thread/l...
> Two people are still making source checkins
source checkins = CLISP gets updates
Bruno Haible is one of the original authors. Sam Steingold joined 1999.
If CLISP is important to you, why not help them with testing the new beta release?
I've been toiling all alone since mid 2009 on a great language called TXR which includes a fantastic new Lisp dialect with many original features and ideas.
$ git log --oneline | wc
3643 45798 313606
Over 3600 commits since switching to git late October 2009, after version 18.Lisp might be dead, but this sentence is a non sequitur.