5 ms·
If CL had only two namespaces, it would be odd and random, but not unique. It's like writing `./foo` vs `foo` in shell. Common Lisp is naturally more like op
by nabla9 6y ago
If CL had only two namespaces, it would be odd and random, but not unique. It's like writing `./foo` vs `foo` in shell. Common Lisp is naturally more like operating system than programming language anyway.
But once you realize that CL has more than two namespaces (I think it has at least nine in the language itself, unlimited in user programs) it's easier to understand how it can be more than historical accident. People are used to thinking words in context.
I do mostly numerical programming today. Common Lisp would have been my preference and IMHO much better than Python I have no time to rewrite numpy or R libraries in CL.
- phoe-krk 6y agoThe standard Common Lisp namespaces I can count off the top of my head are variables/symbol macros, functions/macros, compiler macros, types/classes/condition types, class slots, TAGBODY tags, BLOCK names, THROW tags, restarts, documentation types. Users can easily define new ones.
- dreamcompiler 6y agoAnd types and classes are subtly different namespaces BTW. Try specializing a method on KEYWORD. In pure ANSI implementations you can't because KEYWORD is a type but not a class, and method specializers have to be classes.
- phoe-krk 6y agoYes, but defining a class always defines a matching type - hence they share a namespace in a way.
- deleted 6y ago[deleted]
- dan-robertson 6y agoI’m not sure I’d count compiler macros as a separate namespace to functions or macros. It feels like they’re the same to me. I think I also wouldn’t count throw tags as a namespace as they can be objects rather than symbols (but then again lists like (setf foo) are valid function names). I think method combinations and packages are other namespaces.
- phoe-krk 6y agoYes - thank you for the additional namespaces and about the THROW tag correction. As for compiler macros, they do have their separate namespace, accessible via the `compiler-macro-function` function. They can be invoked instead of functions, but they exist completely on their own.
- deleted 6y ago[deleted]
- dreamcompiler 6y ago> I have no time to rewrite numpy or R libraries in CL It's been done. I have no experience with it but a numpy clone in CL exists. https://github.com/numcl/numcl https://github.com/numcl/numcl
- thrwerwe234324 6y agoNo it hasn't. Ignoring API compatibility and speed etc. (numcl doesn't talk to BLAS/LAPACK IIRC), even the basic datastructure isn't quite there. Numcl uses fixed contiguous lisp arrays as opposed to the strided ones that are standard in Numpy. P.S- There are atleast 5-6 attempts to build something of the sort starting all the way back from Matlisp, and none of them are feature complete. The lisp curse is very much true it'd seem.
- peatmoss 6y agoJulia (runner up R) feel like the lispyest non-lisps to do serious numerical work in. Julia’s at the point where it has some best-in-class libraries as well as some frustrating blind spots. With Julia I can almost pretend I’m using a straight-up lisp. The multiple dispatch in Julia is quite nice and is sort of “the big idea” that Julia uses to be so magical.
- pjmlp 6y agoSimilar to Dylan's experience, sadly Apple canned it and it never got that much uptake afterwards. However there is OpenDylan for anyone that would like a go at it, including the old book describing the language.
- peatmoss 6y agoI’ve heard people talk about how similar Dylan and Julia are for a long time, but have never used Dylan myself. Are there any things that are standouts for Dylan as compared to Julia that are worth checking out? I feel like Julia is pretty great, and has a good amount of inertia behind it in the domains that I frequent, but I’m curious about (Open)Dylan from the perspective of someone who’s used both.
- dan-robertson 6y agoI feel like Dylan is much more dynamic and OO than Julia. I don’t think there’s a way to have parameterised types (like generics in Java or C#) and a lot of the arguments for Julia’s type system are about being able to generate efficient code by being informed by the types. The parameterising complicates the subtyping relationships needed to specify how multiple dispatch works.
- eigenspace 6y agoSorry, maybe I'm misreading your comment, but are you saying that julia doesn't have parameterized types? If so, that's untrue, but maybe you're saying Dylan doesn't have parameterized types? It's a little unclear in the text. > The parameterising complicates the subtyping relationships needed to specify how multiple dispatch works. I don't think it adds all that much complication actually, and it adds a ton of extra expressive power. For instance, our arrays are parameterized by their element type and their dimensionality, so Array{Int, 1} is a 1D (vector) array of Ints whereas Array{Complex{Float64}, 2} is a 2D (matrix) of Complex Float64s. This is really important for making the most of multiple dispatch imo because I can write methods which take advantage of as much type information as possible. This isn't just helpful for performance, but also helpful for just expressing your algorithm in a clear and general way.
- linschn 6y agoCheck out numcl, it's numpy in common lisp!
- deleted 6y ago[deleted]