Commit Graph

364 Commits

Author SHA1 Message Date
drbeefsupreme
4afdfdb689 hoon: remove unused $links
done for future-proofing purposes - don't want to presume how they will
get used in the future
2022-12-05 18:00:06 -05:00
drbeefsupreme
0ed484a6ef hoon: +seam and +scye doccords edit 2022-12-05 17:36:38 -05:00
drbeefsupreme
3c323783ca hoon: make some comments into doccords 2022-12-05 17:14:51 -05:00
drbeefsupreme
baa48948cf hoon: rune parser whitespace changes for docs
makes =; etc not eat doccords
2022-12-05 17:13:38 -05:00
drbeefsupreme
ca3140a8b3 hoon: doccord parsing fixes
addressing @Fang- comments on the parser
2022-12-05 17:13:03 -05:00
Liam Fitzgerald
02944af669 hoon: add +lure, for turning a singleton into a list 2022-12-01 15:47:04 +10:00
drbeefsupreme
f519b4caeb hoon: fix sig rune whitespace to allow doccords
without this, e.g.

~&  %foo
::    dox
1

wouldn't attach dox to 1 as a doccord
2022-11-30 13:39:50 -05:00
drbeefsupreme
df45bfbf84 hoon: ~master-morzod comments on doccords
TODO items from a pairing session
2022-11-23 17:46:53 -05:00
drbeefsupreme
387ae3e780 hoon: remove +vil
leftover from doccords :: syntax change no longer needed
2022-11-23 14:02:13 -05:00
Philip Monk
15c5447a05 Merge branch 'philip/agent-clay' into next/arvo 2022-11-22 17:24:15 -07:00
drbeefsupreme
244d0d2b24 hoon: change apse:docs to parse as a $note
this is to handle potential future cases where doccords might be kinds
of notes other than %help notes. example: #6085 to document invariants
in clay.

$whit (used for apex:docs/batch comments) also ought to be changed but
im still thinking about what that should look like.
2022-11-18 13:53:10 -05:00
drbeefsupreme
06a7daa16f hoon: change %dict spec to %gist
no semantic changes. %dict was a temporary name
2022-11-16 10:58:10 -05:00
drbeefsupreme
618fc0fe5a Merge branch 'next/arvo' into jon/doccords 2022-11-15 18:34:10 -05:00
drbeefsupreme
f4a84caf30 hoon, dprint: remove |% and |@ core names
partial revert of 3d3ea61d53, which introduced core names by completing
an unimplemented feature that was already present in hoon.hoon. we've
decided to remove this for the initial launch since it violates the
principle of least surprise for the name of a core to end up in its
$garb and yet only be used for doccords, as opposed to something like a
wing resolution. it was also confusing that this only worked for |% and
|@.

this breaks two of the tests for the dprint library, which have been
commented out. these tests ought to be restored once dprint is rewritten
in order to implement a different way to refer to cores not built by arms
2022-11-15 18:25:57 -05:00
drbeefsupreme
5fc3b3fd0f hoon, dprint: change doccords syntax to ::
this constitutes a pretty major rework of how whitespace is handled in
hoon in order to change the doccords syntax from :> and :< to ::.

in summary: throughout the hoon parser (+vast) many instances of +gap
have been replaced by +jump, which first tries to remove whitespace (+leap)
until it arrives at something that can be parsed as a prefix
doccord (+apex:docs:vast). if it does not encounter a doccord, it
instead uses +gap as normal.

if you follow along with the parser, you will notice that every time
jump is called, it then tries to call +apex:docs via +scye or +seam. if
apex:docs succeeds, it will end up consuming a newline at the end,
hiding the fact that there was valid whitespace from the parser. thus
+apex:docs then inserts a newline after successfully parsing a prefix
doccord, which will then be consumed by a subsequent invocation of +gap,
ensuring that there was proper whitespace if the doccord would have been
consumed by +gap instead of +leap.

there are a few other changes:

+hint in the compiler throws out doccords attached to %noun types. this
was already the behavior before doccords, and the change was made before
i understood what i was doing.

similarly for commenting out the %note case in +open:ap - this was an
earlier mistake

postfix comments for chapters are now enabled.

+expx was unused and removed in order to be rid of the
convention-defying +exp1. other unused +ex(p/q)* were commented out.

arms that handle batch comments (+glow and +whap) were refactored

+toad, which was used to change between tall and wide form, tries to
+jump before +gap. since +jump is ;~(pose leap:docs gap), i would have
thought that just using +jump there would be fine, but it fails for some
reason.

some parsers built with |@ were rewritten to use |*

|$ was made so that any doccords put on the spec are converted into hoon
doccords on the $ arm. it wouldn't compile otherwise. there's probably a
more principled way to do this but it works fine for now.
2022-11-15 18:25:29 -05:00
dachus
b0dedeecfe fix 2022-10-26 11:26:23 -06:00
Joe Bryan
e4e0c31975 hoon: updates +slew to avoid dynamic eval 2022-09-06 12:50:44 -04:00
Joe Bryan
d89c73fc79 hoon: update key virtualization gates to use fully-static formulas 2022-09-06 11:05:08 -04:00
drbeefsupreme
49420e2fe2 hoon: refactor %brcn %brpt optional arg parsing
this refactors the parser for %brcn and %brpt to separate the optional
argument(s) from the required argument(s).

also adds +blab, which allows for a minor refactor of a couple other
arms as well as being used for %brcn and %brpt
2022-07-17 17:18:38 -04:00
fang
83d7b53b58
hoon: add converters between un/typed paths 2022-07-08 14:01:17 +02:00
fang
c977486f71
hoon: support ? and ~ in typed paths properly 2022-07-07 16:06:50 +02:00
fang
77091d53d4
hoon: include all signed bases
%s is not an aura we ever parse into. It's always one of the bases, ie,
%sd in place of %ud.
2022-07-07 15:29:50 +02:00
drbeefsupreme
1cd95a9ceb hoon: add +$ cuff (list link)
makes doccords stuff more readable. also changes the (list link) in
$help to cuff
2022-07-06 16:30:24 -04:00
drbeefsupreme
de19456f82 hoon: revamp doccords parsing for batch comments
this commit replaces the previous intermediate parsing structure, $whit,
with a new one better suited for batch comments and taking into account
that {#  %label} syntax is no longer being used anywhere. basically,
this makes it so that all doccords are batch comments, where if they are
preceded by a (list link) then they will try to attach to the given
link (only utilizes first link for now), and a blank link means it will
try to attach to the following hoon or spec
2022-07-06 16:17:54 -04:00
fang
9b2e18406c
hoon: allow faceless atoms in typed path patterns
As in, #/face=@p/@ud
2022-07-06 18:20:20 +02:00
fang
01a6b8a16a
hoon: improve $pith pattern mode syntax
Produce the correct type, support the ~ element, allow specifying an
open-ended type.
2022-07-06 16:33:28 +02:00
fang
5af620176e
hoon: make $iota's %tas a pure atom
Since %tas is the common case, this will result in smaller/shorter
representations for most piths.

Additionally, we switch from ,/pith to #/pith syntax, to more clearly
mark it as temporary.
2022-07-06 16:31:51 +02:00
drbeefsupreme
b80590fd05 hoon: remove _docs-engine
thought this would play a larger role than it did. currently it is unused
2022-07-01 17:47:18 -04:00
drbeefsupreme
3bfad4807a hoon: fix batch comment parser
the merge broke it i guess
2022-07-01 12:14:47 -04:00
fang
f604bb576c
hoon: preliminary support for pith pattern syntax
Along the lines of ?=(#/const/who=@p/* your-pith)

Implementation still needs further tuning, restricting, etc.
2022-07-01 15:24:48 +02:00
drbeefsupreme
77b5c736aa hoon: fix batch comment parsing for ++ $ arms
comments for ++  $  arms are set using four aces
2022-06-28 13:29:42 -04:00
drbeefsupreme
efe01b815a hoon: batch comment doccords inside of cores
changes $whit to have a (unit link) instead of (unit term). this holds
the identifier for where a comment is supposed to go. changes to parsers
in docs:vast to accomodate this.

this only allows for batch comments written for arms within a given
core. someday, the feature should allow you to write comments
virtually anywhere. the (unit link) in $whit should become a (unit (list
link)) to accommodate this
2022-06-28 12:12:03 -04:00
drbeefsupreme
941ff18d9b hoon: refactor doccord parsing for +tall and +till 2022-06-24 12:30:52 -04:00
drbeefsupreme
552b8e9e94 hoon: spec doccord parsing, refactor +till +tall 2022-06-22 15:46:11 -04:00
drbeefsupreme
d0b8d284ce hoon: add %dict tag to %spec for doccords 2022-06-22 15:45:40 -04:00
drbeefsupreme
a59bd02054 hoon: doccords, product-docs arent made in +boog
this is almost a revert of the commit that added in the %funk tag, but
not quite, so its a new commit. i apparently forgot that product docs
are actually built by +wrap, not +boog, so it was treating postfix
arm-docs as if they were product docs
2022-06-09 13:30:18 -04:00
drbeefsupreme
3d3ea61d53 hoon: %brcn and %brpt names for doccords
changes the syntax for naming |% and |@ cores from
:>  #  %core-name
to
|%  %core-name
2022-06-07 12:36:23 -04:00
drbeefsupreme
39ac7cb820 Merge branch 'master' into jon/doccords 2022-06-07 11:10:20 -04:00
fang
db899ce09f
hoon: add ,/typed/path syntax
Prefixing a path with a com will cause the path to be interpreted as a `$pith`,
aka a typed path. Instead of interpreting every element as a string, we use
hoon's atom syntaxes to read the values, and tag them with appropriate auras.

For example, `,/hi/5/0x6` becomes `[[%tas %hi] [%ud 5] [%ux 0x6] ~]`.

Dynamic elements via `()` and `[]` is also supported, and may optionally be
tagged with `aura+(etc)` syntax. For example, `,/next/ud+[+(1)]`.

Could _maybe_ be refactored to use `+nuck`, but we'd need to wrestle the output,
and we're a little stricter here anyway.

This shadows existing `,/some-wing` syntax, which... presumably does something,
but is not in active use anywhere. We might consider removing that syntax.

Eventually, we probably want this to be the primary urbit-native path type.
Invalidating existing path syntax is very invasive though, so for now we
piggy-back on "com changes the parsing mode" for a less disruptive addition.
2022-06-03 14:10:31 +02:00
Philip Monk
00d180c008 Merge branch 'pr' into philip/tomb 2022-05-14 20:59:33 -07:00
Philip Monk
915dc733f5 Merge remote-tracking branch 'origin/m/buclus' into philip/tomb 2022-05-14 20:39:51 -07:00
Philip Monk
27a4a9584f hoon: in molds, unify result with input 2022-05-10 01:01:25 -07:00
fang
13d1c28927
hoon: make manual shorthand type printing prettier 2022-04-06 23:24:43 +02:00
drbeefsupreme
2a57e85a09
hoon: comment out %note entry in +open
this was wiping out some comments buried that weren't written at the top
of an arm. not sure if this is used in another fashion that will create
issues, so I just commented it out to help remember that it used to be
there in case it needs further changes, like if I should actually skip
%know and %made notes but not %help notes
2022-04-06 16:27:07 -04:00
drbeefsupreme
6f32d107fc
hoon: doccords wrap tisfas fix
I didn't know what I was doing before, I think this is the right way to
wrap tisfas with a %note hoon.
2022-04-05 14:45:51 -04:00
drbeefsupreme
063e3ed716
hoon: doccords dist. between arm-doc and prod-doc
docs written above an arm are now distinguishable in the AST from
docs written above the product of the arm, by tagging docs written
above the arm with a %funk link
2022-04-05 12:35:53 -04:00
Joe Bryan
f7f4b3e748
hoon: preserve structural sharing by testing subject/product equality in +burp 2022-04-04 14:12:25 -04:00
Joe Bryan
0c255c1294
hoon: plug type leak in vase literals by properly burping %hint 2022-04-04 14:12:24 -04:00
drbeefsupreme
f9dfb590d6
hoon: turn on hints for %noun types 2022-03-31 17:41:48 -04:00
Joe Bryan
9a1b3eaf15
Merge pull request #5664 from urbit/jb/type-leak
hoon: plug type leak in compiler bootstrap
2022-03-28 09:08:59 -04:00
Philip Monk
4278d4c8b3
Merge pull request #5673 from urbit/philip/fix-uno
hoon: fix +uno:by when map is null
2022-03-25 18:23:32 -07:00
Philip Monk
50fb239d2f hoon: fix +uno:by when map is null
This crashed at runtime when `a` is null because it tried to instantiate
`meg`, and that means bunting its argument, and that calls `node`, where
the assert failed.

Wet gates use the bunt of their formal argument, so we use that.
2022-03-25 18:08:13 -07:00
Joe Bryan
d937e131a4 hoon: preserve structural sharing by testing subject/product equality in +burp 2022-03-25 10:28:05 -04:00
Joe Bryan
15e570a622 hoon: plug type leak in vase literals by properly burping %hint 2022-03-25 10:27:32 -04:00
Jōshin
4be43d5e28
hoon: fix comment whitespace 2022-03-21 10:24:27 -06:00
drbeefsupreme
e50635babd
hoon: doccords wrap %rock %sand %wing %knit %bust
wraps them in %note hoons
2022-03-18 18:22:26 -04:00
drbeefsupreme
37580fa722
hoon: doccords for tisfas
wraps the skin in tisface with a %help skin
2022-03-18 17:03:02 -04:00
drbeefsupreme
2fa0bd3644
squash! hoon: doccords wrap bar runes with %notes 2022-03-16 13:43:55 -04:00
drbeefsupreme
c01732de16
hoon: doccords wrap bar runes with %notes
this changes the parser to take any bar runes surrounded by formal
comments and wraps them with %note tags containing those comments
2022-03-16 13:05:58 -04:00
drbeefsupreme
ff81189823
hoon: doccords %brdt cleanup revert 2022-03-16 12:13:39 -04:00
drbeefsupreme
1c72ff6103
Revert "hoon: change %brdt AST to support doccords label"
This reverts commit 0dc3498a6f.
2022-03-16 12:12:39 -04:00
drbeefsupreme
643700546f
hoon: populate %brpt doccords label 2022-03-14 17:09:41 -04:00
drbeefsupreme
0dc3498a6f
hoon: change %brdt AST to support doccords label 2022-03-14 17:08:49 -04:00
drbeefsupreme
f08b613416
hoon: populate label for %brcn doccords
This changes the parser for +tall so that it looks before and after a
hoon for doccords, and then extracts a label for %brcn if it exists.
+wrap will be used to annotating most hoons, but this commit only covers
%brcn
2022-03-14 17:00:04 -04:00
fang
41a796d2d1
hoon: hook up $+ for shorthand type rendering
Too often when dealing with big types the compiler traces and other such
outputs become hard to read. Wrapping a type as $+(shorthand big-type)
will now print #shorthand in place of the type.
2022-03-14 13:58:48 -04:00
drbeefsupreme
0a3ec9a92d
hoon: doccords cleanup %note tag for +boog 2022-03-14 11:49:31 -04:00
drbeefsupreme
336817d5bc
hoon: doccords for core chapters
this populates the $what in $tome
2022-03-14 11:49:30 -04:00
drbeefsupreme
cdaf23a184
hoon: prefix and postfix doccords for ++ and +$
there's a stub for +* but its not working yet
2022-03-14 11:49:29 -04:00
fang
3df227760f
hoon: hook up $+ for shorthand type rendering
Too often when dealing with big types the compiler traces and other such
outputs become hard to read. Wrapping a type as $+(shorthand big-type)
will now print #shorthand in place of the type.
2022-03-10 01:45:18 +01:00
Joe Bryan
ff3bb495d8 hoon: updates %mcgl with an hygienic expansion 2022-02-22 20:39:30 -05:00
~nallux-dozryl
dd53baa059
Fix comment indent for abs:si 2022-01-24 15:24:01 +08:00
fang
bbd044185c
Merge pull request #5227 from urbit/m/righteous-paths
hoon: correctly parse empty path
2021-10-14 23:12:29 +02:00
fang
d0f8eda937
hoon: correctly parse empty path
And reject paths ending in empty segments.

The following cases were being parsed incorrectly:
- `/` represents the empty path, `~`. This was being parsed into `[~. ~]`
- `/x/` is not valid. This was being parsed into `[~.x ~. ~]`

This happens because `urs:ab` has no problem parsing the empty string.
For some supported cases, like `//x` (`[~. ~.x ~]`), this is actually desired
behavior, but it results in trailing empty segments for paths ending in `/`.

Here we apply a `+sear` on top of the existing parser, that transform the `/`
case to produce `~`, and ensures the absence of a trailing empty segment in
all other cases.

Note that we change `(more fas urs:ab)` to `(most fas urs:ab)`. Since `urs:ab`
parses the empty string, this doesn't actually make a difference, but it does
make it more obvious that the `+rear` call will never crash.

Alternative approaches I attempted all resulted in much more complicated
parser, so the dumb `+sear` seems preferable.
We do eat the performance cost of an additional list traversal (in `+rear`)
with this change, but that is probably not the end of the world.

Fixes #1501.
2021-09-16 12:39:50 +02:00
Philip Monk
98d8419c9e
hoon: don't compile .= children twice 2021-08-04 17:02:48 -04:00
Philip Monk
4e16b9c555
hoon: remove +ad
This reverts d96d50199 because +ad is incredibly opaque, and +ergo's
sitting right there anyway.  It looks like it was intended to abstract
over +endo, +elbo, and +ergo, but only +ergo was every implemented.  I
don't doubt the others could be as well, but then they would be just as
inscrutable.
2021-08-04 16:57:03 -04:00
Philip Monk
b0c9fd1940
Merge remote-tracking branch 'origin/lf/hoon-inc' into release/next-sys 2021-06-08 08:59:27 -10:00
Logan Allen
b6206728cc hoon: make +sink more concise 2021-06-04 16:06:40 -05:00
Logan Allen
7ef313c5e1 hoon: add +sink, a slow (but faster than dunk) type printing 2021-06-04 14:40:28 -05:00
Philip Monk
57bea9407e
Merge pull request #4623 from urbit/jb/seminoun-bunt
hoon: update seminoun bunt to be fully blocked
2021-05-18 10:23:30 -07:00
Philip Monk
a57b6f9c9e
Merge branch 'pr' into release/next-sys 2021-05-13 07:04:07 -10:00
Liam Fitzgerald
9b2061a824
hoon: add +succ gate
Adds an +succ (successor) gate. Whilst .+ exists, it is impossible to use
in a point free style and doesn't compose functionally.
2021-04-27 10:24:21 +10:00
Philip Monk
66b4c3f193
Merge pull request #4677 from urbit/philip/fast-refresh
sys: Speed up things used in Landscape
2021-04-19 15:43:16 -07:00
fang
1ec5e5acfb
hoon: add +stap, path parser
And cleans up a bunch of locally hand-written implementations of it.
2021-04-07 21:14:13 +02:00
Philip Monk
7b55097ef4
hoon: memoize rend:co
We commonly print many names in a row, often the same ones.  For
example, on landscape's initial load, we send all the members of all the
groups we're in, and there's substantial overlap.

At least half the cost is in +fein, which is not currently jetted, but I
believe there's an old jet in the git history.
2021-03-28 00:21:30 -07:00
Joe Bryan
549c5e5db9 hoon: update seminoun bunt to be fully blocked 2021-03-17 14:21:58 -07:00
Philip Monk
a5993cc3e7
Merge remote-tracking branch 'origin/release/next-hoon' into release/next-sys 2020-12-18 12:43:07 -08:00
Joe Bryan
6678e7313b hoon: crash with valid tank on %eror 2020-12-15 18:22:51 -08:00
fang
0ef30e0360
hoon: add jet hint for +redo 2020-12-11 21:58:19 +01:00
Joe Bryan
4f79777e0b hoon: reverts to 3e577d4ae7 2020-12-08 16:26:11 -08:00
Joe Bryan
563c2d4c06 hoon: restrict trap subject in +swat 2020-12-07 23:51:10 -08:00
Joe Bryan
c807769b9e hoon: removes +ride printfs 2020-12-07 23:27:31 -08:00
Joe Bryan
fb403bf080 hoon: removes obsolete compiler hooks 2020-12-07 23:27:25 -08:00
Joe Bryan
3e577d4ae7 arvo: kelvins 2020-12-07 22:56:01 -08:00
Joe Bryan
115d4f9ac8 arvo: removes $monk 2020-12-07 00:42:09 -08:00
Joe Bryan
a08e196a95 hoon: avoid "fund: in/by" jet printfs by tweaking +map/+set/+qeu 2020-12-06 17:14:04 -08:00
Joe Bryan
ff06ccd2b9 arvo: completes scry reform 2020-12-06 03:33:43 -08:00
Joe Bryan
a5861a1349 hoon: moves |wa and $worm to arvo 2020-12-05 02:32:54 -08:00
Joe Bryan
d8a6c5e387 hoon: use +mole to virtualize +cue in |so 2020-12-05 00:51:49 -08:00
Joe Bryan
3a42c36298 hoon: adds +swat: deferred +slap 2020-12-04 22:46:02 -08:00
Joe Bryan
1e3378a7f5 hoon: fixes logic bug in date printer (truncation) 2020-12-04 21:38:39 -08:00