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?
I think it’s because it’s more natural to represent a tree with a linked list. The body of Lisp code is also a tree - some even say an “abstract syntax tree”, but that’s not fully accurate - which facilitates the syntax manipulation done with macros.
Not just trees; any operation that involves mutating or manipulating list-like structures is more efficient than arrays.
Some examples:
Removing an element is delinking a single cons cell, vs either copying to a new array or shuffling all subsequent elements left. It also doesn’t break any references to list cells, even the removed cell.
Slicing, at minimum, only requires having the cons cell at the new head of the list; rather than either a special datastructure to represent a slice, or copying to a new array.
Filtering means pulling cons cells from a nursery on an ad-hoc basis, using them to collect filtered elements into a new list of unknown length. With an array, you need a pre-allocated buffer that either sets a limit on the size of the filtered set, or requires reallocation on resize with a O(n) copy.
Just, in general, you can be a lot more relaxed with flinging data around lists without having to think about the algorithmic overhead of allocating, reallocating, copying and shuffling arrays.
I am pretty late to the Lisp world myself, but this cons obsession doesn’t make any sense to me either. I think it is useless gatekeeping.
My personal definition is if someone saw it would they call it a Lisp? Janet is definitely closer to a Lisp, than an ML or C-styled language. Therefore, it is 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.
Julia is implemented in Scheme I believe, and it had (has?) a lisp-style homoiconic syntax compiler still inside.
Elixir, which people mentioned, is not homoiconic, but all of its syntax are implemented in a list of threes [module, function-name, arity], and so its macros are quite powerful and hygienic (*). It has a really great REPL story (you can connect through IEX to any Actor in the server). Elixir itself is 100% dynamic functional paradigm, just like Scheme* or Clojure. And Message-Sending paradigm is ridiculously powerful.
I believe Nim is also interesting, with its heavy emphasis on macros as a way to do systems programming. No homoiconity here too though.
ISWIM
Lua - uses tables (hashmaps) for everything like Lisp uses lists (but not homoiconic), and has some functional features including first-class functions and tail call optimisation.
red/rebol lol its not even a question
JavaScript?
Julia is very inspired by Lisp and has a lot of things in common with it. I doubt its the closest, but it’s not too far
How about FORTRAN…because the bar is so low that pretty well everything is a Lisp 🤣
Lisp is an influentual - like smalltalk you see it’s influence in every modern programming language - but unpopular.
If you define Lisp as parenthetical syntax you can include Common Lisp and Scheme implementations, Clojure, LFE, and the Racket Lisp dialects.
Rhombus, Haskell, Elixir, Ruby, Dylan, Smalltalk, R, Julia, Rust, TCL, the ML’s, Prolog, Wolfram and Javascript are not Lisps.
All important languages that don’t need validation with a nonsensical ‘lisp’ label.
Definitely JavaScript, but I think there is a really strong argument for Python.
There is a language called Hy, which is a Clojure-like LISP that runs on the Python runtime, fully interoperable with Python code in the same runtime. That is, you can freely import between Hy and Python code. Hy also has macros. IIRC they just use the Python standard library for all of this.
Python actually has really powerful metaprogramming features, especially today. They’re just not homoiconic without Hy.
Where Python—CPython at least—falls short is that you can’t REALLY do something like replace the exception handling system. It’s not turtles all the way down. But the runtime is surprisingly close in for most use cases.
Lua. The great secret of Lua is that it is lisp, without brackets, without bloat.
Quoting code is the only thing it lacks, but…
We still have not completely dismissed the idea of providing Lua with a macro system: it would give Lua extensible syntax to go with extensible semantics.
– The Evolution of Lua (2007)
Rhombus is built on racket which is built on scheme
“Rhombus: A New Spin on Macros without All the Parentheses” https://youtu.be/c7S5WPsw_gM?si=yKPhYtBtjavxKLHN&t=4374
Concatenative languages have the same sort of homoiconiciy, e.g. Factor or Darhflow’s Elymas.
FORTH has the same kind of minimalism as McCarthy’s EVAL.
i think for something to be like Lisp without actually being Lisp it would need to be functional and feature homoiconicity, or at least something like homoiconicity.The only language like that, that many people would not call a Lisp anyway, is Julia.
EDIT: wikipedia says Elixir too but I don’t really know anything about Elixir…
TCL