Name: Cudder !!RD3keS5C4KiAlK2 2013-06-29 0:06
What has lisp ever done for reducing the memory footprint of a computer program? The answer is nothing, nothing at all. This is all the work of C.
CL-USER> (declaim (optimize (compilation-speed 0) (debug 0) (safety 0) (space 3) (speed 2)))
; No value
CL-USER> (defun int++ (x)
(declare (type fixnum x))
(the fixnum (+ 1 x)))
INT++
CL-USER> (compile 'int++)
INT++
NIL
NIL
CL-USER> (disassemble #'int++)
; disassembly for INT++
; 0421194F: 4883C202 ADD RDX, 2 ; no-arg-parsing entry point
; 53: 488BE5 MOV RSP, RBP
; 56: F8 CLC
; 57: 5D POP RBP
; 58: C3 RET
NILstd::map<std::string,std::string> v; and calling several methods on it is enough to instantly generate a KB or more of code, or to take this to an extreme, eval in even higher level languages (like Lisp) is sufficient to add to your executable a substantial portion of the bloody compiler itself!eval in even higher level languages (like Lisp) is sufficient to add to your executable a substantial portion of the bloody compiler itself!int addone(int x)
{
return x + 1;
}(lambda ...), and suddenly you've "written" a lot more code than you thought.