by FrozenVoid · 9y ago · 0 comments
1.GC that prevents it from using real-time and performance-oriented code.
2.Pervasive use of inefficient lists and dynamic typing, which puts steep memory requirements on top of performance costs.
3. Arcane write-only syntax which becomes context sensitive with Domain-Specific Languages which Lisp programs devolve to, creating unreadable and overly condensed spaghetti code(especially macros), making existing code inaccessible for developers.
4. Huge runtime which is embedded in every executable, that makes it less competitive with scripting languages. Lisp requires eval() and runtime interpretation which other languages optimize out and replace with fixed code paths. (some external programs called "tree shakers" remove the lisp's runtime cruft, but they're exception rather than rule)
5. Lisp has very loose safety. Any piece of data can be potentially executed at runtime and lisp programs have to be excluded from WriteXORexecute/NX protection, since lisp code/data are intermingled. Executable stack and heap expand areas for exploits and create a general lack of stability - any bug can corrupt running code, Lisp is so far removed from any concept of safety it even allows the programs to be modified at runtime(this is a fundamental feature shared with polymorphic viruses).
All three are widely used.
(that's only part of point 2 though.)
Keep in mind that a compiler like SBCL will put Lisp performancewise in the range of other statically compiled language/implementations.
> 2) puts steep memory requirements on top of performance costs
Such that the Dylan IDE ( https://news.ycombinator.com/item?id=14478942 ) written in Macintosh Common Lisp needed 20 MB RAM. Steep memory requirements! Current Lisp implementations run nicely on a first-gen Raspberry Pi.
Lisp fought with memory efficiency in the 80s (the Lisp Machine operating systems ran in 20 MB RAM + 100MB virtual memory -> which were 4 MWords RAM of 40bit memory), but hasn't grown much since then. The jump to 64bit implementations has brought some size increase. But the size varies widely between large machine code (say with SBCL), space efficient byte code implementations (CLISP) and tiny executables created by whole-program compilers like mocl.
> 4) Huge runtime which is embedded in every executable, that makes it less competitive with scripting languages
If you want to compete with 'scripting languages', then just don't include the runtime. You can use many Lisp implementations just like scripting languages.
> Lisp requires eval() and runtime interpretation which other languages optimize out and replace with fixed code paths
If a compiler is used (say: SBCL, ECL, LispWorks, GCL, CCL, Allegro CL, mocl, ...) , then Lisp does not require runtime interpretation.
> some external programs called "tree shakers" remove the lisp's runtime
They don't. Treeshakers remove unused code and data. Parts of the runtime are still there.
> 5) Any piece of data can be potentially executed at runtime
If you remove the compiler & interpreter from the executable, that can't happen. See for example the LispWorks documentation on 'Delivery':
http://www.lispworks.com/documentation/lw70/DV/html/delivery...
> since lisp code/data are intermingled.
Not necessarily. Code in compiled Lisp implementations is machine code. If all fails, you can always compile Common Lisp to C code using GCL, ECL, MKCL, mocl, CLASP (C++).
> Lisp is so far removed from any concept of safety it even allows the programs to be modified at runtime
Only if you include an interpreter.
Actually one of the nice features of many Lisp implementations is that usually all data is tagged and that Lisp code checks applicability at runtime, incl. array/string/vector bounds checks...
Hmm...that claim is made a lot, and it works, in theory (see Jitterdämmerung[1]). However practical reports from non-advocates don't seem to bear out those results. For example, Michael Stonebraker says that they started writing Postgres in LISP. Had to revert that decision as everything was an order of magnitude slower[2].
[1] http://blog.metaobject.com/2015/10/jitterdammerung.html
[2] Michael Stonbraker's Turing Award Lecture: https://youtu.be/sEPTZVGk3WY?t=1791
If they have never written a high-performance application in Lisp, they would have needed a bit more work. The Lisp version was written more as an experiment:
http://db.cs.berkeley.edu/papers/ERL-M90-34.pdf
> Our feeling is that the use of LISP has been a terrible mistake for several reasons. First, current LISP environments are very large. To run a ‘‘nothing’’ program in LISP requires about 3 mbytes of address space. Hence, POSTGRES exceeds 4 mbytes in size, all but 1 mbyte is the LISP compiler, editor and assorted other non required (or even desired) functions. Hence, we suffer from a gigantic footprint. Second, a DBMS never wants to stop when garbage collection happens. Any response time sensitive pro- gram must therefore allocate and deallocate space manually, so that garbage collection never happens dur- ing normal processing. Consequently, we spent extra effort ensuring that LISP garbage collection is not used by POSTGRES. Hence, this aspect of LISP, which improves programmer productivity, was not avail- able to us. Third, LISP execution is slow. As noted in the performance figures in the next section our LISP code is more than twice as slow as the comparable C code. Of course, it is possible that we are not skilled LISP programmers or do not know how to optimize the language; hence our experience should be suitably discounted.
They had problems because Lisp alone needed 3 Megabytes of address space (!) to run - a 'gigantic footprint' - , needed to work around the GC and their C version was twice as fast.
Their main problem was that they wanted to write it in a mix of C with Lisp and it was hard to debug for them. I'm not surprised that people with no experience writing applications in a mix of C + Lisp failed to write a database engine. I'm pretty sure it is easier to write a database engine in C compared to a mix of C and Lisp, without GC and crossing the boundaries of a managed runtime and plain C data. People did that, but these people had quite a bit more experience writing such applications.
You can buy for example AllegroGraph, a graph database in Allegro Common Lisp:
You can bet that the NSA/CIA/Homeland Security etc. all have it running with very large datasets about you, me and all the others.
"As noted in the performance figures in the next section our LISP code is more than twice as slow as the comparable C code."
I don't doubt that you can write productive systems in CL (bit of a fan myself), but the "oh we have smart compilers that just make it as fast as C" just isn't true.
Simple short benchmarks don't show a complete picture of the language, since they're easy to optimize
>written in Macintosh Common Lisp needed 20 MB RAM
At the time when computers had 32/64 MB of RAM.
>. You can use many Lisp implementations just like scripting languages. >If a compiler is used (say: SBCL, ECL, LispWorks, GCL, CCL, Allegro CL, mocl, ...) , then Lisp does not require runtime interpretation. >Only if you include an interpreter.
So which one is it?
>Treeshakers remove unused code and data. Parts of the runtime are still there.
Huh, What kind of unused code and data is there in a 25MB hello world? https://web.archive.org/web/20090324024745/http://mbishop.es...
>If all fails, you can always compile Common Lisp to C code
Compiling to C doesn't improve safety of Lisp. As a C programmer, "Compiling to verbose cryptic C" doesn't sell me as a feature, more like a potential security threat.
I didn't say anything about short benchmarks.
> At the time when computers had 32/64 MB of RAM.
Exactly. Phones now run with 4GB RAM. A Raspberry now comes with 0.5GB and more.
> Huh, What kind of unused code and data is there in a 25MB hello world?
debugger, inspector, compiler, interpreter, command line interface, debug info of those, ...
> Compiling to C doesn't improve safety of Lisp. As a C programmer, "Compiling to verbose cryptic C" doesn't sell me as a feature, more like a potential security threat.
You get rid of any runtime interpretation and compilation. All that remains is a static C program.
> "Compiling to verbose cryptic C"
Then compile to readable C.
If you want to produce a standalone Lisp executable, you have to embed the compiler with it, hence the big size.
However, if you just run the programs with your own compiler, you only need the actual code — that is a 44 bytes "Hello world!", shebang included.
On my machine, the SBCL package is 70 MiB, while for example the Python one is 125 MiB.
By that logic GCC is also an interpreter. https://github.com/abijith-kp/gcc-interpreter
> At the time when computers had 32/64 MB of RAM.
That's non sequitur. Lets quote the entire context:
> the Dylan IDE written in Macintosh Common Lisp needed 20 MB RAM
How much RAM other IDEs used at the time?
Do you have any evidence that this happens? I always see this as an argument against macros, but I don't actually see this problem manifesting in practice.
In fact, macros are much less scary than monkey patching like in Ruby or Javascript, because a macro can only affect the code within the particular invocation, and it must be imported to be used.
Also, the success of Rails seems to suggest that creating specialized DSLs can be a big benefit.
1.GC that prevents it from using real-time and performance-oriented code.
Lisp is a great language but it can't be the silver bullet for everything. If you need hard real-time programming you need to look elsewhere. The same is true of Ruby, Python, C#, and other popular, well-accepted languages. 2.Pervasive use of inefficient lists and dynamic typing,
which puts steep memory requirements on top of performance costs.
The same is true of Ruby, Python, C#, and other popular, well-accepted languages. And how can you speak about "inefficient" lists? Lisp uses linked-lists which is an efficient data type in the context of recursive functions, which Lisp coders make extensive use of. 3. Arcane write-only syntax which becomes context sensitive with
Domain-Specific Languages which Lisp programs devolve to, creating
unreadable and overly condensed spaghetti code(especially macros),
making existing code inaccessible for developers.
The whole point of creating a Domain-Specific-Language and then express the problem using the DSL is to, precisely, go away from unreadable code and spaghetti code.It seems you have not used Lisp enough.
4. Huge runtime which is embedded in every executable, that
makes it less competitive with scripting languages.
Lisp requires eval() and runtime interpretation which other languages optimize out
and replace with fixed code paths. (some external programs called
"tree shakers" remove the lisp's runtime cruft, but they're exception rather than rule)
Common Lisp is generally faster than most of the scripting languages out there (Ruby, Python, Perl), and in reality approaches C speed...As for "Lisp requires eval() and runtime interpretation", this is not true. You need to read more about the Lisp compilation model.
5. Lisp has very loose safety. Any piece of data can be potentially executed
at runtime and lisp programs have to be excluded from WriteXORexecute/NX protection,
since lisp code/data are intermingled. Executable stack and
heap expand areas for exploits and create a general lack of stability - any bug
can corrupt running code, Lisp is so far removed from any concept of safety
it even allows the programs to be modified at runtime(this is a fundamental
feature shared with polymorphic viruses).
"It even allows the programs to be modified at runtime". You mean allow the program to self-modify, right?How horrible, how sinful!!
I guess we should stay with statically linked, statically compiled, statically typed, procedural-only, manually-memory-managed, code. I guess we should all go back to Algol-60 then.