This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-02-18
Channels
- # announcements (1)
- # asami (17)
- # babashka (43)
- # beginners (36)
- # biff (2)
- # calva (24)
- # clerk (3)
- # clj-kondo (9)
- # cljdoc (18)
- # clojure (16)
- # clojure-berlin (1)
- # clojure-europe (7)
- # clojurescript (8)
- # clr (4)
- # conjure (3)
- # cursive (2)
- # emacs (15)
- # funcool (4)
- # humbleui (2)
- # hyperfiddle (116)
- # kaocha (3)
- # malli (5)
- # membrane (23)
- # off-topic (16)
- # pathom (3)
- # reitit (25)
- # releases (3)
- # shadow-cljs (13)
- # xtdb (6)
I love emacs but hate writing emacs-lisp. Has anyone tried to translate some of the clojure.core goodies to emacs-lisp? I think what I'm missing the most are data structure literals, string operations and data transformation functions (e.g. assoc/merge/into).
I almost always (require 'cl)
whenever i use elisp since theres just not enough time or interest for me to learn the elisp way of doing things 😄
keep in mind such libraries have subtle bugs though
Hey, thank you both!
dash was actually the reason I asked the question 🙂 To be frank, I'd love to be able to use {}
and []
for maps/vectors. I don't think dash provides that but the functions look quite useful. I definitely don't need all of it but I'll probably do a surgical operation if that's ok with you @U07FCNURX, with proper attribution of course.
The fact that cl is built-in is a plus as I'm trying to focus on minimalism. I'll weigh my options, thank you both! 🙂
I wouldn’t worry about requiring s.el because most packages already do. There is a decent chance you already have it as a transitive dependency
Oh, good point
Another approach is doing the grunt work in a babashka script, and shelling out to that from Emacs Lisp. https://github.com/clojure-emacs/parseedn lets you work with EDN data from Emacs Lisp. See for example https://github.com/teodorlu/neil-quickadd/blob/master/neil-quickadd.el for a light approach to shelling out to babashka.
Sounds promising, thanks. I was just thinking that what I really want is babashka sci emacs but this is probably better (because you still have access to the existing ecosystem)
Here's something more magical: "write Clojure as Emacs Lisp forms". And it does have some subtle bugs that I don't know how to fix. Instead I'd prefer to put time into babashka scripts, and Emacs Lisp interop through parseedn.
Though I've been using M-x t-edn-pretty
a bit 🙂
where clojure is strong with data structures, emacs is strong with buffers, points (markers), rendering text. But yea there is a place where you start using hashmaps for performance and it stops being so nice.
i've lightly experimented with another approach where I run a tcp server which processes emacs lisp (described here: https://emacs.stackexchange.com/questions/39027/how-to-control-emacs-externally) , and connecting to it from clojure, so I can do some logic in clojure but then just output emacs lisp commands. I haven't gone very far with this but it seems potentially promising
I think this project might take that concept a bit further but I haven't properly tried it out yet https://github.com/clojure-emacs/clomacs. Two way clojure to emacs communication seems like it could be nice for doing complex things. But just the basic tcp server is nice for letting you write a clojure library that you can include in your dev environments that lets you open emacs files from your clojure repl
True sigmas transcompile elisp to clojure