[ prog / sol / mona ]

prog


Lisp beginner thread

78 2020-11-01 16:12

The actual program that runs after Scheme,C or most languages with a decent compiler passes through the code is imperative loop in assembler.
Recursion is inherently inefficient in any hardware.
Your functional lisp code is only fast because decades of hardware(large stacks and fast CPUs) and software optimizations transformed the heavy recursive code into loops and JMPs. There is however no such optimization for linked lists and lisp type tagging requires special hardware to be fast. Lispers are utterly divorced from reality where flat arrays/vectors are the key data structure(that maps 1:1 to memory).

Here how you "make arrays in LISP"
http://clhs.lisp.se/Body/f_mk_ar.htm
Somewhat more sane version:
https://lispcookbook.github.io/cl-cookbook/arrays.html
Arrays/Pointers/Vector space are abstraction over memory chunks, which are the most basic data structure there is.
There is nothing less fundamental than an array, yet LISP fails to provide a native array datatype.

132


VIP:

do not edit these