emacs-eask / cli

CLI for building, running, testing, and managing your Emacs Lisp dependencies
https://emacs-eask.github.io/
GNU General Public License v3.0
137 stars 20 forks source link

What is the extend of depending on javascript? #140

Open Fuco1 opened 1 year ago

Fuco1 commented 1 year ago

I love Eask and the UX it provides and I wish it would get bigger adoption. I think one issue with that would be the javascript dependency.

Many people using Emacs do not use javascript and don't know how to install node (it's a bit of pain). Cask was using python which is almost on every computer and even that was a problem. Eventually, they got rid of the python dependency and it's now pure elisp.

I see that a lot of the javascript is used for parsing (yargs). If, hypothetically, we port yargs to elisp, would that be a lot more code left in JS?

There is https://github.com/rejeep/commander.el but it's very basic compared to yargs. We could either take it and improve it or start something from scratch.

Here's a little table of tools I've found in the space of package dev/management. All of them seem to be pretty dead except the first three.

| name     | stars | last commit  | # commits | pure elisp     | bin script     | url                                    |
|----------+-------+--------------+-----------+----------------+----------------+----------------------------------------|
| eask     |    62 | 2 hours ago  |      1710 | no, js         | bash, bat      | https://github.com/emacs-eask/cli      |
| cask     | 1200+ | 3 weeks ago  |      1178 | yes            | bash, bat      | https://github.com/cask/cask           |
| eldev    |   191 | Jan 21, 2023 |       523 | yes            | bash, bat, ps1 | https://github.com/doublep/eldev       |
| makem.sh |   123 | Dec 31, 2022 |       195 | no, bash       | no             | https://github.com/alphapapa/makem.sh  |
| keg.el   |    21 | Sep 23, 2022 |       323 | yes            | bat            | https://github.com/conao3/keg.el       |
| makel    |     0 | May 16, 2022 |        60 | no, bash, make | no             | https://github.com/DamienCassou/makel  |
| emake.el |    26 | Jun 9, 2019  |       255 | no, make       | no             | https://github.com/vermiculus/emake.el |
jcs090218 commented 1 year ago

I love Eask and the UX it provides and I wish it would get bigger adoption. I think one issue with that would be the javascript dependency.

Users can use binaries (executable), see install with binary, JavaScript isn't required. But you do need to install node for Eask development.

Many people using Emacs do not use javascript and don't know how to install node (it's a bit of pain). Cask was using python which is almost on every computer and even that was a problem. Eventually, they got rid of the python dependency and it's now pure elisp.

I recently had a discussion with flycheck's maintainers regarding Python vs Node, therefore, you can get more information here => https://github.com/flycheck/flycheck/issues/1957. The conclusion is node has a much stabler cross-platform capability.

Eldev is the tool that doesn't rely on any of these (Python or Node), here are my thoughts:

  1. Duplicate code, see their bin folder. eldev, eldev.bat, eldev.ps1, etc.
  2. Editing Elisp in script (like makem.sh)
  3. All of the above make project hard to maintain and develop
  4. To avoid more duplicate code (Pt. 1), they develop more within the actual elisp files. But starting Emacs directly is slow , you will always have a short delay when starting the tool, this situation is particularly bad on Windows. Cask also has this issue, but they stopped supporting Legacy Windows, so that's no longer relevant.

There is https://github.com/rejeep/commander.el but it's very basic compared to yargs. We could either take it and improve it or start something from scratch.

I know this tool but does it has some bug? I don't remember where I got the information, but like I mentioned above, I would like to avoid all the hassles. 😅

LMKWYT? ;)

Fuco1 commented 1 year ago

To me it makes sense. I haven't tried the binary install method. I guess the startup time might be a bit of a pickle to solve with pure elisp indeed.

jcs090218 commented 1 year ago

There is currently one issue with binary, see https://github.com/emacs-eask/cli/issues/104.

Basically, you cannot use:

$ eask run another-eask-command

In Eask-file:

(script "another-eask-command" "eask info")  ; ❌ This wouldn't work with binary, but running from node is good.
(script "test" "echo Hello!")                ; ✔️ Good!