hoon-mode.el icon indicating copy to clipboard operation
hoon-mode.el copied to clipboard

How to install herb?

Open apierz opened this issue 5 years ago • 7 comments

I am trying to get the commands to work to eval regions and buffers but it requires herb and I can't figure out what that is. I have tried searching on homebrew and emacs package lists and found nothing. There's something called herb on npm but I don't know how to turn what I installed that into a binary that emacs could find and then run.

Any advice you could give would be much appreciated.

apierz avatar Aug 18 '20 16:08 apierz

@apierz apologies, herb is definitely hard to find. We should probably release it a little more visibly.

From a clone of the urbit repo, and with Nix installed, use:

nix-env -f default.nix -iA herb

to install it.

/cc @philipcmonk

jtobin avatar Aug 18 '20 16:08 jtobin

I was able to clone the urbit repo, install nix, and run nix-env command you gave me. That created a herb bin. I symlinked it to /usr/local/bin/herb (I had to edit the path in hoon-mode.el as at somepoint MacOS decided to deny me access to /usr/bin). When I try the eval buffer command I get this:

Traceback (most recent call last):
  File "/usr/local/bin/herb", line 11, in <module>
    import requests
ImportError: No module named requests

I have requests installed for both Python 2 and 3 using pip. I get Requirement already satisfied if I try to install them.

apierz avatar Aug 18 '20 17:08 apierz

Hmm. If you just run the herb symlink with --help in your shell, does that work ok?

The reason that requests is not being found here is that Nix manages dependencies itself, so it's using its own Python toolchain, etc., and can't see whatever's installed via pip.

cc @eglaysher @liam-fitzgerald or someone who actually uses emacs, is there anything special that you needed to do here?

jtobin avatar Aug 19 '20 15:08 jtobin

And herb is getting launched without said nix dependencies in the PYTHONPATH or similar?

On Wed, Aug 19, 2020 at 08:10, Jared Tobin [email protected] wrote:

Hmm. If you just run the herb symlink with --help in your shell, does that work ok?

The reason that requests is not being found here is that Nix manages dependencies itself, so it's using its own Python toolchain, etc., and can't see whatever's installed via pip.

cc @eglaysher https://github.com/eglaysher @liam-fitzgerald https://github.com/liam-fitzgerald or someone who actually uses emacs, is there anything special that you needed to do here?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/urbit/hoon-mode.el/issues/19#issuecomment-676485806, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAOFPBWNKNJWLOQDIOJFED3SBPTNLANCNFSM4QDX6G4A .

ohAitch avatar Aug 19 '20 18:08 ohAitch

I get the same error trying to run herb from the terminal. When I copied the herb.py to /usr/local/bin I got it to run. After messing with it for a little bit I got this to work on the command line:

➤ herb --dojo '(add 2 2)' ~/urbit-v0.10.8-darwin/zod
4

When I try the eval command in emacs I get this error:

WARNING <module> 416 - No pier or port specified, looking on port 12321
WARNING <module> 447 - unrecognized response
<html><head><title>500 Internal Server Error</title></head><body><h1>Internal Server Error</h1><p>There was an error while handling the request for &quot;/&quot;.</p><code>/app/lens/hoon:&lt;[36 3].[61 64]&gt;<br />/app/lens/hoon:&lt;[35 3].[61 64]&gt;<br />/app/lens/hoon:&lt;[33 3].[61 64]&gt;<br />/app/lens/hoon:&lt;[32 3].[61 64]&gt;<br /></code></body></html>

Which is similar to what I got when I was messing around with herb on the command line and malformed a command. Is there something else I need to put in the .hoon file for it to eval properly? How would I use the eval command to test input?

apierz avatar Aug 20 '20 21:08 apierz

@baudtack Can you advise on this one by any chance? This Vim user (i.e. me) is in the wrong neighbourhood.

jtobin avatar Aug 26 '20 11:08 jtobin

It looks to me like herb changed and hoon-mode.el hasn't been updated. It's a pretty clunky interface that just like builds a string of what you're trying to do and then asks the shell to evaluate it. I've ended up not really using this feature as outside of small chunks of self contained code, it's not actually useful. I'm not sure when I'll have the time to update it but someone else can have a go at it. It should be relatively straightforward.

baudtack avatar Aug 26 '20 18:08 baudtack