News for hackers. Stuff that matters.
Re:The Janet Language by lispm on Saturday February 18, 2023 @03:57AM (#34845260)
Lisp usually has a lot of non-list data structures like arrays. records, strings, classes/objects, hashtables, ... For some data structures there is built-in syntax and with an extensible reader (the extensible parser for s-expressions) the user can add additional syntax. Janet uses a non-extensible parser for the data syntax.

What Janet makes a 'not really a Lisp' is that "LISP" stands for "List Processor". Janet isn't exactly that, since it is not using linked lists as a core data structure - unlike Lisp where its List Processing features are built on top of linked lists made of cons cells.

(1 2 3) is called a "tuple" in Janet and represents something like an immutable array.

Re:The Janet Language by xigoi on Saturday February 18, 2023 @07:39AM (#34846461)
An array is just a different way to implement a list data structure.
Re:The Janet Language by lispm on Saturday February 18, 2023 @08:28AM (#34846781)
Lisp especially is built upon linked lists, which have different costs for (more or less) primitive operations (add to the front, get the front item, get a rest list, get a random element, add to the end, ...) compare to a primitive vector. There are also other features not easily replicated by vectors.

  CL-USER 40 > (rest '(1 2 3))
  (2 3)
Above does not allocate any memory.

  CL-USER 41 > (subseq '#(1 2 3) 1)
  #(2 3)
OTOH getting a random element has a different complexity in a linked list vs. a vector.

Above returns a new vector. Alternatively it would need a more clever implementation underneath.