4 ms·
It also has a fraction of the features
by tsm 8y ago
It also has a fraction of the features
- pmoriarty 8y agoIn Chicken, those features might not be in the core language but in the libraries. It really depends on which features you need. If they're not in Chicken or its libraries, ask yourself if they're really worth the bloat of SBCL? Also, Chicken offers a number of other advantages apart from a much smaller footprint, like elegance, a less crufty and more modern syntax, and the ability to compile down to C.
- kazinator 8y ago> to compile down to C. This HN submission's referenced article ("Running Lisp in Production" (2015)) is about SBCL which compiles down to native code. There are CL implementations that compile to C, if you think that is better for some reason. For instance, derivatives of Kyoto Common Lisp, such as GNU Common Lisp. Or ECL: https://common-lisp.net/project/ecl/static/manual/ch34s02.html https://common-lisp.net/project/ecl/static/manual/ch34s02.ht... "The other type of compilation is the so-called "native" compilation. This process consists on translating the lisp source file to C language. The intermediate file is later compiled using a C compiler."
- lispm 8y agoThat the syntax of Scheme (from 1975) is more modern than the syntax of CL (from 1984) is a myth. It's more primitive. Later people added lots of features to Scheme, which were already in CL. Take keyword arguments... In essence Scheme is actually less elegant due to its too small design and the many bolted on features. Chicken: ((lambda (x y #!optional z #!rest r #!key i (j 1)) (list x y z i: i j: j)) 3 4 5 i: 6 i: 7) => (3 4 5 i: 6 j: 1) CL: ((lambda (x y &optional z &rest r &key i (j 1)) (list x y z :i i :j j)) 3 4 5 :i 6 :i 7) => (3 4 5 :I 6 :J 1) Is the CL code more crufty compared to the almost equivalent Scheme code? Sure not. or is #!optional now more modern than &optional? Guess where the Chicken feature originally came from ... The difference: the CL code works in every CL implementation. > and the ability to compile down to C. There are many implementations which do that. SBCL has the ability to compile to optimized native code with a type-inferencing compiler... Chicken is a great implementation with a nice ecosystem, but that it is more elegant than CL - while it copies lots of features from CL (like COOPS copies from CLOS) - is an illusion. http://wiki.call-cc.org/eggref/4/coops http://wiki.call-cc.org/eggref/4/coops > COOPS provides classes, generic functions and methods, similar in style and use to the classic Lisp object systems like Flavors, Loops or CLOS. For general information about object-oriented programming in the context of Lisp, consult one of the various books and guides available to the subject. Example: Chicken: (define-method (pop (stack <stack>)) (let* ((c (slot-value stack 'content)) (x (car c))) (set! (slot-value stack 'content) (cdr c)) x)) Let's see how it's in Common Lisp: (defmethod pop ((s stack)) (let* ((c (slot-value s 'content)) (x (car c))) (setf (slot-value s 'content) (cdr c)) x)) Which is more modern? To me it looks the same. The difference: the CLOS code runs in every CL implementation.
- kazinator 8y agoAlso: (defmethod popm ((s stack)) ;; don't clash with cl:pop macro (pop (slot-value s 'content))) ;; speaking of which, use it. I think you have to write your own pop macro in Scheme or find some lib.