News for hackers. Stuff that matters.
Re:Lisp as the Maxwell Equations of Software (2012) by falcolas on Thursday February 12, 2015 @08:35AM (#9038683)
Meta: does the date really matter, when we're discussing concepts and theory which change infrequently, if at all?
Re:Lisp as the Maxwell Equations of Software (2012) by PaulHoule on Thursday February 12, 2015 @08:38AM (#9038689)
Things change.

LISP was popular in the 1980s before caches, branch prediction, and complex memory hierarchies.

The car/cdr list is just about the worst way to represent lists in terms of performance on modern CPUS.

Conceptually it is really clean, but about the only application it makes sense for is first order theorem proving, or in languages that support pattern matching. If you actually want to use lists as lists something like the Java ArrayList makes more sense.

Re:Lisp as the Maxwell Equations of Software (2012) by weland on Thursday February 12, 2015 @08:56AM (#9038746)
That's... basically not even wrong.

Lisp implementations that run well on, and take advantage of, architectures with caches, branch prediction and complex memory hierarchies are well-known, and have been well-known for, literally, decades. http://pt.withy.org/publications/VLM.html is an example from 1994. More importantly though, even the earlier Lisp machines (at least since 1983!) implemented a form of instruction caching, and had hardware-aided garbage collection.

> The car/cdr list is just about the worst way to represent lists in terms of performance on modern CPUS. Conceptually it is really clean, but about the only application it makes sense for is first order theorem proving, or in languages that support pattern matching. If you actually want to use lists as lists something like the Java ArrayList makes more sense.

The car/cdr list is not the only data structure in Common Lisp.

Re:Lisp as the Maxwell Equations of Software (2012) by crististm on Friday February 13, 2015 @04:27AM (#9043557)
I've been looking for some time for the whole paper but could not find anything but the abstract. Is it anywhere to be found?
Re:Lisp as the Maxwell Equations of Software (2012) by iak8god on Friday February 13, 2015 @12:36PM (#9045586)
An extended abstract is basically just a short paper, and not usually the abstract to anything [1]. So that might be everything the authors wrote on the topic. It's reasonable to assume that any full paper by P.T. Withington would be posted on his personal site[2] alongside the abstract.

[1] http://academia.stackexchange.com/a/1352 [2] http://pt.withy.org/

Re:Lisp as the Maxwell Equations of Software (2012) by crististm on Friday February 13, 2015 @03:39PM (#9047036)
pt.withy.org does not have the full paper[1] readily available.

[1] The extended abstract itself mentioned " The full paper also discusses other aspects...".

Re:Lisp as the Maxwell Equations of Software (2012) by iak8god on Friday February 13, 2015 @04:10PM (#9047210)
Interesting. Thanks for pointing out that the abstract mentions "the full paper." It is possible though that the paper was never completed / published: note that though this abstract was "Submitted to PLDI '94," it doesn't appear in the proceedings for that event [1]. If the abstract was rejected the authors may have never finished the paper.

[1] http://dblp1.uni-trier.de/db/conf/pldi/pldi94.html

Re:Lisp as the Maxwell Equations of Software (2012) by weland on Friday February 13, 2015 @04:36AM (#9043570)
I have no idea. I think I read it a long time ago, but I'm sure I was in university back then so it may have been in the library or something.
Re:Lisp as the Maxwell Equations of Software (2012) by RodgerTheGreat on Thursday February 12, 2015 @09:06AM (#9038789)
The car/cdr list is the only data structure described in cute metacircular interpreters, and even then only when supported by a substantial amount of implied runtime code.
Re:Lisp as the Maxwell Equations of Software (2012) by pjmlp on Thursday February 12, 2015 @09:27AM (#9038869)
This doesn't look like a substantial runtime code.

http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf

Re:Lisp as the Maxwell Equations of Software (2012) by RodgerTheGreat on Thursday February 12, 2015 @09:39AM (#9038923)
That doesn't look like sufficient runtime code. That paper quite explicitly avoids implementing a garbage collector, among other things.
Re:Lisp as the Maxwell Equations of Software (2012) by abecedarius on Thursday February 12, 2015 @11:27AM (#9039515)
Here's the complete runtime of my garbage-collected self-hosting Lisp-to-C compiler: https://github.com/darius/ichbins/blob/master/ichbins.scm#L2...

(Yes, it's not the world's fastest.)

Re:Lisp as the Maxwell Equations of Software (2012) by pjmlp on Thursday February 12, 2015 @09:56AM (#9038984)
A simple reference counted implementation with cycle collector is not a big deal to implement, nor a substantial effort.

It might perform like a dog, but that is another matter.

Re:Lisp as the Maxwell Equations of Software (2012) by lispm on Thursday February 12, 2015 @08:52AM (#9038732)
> LISP was popular in the 1980s before caches, branch prediction, and complex memory hierarchies.

You mean like in the 80s with very little RAM, larger virtual memory to very slow disks, paging files of networks, booted images from network servers over 10Mbit links, ...

A time when commercial Lisp did a lot to be memory efficient (like cdr coding of Lisps, compacting GCs, incremental GCs, ephemeral GCs, generational GCs, ...).

> The car/cdr list is just about the worst way to represent lists in terms of performance on modern CPUS.

Actually modern CPUs are really fast with these list operations. For a lot of operations linked lists are fully sufficient.

You might also want to note that Lisp has data structures like vectors, multi-dimensional arrays, records, instances of Classes, hash tables and all kinds of fancy stuff, including access to 'foreign' memory which is accessible with pointers and manual memory management.

Currently optimized Lisp code is as fast as F#, OCaml, Java, Haskell or similar...

Re:Lisp as the Maxwell Equations of Software (2012) by davexunit on Thursday February 12, 2015 @08:46AM (#9038715)
>LISP was popular in the 1980s before caches, branch prediction, and complex memory hierarchies.

Yeah, let's just forget about decades of Lisp development since.

>something like the Java ArrayList makes more sense.

Except you lose the most important detail of Lisp pairs: persistence.

Re:Lisp as the Maxwell Equations of Software (2012) by dasmoth on Thursday February 12, 2015 @09:10AM (#9038803)
And in practice, compromise is possible. E.g. Clojure's vectors which are unashamedly LISP-like to work with, but still avoid much of the pointer-chasing of a linked list.
Re:Lisp as the Maxwell Equations of Software (2012) by davexunit on Thursday February 12, 2015 @09:31AM (#9038887)
Yes, there are various implementations of persistent vector-like lists, Clojure's being one of them. They are extremely useful, however, they are far more complex than a cons cell. Most of the time, I want simple cons cells.
Re:Lisp as the Maxwell Equations of Software (2012) by gsg on Thursday February 12, 2015 @10:47AM (#9039263)
There are schemes to "unroll" conses, too. CDR-coding, Appel's paper (although IIRC that requires immutable conses), etc.
Re:Lisp as the Maxwell Equations of Software (2012) by PaulHoule on Thursday February 12, 2015 @09:15AM (#9038824)
Persistence has some good properties, particularly if you are writing compilers.

Just about every language that promises an advance in parallelism (other than solidly "worse is better" approaches such as Hadoop and Pig) is selling some kind of snake oil, and immutability is one of the worst of them.

Immutability has benefits in terms of correctness, but not in terms of scalability to more processors or total throughput. With modern memory hierarchies a lot revolves around never letting two threads touch the same cache line and this happens at all you lose at least an order of magnitude in performance. Garbage collection involves global properties of the system, so there will always be some "stop the world" element of GC, so GC itself becomes a scaling bottleneck when you allocate lots of memory and throw it all behind your rear.

Re:Lisp as the Maxwell Equations of Software (2012) by davexunit on Thursday February 12, 2015 @09:25AM (#9038863)
>Immutability has benefits in terms of correctness, but not in terms of scalability to more processors or total throughput.

I'll take correctness over raw performance any day.

Re:Lisp as the Maxwell Equations of Software (2012) by pjmlp on Thursday February 12, 2015 @09:53AM (#9038977)
I am with you, specially since we all know where languages obsessed with performance over correctness lead to.

http://web.nvd.nist.gov/view/vuln/search-results?query=&sear...

Re:Lisp as the Maxwell Equations of Software (2012) by hga on Thursday February 12, 2015 @10:26AM (#9039131)
Although the funny thing is, as the 2nd oldest surviving computer language after FORTRAN, and at least back then used for very difficult problems, to be competitive let alone justifiable on extremely scarce and expensive hardware, "Lisp" has always been "obsessed" with performance. ADDED along with a bit before: It first ran on the IBM 704, a vacuum tube computer. It was derived from the IBM 701, which initially used Williams tubes for memory (https://en.wikipedia.org/wiki/Williams_tube).

Scare quotes because "anyone" can program up a Lisp "in a week". High performance LISPs not surprisingly require very roughly the same amount of effort as any other high performance language implementation. Lisp got its first compiler in 1962, 4 years after its launch (and it was the first self-hosting compiler, i.e. written in itself). As the inventor of garbage collection, it's long been a major driver of innovations in GC (although of course much less so now that Java etc. gave GCed languages mainstream cred).

But by and large, except for strictness of dynamic type checking (often a tunable variable), sacrificing correctness for speed has never been part of Lisp's DNA.

Re:Lisp as the Maxwell Equations of Software (2012) by pjmlp on Thursday February 12, 2015 @11:06AM (#9039384)
Yes, but there are many ways to be obsessed with performance while keeping correctness.

As you might imagine by my post history I had a specific language in mind.

Funny that you mention FORTRAN, as it reminds me of a systems programming language used for writing several OS, about the same age as FORTRAN and Lisp, namely Algol and its variants.

When they questioned their customers if Algol compilers should support disabling bounds checking, they said no responsible engineer would ever need it. As described by Hoare on his Turing award.

Re:Lisp as the Maxwell Equations of Software (2012) by hga on Thursday February 12, 2015 @11:33AM (#9039582)
To indicate how far we've come from that, my biggest concern with the lowRISC project I mention elsewhere is that it's a RISC-V project, and in a very New Jersey way, that CPU has no provision for integer math errors other than divide by zero. Also makes the large integer cryptographic crowd rather upset.

While this is ... tolerable, I seriously wonder what other corners are being cut, e.g. in the unreleased privileged ISA.

(A bit more background: RISC-V is intended to be a open core for everything, so making the base processor simple for education is good, but promoting it as a CPU for industry is in the direction of bad, IMHO.)

Re:Lisp as the Maxwell Equations of Software (2012) by marcosdumay on Thursday February 12, 2015 @10:32AM (#9039169)
> Immutability has benefits in terms of correctness, but not in terms of scalability to more processors or total throughput.

Wrong. Immutability can (and often does) increase scalability. It does that mainly by making this situation harmless:

> With modern memory hierarchies a lot revolves around never letting two threads touch the same cache line and this happens at all you lose at least an order of magnitude in performance.

Re:Lisp as the Maxwell Equations of Software (2012) by pjmlp on Thursday February 12, 2015 @09:00AM (#9038761)
Although it is called List Processing, it does support other types of data structures, including arrays.

https://www.cs.cmu.edu/Groups/AI/html/cltl/clm/node158.html#...

Don't blame the language for lack of programmer knowledge.

Re:Lisp as the Maxwell Equations of Software (2012) by PaulHoule on Thursday February 12, 2015 @09:25AM (#9038861)
Retrocomputing (such as the Cult of Knuth) seeds programmers with obsolete knowledge which displaces useful knowledge.

If you learn anything about binary search you should learn to avoid it. Even computer science books have a wrong implementation of it more than 50% of the time and, that, together with all the algorithms based on total ordering, tends to blind people to the fascinating world of algorithms that are based on partial orderings. 99% of the time you are better off using the hashtables that come with your language than you are to look into a "data structures and algorithms" book we're you'll probably pick something that performs worse and you'll screw up the implementation of.

(I recently wasted a few days coding up something that was "kinda like" binary search, but the analogy with binary search led me to think about it the wrong way.)

Today people still read the stuff on Random Number generators from Knuth, which was obsolete by 1985. It's very likely that the rand() function in your language comes out of Knuth, even though his stuff was completely superceded but what was in Numerical Recipes (Knuth never did scientiic computing) and the stuff in NR was obsolete by 1990.

They're removing rand() from the C++ standard library because they can't burn all the copies of Knuth fast enough to stop standard library implementers from reimplementing all the bad algorithms.