4 ms·
I don't well understand this. How is clojure more efficient than common lisp? Would you explain further?
by kentrado 1y ago
I don't well understand this. How is clojure more efficient than common lisp?
Would you explain further?
- netbioserror 1y agoFrom a compute standpoint I guess I'm wrong. But from a modeling power perspective, I definitely prefer the clarity and uniformity of Clojure's standard library functions. Maybe that has something to do with its distinct data types, maybe not.
- rscho 1y agoWhat do you mean with 'distinct data types' ? Most lisps are strongly typed. SBCL even accepts type declarations.
- netbioserror 1y agoData structure types. In standard CL and Scheme, data structures are implemented at their base using cons cells, and their interpretation as tables, trees, queues, etc. is up to library functions. Unless I have somehow misinterpreted the selling points of classic Lisps, because Clojure and Janet data structures sell themselves as being not built this way. Clojure makes a different trade-off by building all its data structures off of hash array-mapped tries. But Janet goes out of its way to use efficient and closely-mapped base stores, even if the contained elements are dynamic Janet objects.
- Jtsummers 1y ago> In standard CL and Scheme, data structures are implemented at their base using cons cells That's not true. Both CL and Scheme have other data structures besides cons cells, and that's been true for the Lisp family of languages for nearly 70 years now. This bizarre belief that everything is a cons cell in Lisp and Scheme needs to go away.
- netbioserror 1y agoThanks for courteously linking me to the relevant documents! Very productive and good-natured of you.
- Jtsummers 1y ago> Thanks for courteously linking me to the relevant documents! Very productive and good-natured of you. Thanks for the sarcasm! Very productive and good-natured of you. For your reference: LISP 1.5 manual: https://www.softwarepreservation.org/projects/LISP/book/LISP%201.5%20Programmers%20Manual.pdf https://www.softwarepreservation.org/projects/LISP/book/LISP... Arrays were present in 1960. Admittedly, not much else but clear evidence that even then it wasn't just cons cells. https://www.lispworks.com/documentation/HyperSpec/Front/Contents.htm https://www.lispworks.com/documentation/HyperSpec/Front/Cont... - Common Lisp Hyper Spec which describes data structures other than lists and cons cells.
- netbioserror 1y agoFor someone who initiated hostility, you're a dismal failure at supporting your arguments. I'm not reading two entire manuals to find the citations you're referring to and should've cited yourself.
- Jtsummers 1y ago> I'm not reading two entire manuals to find the citations you're referring to and should've cited yourself. C-f that PDF for "array". For the other manual, I linked the TOC. It's right there on the page (arrays and hash tables, and you can follow up with structures and objects) and there's no reason to read the entire manual. I figured most people knew how to use a table of contents, I apologize if I expected too much from you.
- cess11 1y agoFlavors, from 1979 or so. https://www.softwarepreservation.org/projects/LISP/MIT/nnnfla1-20040122.pdf https://www.softwarepreservation.org/projects/LISP/MIT/nnnfl... LOOPS, from about the same time. https://interlisp.org/documentation/2024-loops-book-1.pdf https://interlisp.org/documentation/2024-loops-book-1.pdf More general discussion in a OOPSLA contribution from 1986. https://web.archive.org/web/20220817140051/https://interlisp.org/docs/1986-commonloops.pdf https://web.archive.org/web/20220817140051/https://interlisp... The 1988 book about CLOS, the approach that was later accepted in ANSI Common Lisp. https://doc.lagout.org/programmation/Lisp/Object-Oriented%20Programming%20in%20Common%20Lisp_%20A%20Programmer%27s%20Guide%20to%20CLOS%20%5BKeene%201989-01-11%5D.pdf https://doc.lagout.org/programmation/Lisp/Object-Oriented%20...
- rscho 1y agoOk, so I am sorry but this is an extremely uninformed take. Please have a look around in Racket's documentation before going any further: https://docs.racket-lang.org/ https://docs.racket-lang.org/