2 ms·
>Know your data access, and the data structure design has meaningful discourse. Don't know your access patterns? You are unable to pick the best one. Period. P
by qwertyuiop924 10y ago
>Know your data access, and the data structure design has meaningful discourse. Don't know your access patterns? You are unable to pick the best one. Period.
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.
- taeric 10y agoI 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.
- qwertyuiop924 10y agoWith a compiler smart enough to aggressively cull any uneeded dynamism, it might be possible. But it would still be hard.
- kazinator 10y agoA 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.
- qwertyuiop924 10y agoSo a custom Assembler using CL as a macro language? That works.
- junke 10y agoSB-ASSEMB, for example. https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembly-code-breadboard/ https://www.pvk.ca/Blog/2014/03/15/sbcl-the-ultimate-assembl...