emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: [PATCH] Re: ob-clojure.el: Add ClojureScript interface
Date: Sat, 15 Feb 2020 11:42:25 +1100	[thread overview]
Message-ID: <875zg8el5a.fsf@gmail.com> (raw)
In-Reply-To: <87v9o8zyzs.fsf@gnu.org>


I wonder if it would make sense to use shadow-cljs rather than cider as
a back end for evaluating clojurescript?

More generally, I wonder if there would be any benefit in considering a
Clojure CLI Tools back end integration and bypassing CIDER altogether?
While I love CIDER, I'm not sure it is the right tool for a org-babel
type environment. I've recently been moving my projects from being lein
based to Clojure CLI tools based and while I still use CIDER for larger
development work, find the CLI great for basic execution of code. For
me, CIDER has a lot of additional overhead and complexity which is often
of little benefit to what I want via babel and I've found it to be a
very fragile environment. 

Sean Corfield has a great example deps.edn file at
https://github.com/seancorfield/doc-clojure and it shows how you can
hook in various different REPLs - for example, a basic socket based
REPL, which might provide a cleaner and more stable back end interface
for evaluating Clojure (and potentially clojurescript) for babel.

My rough and immature idea would be to have a back end that allowed you
to specify CLI aliases in the block header. These aliases can do a lot,
including select whatever execution environment you want the code to run
in. The back end could have default aliases for basic evaluation and it
could all be based around a socket REPL, which should make
sending/reading from the REPL fairly straight-forward. 

As I said, this is an initial and immature idea, but I think it could
provide a back end which was a little more like other babel back ends
and may be less fragile than one based on CIDER (plus I suspect it would
be faster). What do people think? Is this something worth investigating
further?

Bastien <bzg@gnu.org> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> I use CIDER (sesman) keybinding =[C-c C-s d]= on ob-clojure src
>> block to link current buffer directory to CIDER REPL session.
>
> I simply start Cider with C-c M-j and then execute the Clojure source
> block with C-c C-c, it works fine.
>
>> I guess this should work for ClojureScript src block too.
>
> IMHO it works differently for ClojureScript, as C-c M-J doesn't know
> how to start a ClojureScript session unless you're in a directory with
> the proper cljs configuration (be it figwheel-main.edn, dev.cljs.edn,
> whatever.)  At least this is how I made it work.


-- 
Tim Cross

  reply	other threads:[~2020-02-15  0:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-22 20:49 [PATCH 0/4] Clojure mode patches roberthambrock
2018-04-22 20:50 ` [PATCH 1/4] org-src.el: Fixed dynamic fontification bug roberthambrock
2018-04-23  9:23   ` Nicolas Goaziou
2018-04-22 20:50 ` [PATCH 2/4] ob-clojure.el: Add ClojureScript interface roberthambrock
2018-04-23  2:45   ` stardiviner
2018-04-23  9:24   ` Nicolas Goaziou
2018-04-29 14:47   ` stardiviner
2018-10-25  6:11   ` stardiviner
2020-02-12 13:16   ` stardiviner
2020-02-12 17:09     ` Bastien
     [not found]       ` <87y2t6fqwj.fsf@gmail.com>
2020-02-13 16:04         ` [PATCH] " Bastien
2020-02-14  5:14           ` stardiviner
2020-02-14 10:02             ` Bastien
2020-02-14 15:17               ` stardiviner
2020-02-14  5:24           ` stardiviner
2020-02-14 10:02             ` Bastien
2020-02-14 15:15               ` stardiviner
2020-02-14 20:40                 ` Bastien
2020-02-15  0:42                   ` Tim Cross [this message]
2020-02-16 23:17                     ` Bastien
2020-02-16 23:33                       ` Tim Cross
2020-02-16 23:51                         ` Bastien
2020-04-28  9:29                       ` [BUG] ob-clojure.el new backend 'inf-clojure not compatible with latest version inf-clojure stardiviner
2020-05-22 15:12                         ` Bastien
2020-02-18 13:01                   ` [PATCH] Re: ob-clojure.el: Add ClojureScript interface stardiviner
2020-02-18 13:15                     ` Bastien
2020-02-19 15:51                       ` stardiviner
2018-04-22 20:50 ` [PATCH 3/4] ob-clojure.el: Use :ns flag in org-src-edit roberthambrock
2018-04-23  9:26   ` Nicolas Goaziou
2018-04-29 14:47   ` stardiviner
2018-04-22 20:50 ` [PATCH 4/4] ob-clojure.el: Add ClojureScript tangle language extension roberthambrock
2018-04-23  9:28   ` Nicolas Goaziou
2018-04-23  9:29 ` [PATCH 0/4] Clojure mode patches Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875zg8el5a.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).