by masklinn · 3y ago · 0 comments
Closure is not a language so hopefully not?
> the language has matching immutable data structures for mutable ones [^1]
Looking at the lingo being used, the extremely limited breadth of ABI, and the complexity they assert around "immutable" data structures, they're clearly imperative data structures you can't mutate rather than the persistent data structures you'd expect from a strong clj inspiration.
This page looks a lot more like a description of python datatypes than clojure, the only bit that Python lacks is an official frozendict.
Very true, the typo is strong in this one.
> rather than the persistent data structures you'd expect from a strong clj inspiration
What do you mean by persistent here? I assume some kind of shared memory instead of copying? Or something with more practical implications like deep immutability?
> looks a lot more like a description of Python datatypes
I am surprised where this sentiment comes from. Because of the initial comment? Basically any language nowadays has maps, sequences and byte strings. If I had to draw a similarity to Python it would be something along the lines of first-class generators.
I mean the class of data structures called persistent: https://en.wikipedia.org/wiki/Persistent_data_structure
> I assume some kind of shared memory instead of copying?
Sure.
> I am surprised where this sentiment comes from. Because of the initial comment?
Because "tuple" for an immutable sequence is rather specific to Python.
And data structures related to clojure (or functional languages in general) would have some sort of logarithmic component because they'd be tree-based. Pretty much the only O(1) operation in functional data structures is prepending to a linked list.
> Because "tuple" for an immutable sequence is rather specific to Python.
As someone with a background in Swift, Rust and C#, all of which have the concept of a tuple, I did not make that connection, but thanks again.
They all have tuples, but AFAIK in none of them is a tuple a sequence (well not sure about C# it might be there, but I'd be surprised). Usually a tuple is a form of lightweight, anonymous, structure, so it's addressed by field (even if the fields are positions), you usually can't iterate through tuples, or "index" them using runtime variables (except through reflection).
That it is so in Python is somewhat peculiar, but makes sense within the context of the language (unpacking works on iterables, and thus sequences).