emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
@ 2023-03-18  2:47 Christopher M. Miles
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher M. Miles @ 2023-03-18  2:47 UTC (permalink / raw)
  To: Org mode

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

For now, ob-clojure.el contains lot of code for ClojureScript. Only some
code has same functionality. Like CIDER backend. In the future,
ClojureScript part code will increase and different. So I suggest
separate them into two source code files.

WDYT?

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
@ 2023-03-18  3:17 stardiviner
  2023-03-18 12:23 ` Ihor Radchenko
  0 siblings, 1 reply; 7+ messages in thread
From: stardiviner @ 2023-03-18  3:17 UTC (permalink / raw)
  To: Org-mode

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

For now, ob-clojure.el contains lot of code for ClojureScript. Only some
code has same functionality. Like CIDER backend. In the future,
ClojureScript part code will increase and different. So I suggest
separate them into two source code files.

WDYT?

[stardiviner]           <Hack this world!>      GPG key ID: 47C32433
IRC(freeenode): stardiviner                     Twitter:  @numbchild
Key fingerprint = 9BAA 92BC CDDD B9EF 3B36  CB99 B8C4 B8E5 47C3 2433
Blog: http://stardiviner.github.io/

[-- Attachment #2: Type: text/html, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
  2023-03-18  3:17 [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el stardiviner
@ 2023-03-18 12:23 ` Ihor Radchenko
  2023-03-19 20:46   ` Daniel Kraus
  2023-03-20 11:36   ` Christopher M. Miles
  0 siblings, 2 replies; 7+ messages in thread
From: Ihor Radchenko @ 2023-03-18 12:23 UTC (permalink / raw)
  To: stardiviner, Daniel Kraus; +Cc: Org-mode

stardiviner <numbchild@gmail.com> writes:

> For now, ob-clojure.el contains lot of code for ClojureScript. Only some
> code has same functionality. Like CIDER backend. In the future,
> ClojureScript part code will increase and different. So I suggest
> separate them into two source code files.
>
> WDYT?

The only downside is that people might need to
(require 'ob-clojurescript)
I am thinking if ob-core.el should try to automatically guess the
correct library to be loaded.

Otherwise, I am neutral towards this split.

Up to Daniel.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
  2023-03-18 12:23 ` Ihor Radchenko
@ 2023-03-19 20:46   ` Daniel Kraus
  2023-03-20 11:20     ` Ihor Radchenko
  2023-03-20 11:36   ` Christopher M. Miles
  1 sibling, 1 reply; 7+ messages in thread
From: Daniel Kraus @ 2023-03-19 20:46 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: stardiviner, Org-mode


Ihor Radchenko <yantar92@posteo.net> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> For now, ob-clojure.el contains lot of code for ClojureScript. Only some
>> code has same functionality. Like CIDER backend. In the future,
>> ClojureScript part code will increase and different. So I suggest
>> separate them into two source code files.
>>
>> WDYT?

I'm not opposed to it, but I'm also not sure if it's worth it.
Without whitespace and comments, ob-clojure is only 261 LOC and without
having a closer look I would guess we would have to duplicate maybe 150
of those in ob-clojurescript.
It would make the implementation a bit cleaner but at the cost of
code duplication.
I would say we wait until the ClojureScript part really grows bigger
and then do a split if that should ever happen.
I could also see a scenario where we add support for ClojureDart
and/or ClojureCLR to ob-clojure. It would be very simple if they
have a CLI like the JVM Clojure.


> The only downside is that people might need to
> (require 'ob-clojurescript)
> I am thinking if ob-core.el should try to automatically guess the
> correct library to be loaded.

We could just (require 'ob-clojurescript) inside ob-clojure.el ?!

Cheers,
  Daniel


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
  2023-03-19 20:46   ` Daniel Kraus
@ 2023-03-20 11:20     ` Ihor Radchenko
  2023-03-20 11:44       ` Christopher M. Miles
  0 siblings, 1 reply; 7+ messages in thread
From: Ihor Radchenko @ 2023-03-20 11:20 UTC (permalink / raw)
  To: Daniel Kraus; +Cc: stardiviner, Org-mode

Daniel Kraus <daniel@kraus.my> writes:

>> The only downside is that people might need to
>> (require 'ob-clojurescript)
>> I am thinking if ob-core.el should try to automatically guess the
>> correct library to be loaded.
>
> We could just (require 'ob-clojurescript) inside ob-clojure.el ?!

Sure. Though it will go against the goal for not loading everything in
Org on startup. (Currently, Org startup is too slow for some people).

In any case, I was mostly thinking aloud in a broader context, not just
ob-clojure.el. For ob-clojure, either way is fine.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
  2023-03-18 12:23 ` Ihor Radchenko
  2023-03-19 20:46   ` Daniel Kraus
@ 2023-03-20 11:36   ` Christopher M. Miles
  1 sibling, 0 replies; 7+ messages in thread
From: Christopher M. Miles @ 2023-03-20 11:36 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: stardiviner, Daniel Kraus, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1943 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> stardiviner <numbchild@gmail.com> writes:
>
>> For now, ob-clojure.el contains lot of code for ClojureScript. Only some
>> code has same functionality. Like CIDER backend. In the future,
>> ClojureScript part code will increase and different. So I suggest
>> separate them into two source code files.
>>
>> WDYT?
>
> The only downside is that people might need to
> (require 'ob-clojurescript)
> I am thinking if ob-core.el should try to automatically guess the
> correct library to be loaded.

I think this is an good idea. It let user don't need to load
ob-<lang>.el before user really need it. The ob-core.el will
automatically load <lang> related libraries. For now I have to configure
ob-<lang>.el like bellowing to defer loading:

#+begin_src emacs-lisp
(use-package ob-clojure
  :custom (org-babel-clojurescript-backend 'cider)
  :commands (org-babel-execute:clojurescript)
  :config
  (add-to-list 'org-babel-load-languages '(clojurescript . t))
  (org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
  ;; let `ob-clojurescript' babel source blocks allow evaluation.
  (add-to-list 'org-babel-default-header-args:clojurescript '(:eval . "yes"))
  (add-to-list 'org-babel-default-header-args:clojurescript '(:noweb . "yes")))
#+end_src

The duplicated part code bellowing is repeated for every <lang>:

#+begin_src emacs-lisp
(add-to-list 'org-babel-load-languages '(clojurescript . t))
(org-babel-do-load-languages 'org-babel-load-languages org-babel-load-languages)
#+end_src

>
> Otherwise, I am neutral towards this split.
>
> Up to Daniel.


-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el
  2023-03-20 11:20     ` Ihor Radchenko
@ 2023-03-20 11:44       ` Christopher M. Miles
  0 siblings, 0 replies; 7+ messages in thread
From: Christopher M. Miles @ 2023-03-20 11:44 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: Daniel Kraus, stardiviner, Org-mode

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]


Ihor Radchenko <yantar92@posteo.net> writes:

> Daniel Kraus <daniel@kraus.my> writes:
>
>>> The only downside is that people might need to
>>> (require 'ob-clojurescript)
>>> I am thinking if ob-core.el should try to automatically guess the
>>> correct library to be loaded.
>>
>> We could just (require 'ob-clojurescript) inside ob-clojure.el ?!
>
> Sure. Though it will go against the goal for not loading everything in
> Org on startup. (Currently, Org startup is too slow for some people).
>
> In any case, I was mostly thinking aloud in a broader context, not just
> ob-clojure.el. For ob-clojure, either way is fine.

Yeah, loading only when necessary is great for startup. For non-expert
user, it's helpful, because they don't know configure it well.

-- 

[ stardiviner ]
I try to make every word tell the meaning that I want to express without misunderstanding.

Blog: https://stardiviner.github.io/
IRC(libera.chat, freenode): stardiviner, Matrix: stardiviner
GPG: F09F650D7D674819892591401B5DF1C95AE89AC3

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-03-20 11:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-18  3:17 [SUGGESTION] separate ob-clojure.el into Clojure part ob-clojure.el and ClojureScript part ob-clojurescript.el stardiviner
2023-03-18 12:23 ` Ihor Radchenko
2023-03-19 20:46   ` Daniel Kraus
2023-03-20 11:20     ` Ihor Radchenko
2023-03-20 11:44       ` Christopher M. Miles
2023-03-20 11:36   ` Christopher M. Miles
  -- strict thread matches above, loose matches on Subject: below --
2023-03-18  2:47 Christopher M. Miles

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).