It's useful to know what a function takes and produces, so this changes the autocomplete type prettyprinter to emphasize those. This also gives a nice syntax for molds. Examples:
```
-----
add {a/@ b/@} -> @
~zod:dojo> add
-----
term * -> @tas
~zod:dojo> term
-----
sign-transaction {tx/{nonce/@ud gas-price/@ud gas/@ud to/@ux value/@ud data/@ux chain-id/@ux} pk/@} -> @ux
~zod:dojo> sign-transaction🔑ethereum
-----
wind {a/(* -> *) b/(* -> *)} -> * -> ?({$give p/*} {$pass p// q/*} {$slip p/*})
~zod:dojo> wind
```
This is initial support for type-aware tab completion. When you hit tab, it tries to complete the word you're in the middle of using a face or arm in the subject at that point in the code. It also shows all possible matches and their associated types. It's nearly instantaneous. Notes:
- It advances to the longest common prefix, so if you hit tab on `ab` and the only possible results are `abcde` and `abcdz`, then it'll write `abcd` and print both out (with their types).
- If there are fewer than ten matches, it prints the type along with the face. Printing types is too slow to use all the time, but with 10 it's essentially instantaneous.
- The match closest in the subject to you (i.e. smallest axis number) is displayed lowest (closest to your focus).
Examples below, where `<TAB>` represents me hitting tab while my cursor is at that position (the line with the `<TAB>` is not preserved in the actual output).
```
~zod:dojo> eth<TAB>
-----
ethereum #t/<11.qcl {<3.ltb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141> <21.yeb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141>}>
ethereum-types #t/<3.ltb 27.ipf 7.ecf 36.uek 92.bjk 247.ows 51.mvt 126.xjf 41.mac 1.ane $141>
~zod:dojo> ethereum
~zod:dojo> |= zong=@ud z<TAB>
-----
zing #t/<1.dqs {* <126.xjf 41.mac 1.ane $141>}>
zap #t/<1.iot {tub/{p/{p/@ud q/@ud} q/""} <1.rff {daf/@t <247.ows 51.mvt 126.xjf 41.mac 1.ane $141>}>}>
zuse #t/$309
zong #t/@ud
~zod:dojo> |= zong=@ud zo<TAB>
-----
zong #t/@ud
~zod:dojo> |= zong=@ud zong
~zod:dojo> <TAB>
hoon-version
trel
quip
pole
unit
qual
lone
... about 600 more lines ...
unity
html
zuse
eny
now
our
~zod:dojo>
```
Functionally, this is in a state where I'd be comfortable shipping it. It doesn't interfere with anything if you don't press tab, and it's perfectly OTA-able. I do think its output is a little verbose, but that can be tuned over time as people try it and determine what feels good in practice.
Additional notes:
- There are plenty of similar systems for other languages, but my most direct inspiration is Idris's editor tools. This is implemented for the dojo, but I actually want it in my editor, which is why the meat is all defind in a library. I've only tested on dojo one-liners, so I don't know the performance on large blocks of code.
- The default type printer isn't great for this use case. In particular,
- Cores should not print anything about their context
- The `#t/` should go away
- If it looks like a gate, we should print its return value
- Maybe special handling for molds, but if the above is done, then for example `bone` is `* -> @ud`.
- The worst part about our wing ordering is that it really screws up tab completion. You want to do `point.owner-address` instead of `owner-address.point` because that lets you type `point.ow<TAB>`. I weakly prefer reading it how we do it now, but it's really not great. You could do an (dojo-specific?) alternate syntax of `point;owner-address`; this is a simple transformation.
- Regardless of the above, this should handle the case where we're in the middle of defining a wing; it doesn't right now.
- When a variable is shadowed, we show both of them. We should probably show the shadowed one with a `^`.
- We probably shouldn't print out hundreds of results. Maybe just the closest 50 with ellipses.
- This gets you any face in your subject, regardless of whether its type is reasonable. We could limit that some by copying the `gol` logic in mint, so that if the pseudo-backward-inference engine happens to know what type it should be, you can filter the tab results according to if they nest in that type. This would be "strongly type-aware".
No longer overwrite messages' timestamp on-receive, instead keeping whatever
timestamp was set by the sender.
This behavior matches that of the late Hall.
* jt/release-pills:
build: add ropsten-pills target to Makefile
build: add Ropsten derivations for arvo and pills
vere: change default bootstrap pill URI
Signed-off-by: Jared Tobin <jared@tlon.io>
* la-chat-sidebar:
chat-ui: fix image previews from url types
chat-js: make clicking a url message open in a new tab
chat-js: fix chat sorting and selection in sidebar
Signed-off-by: Jared Tobin <jared@tlon.io>
Until now, clients of Jael have had to store the first-seen rift if they
want to reliably detect breaches. Otherwise, they would get a false
positive if they heard an old message about a breach (eg if you kick
azimuth-tracker). Clay and Gall did this correctly, but Ames did not.
Jael already maintains this state, so I added a notification to the
existing subscription that happens whenever it notices a breach (a diff
or full where the new rift is greater than the old one).
Because this is an issue on the live network, I wrote state adapters
for Gall and Clay. The Gall one just removes the rift from our state,
but the Clay one is much more involved because we have to upgrade
instances of the clad monad that are possibly in progress.
Specifically, since more input is possible than before, we must wrap any
in-progress instances of the monad in a function that handles the
potential new input from Jael. This temporarily preservers a copy of
the old kernel, but only until the current commit/merge/update has
completed.
The real solution for Clay is to factor out those IO-heavy instances to
userspace tapp/async/imp/threads, and if an upgrade happens in the
middle, you should simply restart them.
Fixes#1852
Arvo testnets typically use Ropsten's deploy of the Azimuth contract
instead of mainnet's. This commit adds an 'arvo-ropsten' derivation for
Arvo as specialised to Ropsten.
In addition to using a different Azimuth address in %zuse, this also
configures %ames and :acme appropriately for running an alternate
network on Ropsten. %ames has its protocol version incremented, and
:acme uses the Let's Encrypt staging API.
Included here are derivations for creating brass and ivory pills using
arvo-ropsten, to boot.
Vere will attempt to download a pill from https://bootstrap.urbit.org if
not given one explicitly. These pill filenames have traditionally had
the format:
urbit-$URBIT_VERSION.pill
but this is inconsistent with the manner in which versions are referred
to elsewhere. For example, release binaries are packaged in tarballs
with the names:
urbit-linux64-v$URBIT_VERSION.tgz
urbit-darwin-v$URBIT_VERSION.tgz
Note the 'v' prepended to URBIT_VERSION.
From v0.9.2 forward it is expected that bootstrap pills will also use
the 'v' prefix, i.e.
urbit-v$URBIT_VERSION.pill
so this commit makes the appropriate change in the daemon.
* claz-invites-newline:
claz: do invite file reading in +read-invites
claz: ignore empty lines in invites file
Signed-off-by: Jared Tobin <jared@tlon.io>
* publish-fixes:
publish: auto-resubscribe on quit, crash on failed subscription
publish: added permission logic to %serve and import flows
Signed-off-by: Jared Tobin <jared@tlon.io>
fc7901d2 refactored much of +ap-peek, but introduced a bug in the
process. The relevant diff from that commit is as follows:
- =/ =path [ren tyl]
- =/ =vase !>((slag p.u.cug path))
- (ap-slam q.u.cug p.arm vase)
+ =/ index p.u.maybe-arm
+ =/ term q.u.maybe-arm
+ =/ =vase
+ =/ =path [term tyl]
+ =/ raw (slag index path)
+ !> raw
+ (ap-slam term p.arm vase)
Note that [ren tyl] was replaced with [term tyl], where 'term' and 'ren'
are not equal. This commit merely rights that wrong.
This removes the baked in codedump inspection and wrapper scripts
in favour of downstream tooling overriding this as necessary by
using FROM <image> in their respective dockerfile.
* worker-memory:
u3: removes "worker_send_replace" printf
u3: statically measure memory on startup if < 1/2 the loom is free
u3: restore memory reclamation every 1k events
u3: print the size of the free lists on |mass
Signed-off-by: Jared Tobin <jared@tlon.io>