Re:Computer Science from the Bottom Up (2013)
by taeric on Sunday December 25, 2016 @12:35AM
(#13253110)
I am in complete agreement that lisp makes it possible to write slower programs. I just challenge that it is an inherently slower language.
I view it as reducing the coefficient of writing a program. This means more will be made. So more slower ones will get made.
However, nothing prevents you from writing a fast program in that language. Other than the slower successes.
Re:Computer Science from the Bottom Up (2013)
by qwertyuiop924 on Sunday December 25, 2016 @09:37AM
(#13254207)
With a compiler smart enough to aggressively cull any uneeded dynamism, it might be possible. But it would still be hard.
Re:Computer Science from the Bottom Up (2013)
by kazinator on Sunday December 25, 2016 @11:40AM
(#13254607)
A pragmatic view, perhaps, is that as a tool, a given Lisp environment doesn't constraint how fast a solution we can devise to a problem in some manner. That really fast solution might not simply be a Lisp program fed to the Lisp compiler.
Suppose you're required to solve a problem with very high performance, and it has to be expressed in some high level language. No high level language achieves it using any straightforward code without dropping to assembly language. Not C, nothing.
In that situation, I'd arm myself with Lisp, because the problem basically requires inventing some specialized fast language and mapping it to the machine at hand.
Re:Computer Science from the Bottom Up (2013)
by qwertyuiop924 on Sunday December 25, 2016 @02:10PM
(#13255066)
So a custom Assembler using CL as a macro language? That works.
Re:Computer Science from the Bottom Up (2013)
by junke on Sunday December 25, 2016 @03:32PM
(#13255321)
SB-ASSEMB, for example. https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembl...
Pretty much: if you don't know the access patterns, draw up a naive implementation so you can figure them out.
This is actually connected to one of the disadvantages of Lisp: because Lisp makes it so easy to draw up a naive datastructure based on LLs, it can take some effort to rip all that out and make something actually fast in its place.
>I wouldn't say it is the dynamism as much as the lack of control.
Don't undereatimate the cost of runtime dynamism. Lisp compilers have gotten pretty good at avoiding implementing it when possible, but there are pretty tight limits on how far you can go with that sort of optimization.
Essentially, every time you call a CLOS method, or you use eval, or you in any way introspect on your runtime state, or create the possibility for your code to do so at runtime, the code you are writing becomes more costly to run.