this post was submitted on 12 Nov 2023
1 points (100.0% liked)
Lisp
53 readers
3 users here now
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Janet.
It's not a lisp or lisp dialect because it is not built around lists. It doesn't even have cons cells.
I don't know that much about Lisp, but I don't understand this obsession with cons cells and (linked) lists. A cons cell is nothing more than a 2-tuple, which is equivalent to a 2-element array (and Janet has arrays!).
From a programmer's perspective the difference between an array and a list is also, I would say, very minor. So why is using linked lists instead of arrays a critical part of a Lisp?
If you were to use Janet arrays as one uses lists in a lisp, then you'd quickly find yourself in a performance tar pit. Arrays would be frequently allocated, freed, resized, copied, and so forth.
A linked list built around cons cells allows slicing, augmentation, filtering, and so on almost for free.
That means writing in a proper lisp lends itself towards almost thoughtlessly mutating and manipulating lists; whereas writing code in Janet means spending more care about what you're doing with the data structure.