An emacs written in Common Lisp, running in StumpWM, running atop a CL Guix, Shepherd & GuixSD would be a thing of beauty.
An emacs written in Common Lisp, running in StumpWM, running atop a CL Guix, Shepherd & GuixSD would be a thing of beauty.
I agree, however my reasons for going towards Common Lisp vs Scheme wouldn't really be those, but basically that important stuff is already standardized, proven and documented (i.e. conditions&restarts, object oriented system), while on the Scheme world they are left to "roll your own" status.
I'd say Scheme is a great language for learning and exploring, while CL is a better choice for creating production software.
Heh, I find none of these things desirable :) I guess some people are just wired differently. I prefer a single namespace for all values, #F as the only false value, and (optionally) hygienic macros with syntax-case (which does not prevent traditional macros of the defmacro kind).
Maybe I just irrationally don't trust bytecode vm's.
For me, at least, elisp just feels like a primitive Common Lisp while Scheme feels like a completely different language with a similar surface syntax.
But if you see what was missing in elisp: object system, closures, keyword arguments, ... That stuff was also in LML.
I'm reminded of this article (https://fare.livejournal.com/189741.html), where this Common Lisp macro:
(defmacro nest (&rest r) (reduce (lambda (o i) `(,@o ,i)) r :from-end t))
Has to turn into this in Racket (which isn't quite Scheme): (define-syntax (nest stx)
(syntax-case stx ()
((nest outer ... inner)
(foldr (lambda (o i)
(with-syntax (((outer ...) o)
(inner i))
#'(outer ... inner)))
#'inner (syntax->list #'(outer ...))))))
And was incredibly difficult to reason about. And that author likes Racket.I'm not going to sit here re-evaluating Scheme, year by year, to see whether it's up to snuff yet.
Someone drop me an e-mail when Scheme gets a well-defined, left-to-right evaluation order, and when its imperative forms all return a stable value like #f or whatever.
(define-syntax nest
(syntax-rules ()
((nest x) x)
((nest x ... (y ...) z) (nest x ... (y ... z)))))
That one is quadratic according to the author, but for 1050 expands of a nest with 6 levels it is less than 10% slower. Whereas in chez scheme, the difference is even less (for more than 2000 expansions)Edit: Decided to stress test the chez scheme macro expader. for 30000 expansions, it was under 1s using the syntax-case version. I'd say that is very much good enough.
The smaller standard does not specify a low level macro facility. That doesn't mean that an implementation won't have one. No scheme has syntax-rules only.
I agree that the defmacro is simpler, but nobody said otherwise. The nest macro is more or less perfect for defmacro since it doesn't need hygiene.
If defmacro is so Important, there are several schemes with it out there, and if you really need it it is trivially implemented using low level hygienic macro facilities.