|
|
|
|
|
by jnbiche
2515 days ago
|
|
> Generally Lisp is low to mid level as a programming language, I believe that no programming language with automatic memory management can be considered "low-level". That aside, why would you call Lisp "low- to mid-level"? Commonly-used implementations are at about the same level of abstraction as Ruby or Python. |
|
That's a view of a whole language and its implementation. Still it may have a range of features which are low level.
Lisp for example has Foreign Function Interfaces (FFI) with low-level interfaces and manual memory management.
Example: http://www.sbcl.org/manual/#Foreign-Function-Interface
Basic Lisp stuff like CAR and CDR were (almost) instructions on a CPU ( https://en.wikipedia.org/wiki/CAR_and_CDR ).
Something like a cons cell (the building block for lists) is basically a two-element vector. Lists were made by chaining them together via a CONS operator, which creates such a two-element vector.
Such a linked list data structure is pretty low-level and the typical mark&sweep GC of the early days is also relatively basic.
There is not much magic to it.
Many other programming languages have much more complex basic data structures (see object-oriented programming in Java with classes and instances, inheritance, interfaces, namespaces, ...). Compared to that the basic linked list in Lisp is primitive.
> I believe that no programming language with automatic memory management can be considered "low-level".
See the standards for Scheme or Common Lisp. There is not a word about automatic memory management in the specifications. Automatic memory management is a feature of an implementation, just like foreign function interfaces. Most implementations have a kind of garbage collector. But most implementations also have manual memory management.
People even write operating systems in Lisp sometimes: https://github.com/froggey/Mezzano