-
Couldn't load subscription status.
- Fork 44
Eval improvements #155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eval improvements #155
Conversation
|
@barter-simsum would you mind providing an approval if this looks good? Are there any potential risks with this that you foresee? |
|
Everything else lgtm, mostly nits |
|
Made changes and pushed them up |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More style nits
|
Also, I just realized that For example, the @mopfel-winrux What's the use of the |
|
@ashelkovnykov
Can you elaborate on this? Doesn't the command still goes to The idea of just using |
@joemfb want to weigh in here? |
|
I would remove |
|
#197 (comment) has some good context from @ashelkovnykov. The noun is the exclusive, universal data type of urbit. Jam is universal noun serialization. And the "newt" wire-framing is how we pass around those serialized nouns in a streaming context. Everything in urbit is a noun, The We'll want to have a The naming of |
…ional housekeeping needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will do
further refactoring, argument tweaks/renames, or additional behaviors (jam into a file vs print the bytes) can come in as needed.
Partially Resolves #197 Adds the `--cue` option to the `eval` utility. This allows jammed nouns to be passed over `stdin` and pretty-printed to `stdout`. Also includes a sub-option which will expect the incoming jammed noun to be Khan output. If the thread resulted in a `goof`, it's pretty-printed to `stderr` as a stack trace and the output is simply the `conn.c` header info (unique ID, `%avow` mark signalling Khan output, `%.n` loobean signalling thread failure). Also includes the "todo"s from the comments for #155.
I added the ability for the user pick two flags to pass to the eval subroutine.
The first is the
--jamflag. This takes the result from the inputted hoon code ,+jam's it and outputs it as a hexadecimal string.The second is the
--jamkhanflag. This takes the result from the inputted hoon code,+jam's it and outputs the noun wrapped in the proper%khanheader (leading zero, noun size, noun) as binary data.The proper use of the eval is as follows:
echo "(add 2 2)" | vere eval --jamkhan > test.jamYou can directly inject a
|meldcommand to a running pier as follows:echo "[1 %urth %meld]" | ./vere eval --jamkhan | nc -U ~/urbit/zod/.urb/conn.sockThis should be the easiest way to
+jama noun for%khanuseThis is a clone commit of #6048 on urbit/urbit