Commit Graph

94 Commits

Author SHA1 Message Date
Philip Monk
ee63e122ea
dojo, auto: move insert-magic logic to lib/auto
This changes the entry-points in lib/auto so that clients never have to
handle magic-spoon.  You can specify either a tape of code with a
position index or a preparsed hoon (presumably you ran +insert-magic
before parsing).
2019-10-31 14:56:54 -07:00
Philip Monk
4482997a16
dojo, drum: give tab completion as true output
This stops slogging the tab completion and intead adds a +sole-effect
for tab completion output.  This is morally correct, and it lets dojo
clients show tab completions how they want.  For example, web dojo could
implement this as a drop-down box.

Another advantage is that this puts the rendering logic in drum, which
knows the width of the terminal.  Thus, we can make sure each match
takes no more than one line by truncating with ellipses.  If there's
only one match and it's already fully typed, then we display the whole
type.
2019-10-31 14:36:14 -07:00
Philip Monk
4d0e77a6b2
dojo: add a better function printer
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
```
2019-10-31 13:56:20 -07:00
Philip Monk
76b917f426
dojo: add tab completion
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".
2019-10-30 23:19:25 -07:00
Joe Bryan
fa01bfb0a5 hoon: moves new pretty-printer back into userspace 2019-10-17 17:52:45 -07:00
Logan Allen
b12e305c9c apps: added permission hook and chat-view %join action 2019-10-11 14:09:30 -07:00
Jared Tobin
77af7aff72
Merge branch 'claz-invites' (#1809)
* claz-invites:
  claz: Implement batch invites
  keygen: Add ownership-from-ticket function

Signed-off-by: Jared Tobin <jared@tlon.io>
2019-10-10 10:47:59 +04:00
Fang
e6775d0907
keygen: Add ownership-from-ticket function
Many use cases care only for the ownership wallet. Using a function like
this, that derives exclusively that, saves computation time.
2019-10-09 21:19:04 +02:00
Fang
9d63a3e9c7
drum: Ensure dojo prompt on-boot
The previous method for doing this relied on "dojo" being first when
sorting alphabetically, which is not the case anymore.
2019-10-09 18:02:03 +02:00
Fang
b7f1e9c578
Merge branch 'odyssey-wip' into odyssey-chat-cli 2019-10-08 23:32:57 +02:00
Fang
816535c311
drum: Boot with %chat-cli, without %hall & %talk
Also refactors the surrounding code in +deft-apes.
2019-10-08 23:19:05 +02:00
Fang
24859907aa
chat-cli: Cosmetic improvements
Better variable naming. Trailing newline.
2019-10-08 23:00:46 +02:00
Fang
e567de9c18
chat: Move eval logic out of /lib/chat-json
This allows us to always include the bowl when evaluating a code letter.
2019-10-08 22:44:20 +02:00
Fang
9532857ef5
chat: Move eval logic into lib 2019-10-08 22:06:28 +02:00
Logan Allen
6ab2879b81 chat: fixed eval function to disable scry 2019-10-08 12:13:29 -07:00
Logan Allen
fbbb3830b2 chat: style fixes, removed some redirect bugs from chat 2019-10-08 10:11:18 -07:00
Logan Allen
79903ff9f5 chat: changed wire format and quitting subscription properly on ban 2019-10-07 17:35:48 -07:00
Logan Allen
39a5017254 chat: added old @ messages, now called %me messages 2019-10-03 13:33:07 -07:00
Logan Allen
693b6f2b81 hood: added chat-store, hook, and view to startup 2019-10-02 18:30:50 -07:00
Logan Allen
0f5eea480d chat: added new JS files, deleted old chat.hoon 2019-10-02 18:30:41 -07:00
Logan Allen
f9377536fb app: Added chat store, hook, marks, and view. 2019-10-01 10:18:36 -07:00
Logan Allen
ee92862785 hood: start up groups and permissions 2019-09-30 16:43:09 -07:00
Logan Allen
4b01718d76 apps: added group/permission stores, hooks, marks 2019-09-30 14:46:07 -07:00
Logan Allen
166465af59
zuse: added path, tank, string utils to en/dejs 2019-09-30 01:31:46 +04:00
Jared Tobin
5c99f33271
Merge branch 'ted/verb' (#1754)
* ted/verb:
  update pill
  hood: |knob {tag} {level} to set dill verbosity
  dill: set verbosity by error tag
2019-09-29 21:09:05 +04:00
Ted Blackman
0bf9e98d08
hood: |knob {tag} {level} to set dill verbosity 2019-09-29 20:45:10 +04:00
Jared Tobin
ba6f60cc66
Merge branch 'la-remove-hall-hood' (#1771)
* la-remove-hall-hood:
  hood: remove hall dependency.

Signed-off-by: Jared Tobin <jared@tlon.io>
2019-09-27 15:41:23 +04:00
Logan Allen
707a667d47 hood: remove hall dependency. 2019-09-26 15:03:13 -07:00
Philip Monk
a4dcad7d46
gall: unsubscribe after breach
fixes #1431
2019-09-24 15:00:16 -07:00
Logan Allen
1b87eb2c3c
chat: message processing time down to 60ms 2019-09-20 11:43:30 -02:30
Joe Bryan
f5263e0395
talk, chat: disables scry in hoon eval
We don't care about the static types in the use-cases where we need to
prevent scry (to prevent accidental data disclosure). We can evaluate
the expression, virtualized and untyped, and then just clam.
2019-09-08 19:45:20 -02:30
Jared Tobin
0bd06fe210
Merge branch 'jt-gall-refactor' (#1668)
* jt-gall-refactor: (76 commits)
  gall: fix issue id in comment
  pills: update solid
  gall: handle foreign coup success
  gall: only print peek bad result if bad
  gall: add basic test harness
  pills: update solid, brass, ivory
  gall: fix obvious nest-failing tisdot
  gall: change '-state' to '-core' for +mo and +ap
  zuse, gall: deprecate 'club'
  zuse, gall, eyre: deprecate 'cush'
  zuse, gall, eyre, dojo: deprecate 'cuft'
  gall: remove slam-related printfs
  gall: remove deprecated 'mak' from 'agents'
  gall: use less vertical spacing throughout
  gall: add comment re: unpopulated wex
  gall: use less vertical separation when wuthepping
  gall: fix whitespace
  gall: don't define 'move' as a pair
  gall: don't give faces to tags
  gall: gut some unused stuff
  ...
2019-08-29 19:05:25 -02:30
Jared Tobin
fa64a8092a
Merge branch 'philip/autocommit' (#1662)
* philip/autocommit:
  kiln: add autocommit
2019-08-27 09:18:36 -02:30
Philip Monk
a25b082e04
dill, helm: add lite boot option with -l 2019-08-26 11:04:24 -07:00
Philip Monk
4958dc506d
kiln: add autocommit 2019-08-25 02:11:02 -07:00
Philip Monk
ec9eedd50f
ph: clean up card structures 2019-08-22 15:33:52 -07:00
Jared Tobin
5798a50c40
helm, drum: remove deprecated %load
This was an artifact of %gall's old 'culm' type, which was removed in
1fe4ff1605 (2019-04-12).
2019-08-22 12:33:19 -02:30
Philip Monk
e612e6d063
oops 2019-08-20 17:34:59 -07:00
Philip Monk
2c2ef195a7
add sponsorship chain keys to %dawn event 2019-08-20 16:41:50 -07:00
Isaac Visintainer
2212323b4d added launch, chat, publish, clock, and weather as default apps for comets 2019-08-13 11:43:18 -07:00
Jared Tobin
14b6816300
Merge pull request #1606 from urbit/modulo-lib-surs
Make modulo follow lib-sur conventions
2019-08-12 19:52:51 -07:00
Philip Monk
6349fc85ee
add +scry to lib/stdio 2019-08-12 13:50:14 -07:00
Fang
a59149bc23
Move :publish app state type into app itself 2019-08-11 12:21:39 -07:00
Fang
2726eff1d4
Move :chat types into /sur 2019-08-11 11:59:59 -07:00
Ted Blackman
370213bb65 add gall %wash to clear caches 2019-08-10 14:24:31 -07:00
Fang
cac4b2b70f
Move :launch types into /sur 2019-08-09 14:54:52 -07:00
Jared Tobin
fc559b7d33
Merge pull request #1399 from urbit/chat-message-types
Message type support in Chat
2019-08-09 06:48:21 -02:30
Fang
05950770f4
Merge branch 'master' into chat-message-types 2019-08-08 15:01:00 -07:00
Philip Monk
bd36e61b22
Merge remote-tracking branch 'origin/master' into philip/kale 2019-08-08 14:51:14 -07:00
Philip Monk
5800c66647
longer keys 2019-08-08 11:52:44 -07:00