Commit Graph

337 Commits

Author SHA1 Message Date
Ted Blackman
d81fc6e519
Merge pull request #6373 from urbit/m/dumb-apes
hoon: in +ape:ag, make zero a plain atom
2023-03-15 15:00:30 -04:00
John Hyde
aa6d6b1a42 hoon: fix style issues and update solid pill 2023-03-12 14:03:33 -07:00
John Hyde
50b6153119 hoon: make sane more memory-efficient 2023-03-09 03:07:29 -06:00
John Hyde
05726833ba hoon: make sane sane 2023-03-08 17:43:31 -06:00
fang
6f6fee2b89
hoon: in +ape, make zero a plain atom
In the `+ape` parser constructor, we were providing `0` as the parsing result
for the zero character. Hoon syntax dictates this is a `@ud` however,
resulting in a parsing output type of `?(@ud etc)`. Since `+ape` is commonly
used for parsing atoms of various kinds, one might end up with a result
of `?(@ud @)`, which would fail to nest directly under, say, `@uv`, requiring
parsers to add a casting step.

Here, we simply cast the zero result to `@` to make it perfectly generic. This
should alleviate the need for a casting step in parsers that need to fit their
output into a specific aura.

(The output type in the common case (ie, `+hex:ag`, `+viz:ag`) is now `?(@ @)`,
which is still somewhat strange, but should have better ergonomics.)

Since `@` can be used in any place `@ud` is accepted, this is a non-breaking
change.
2023-03-04 18:02:33 +01:00
Alex Shelkovnykov
5b9bed244f Minor improvement to +mod and +dvr 2023-02-23 20:37:53 +01:00
Philip Monk
d9e5ebe806
Merge pull request #6117 from urbit/lf/lure
hoon: add +lure, for turning a singleton into a list
2023-01-17 15:22:58 -07:00
Philip Monk
899712383a
Merge pull request #6160 from urbit/jon/remove-plat
hoon: remove $plat
2023-01-17 15:00:27 -07:00
Philip Monk
86cf63986b Merge remote-tracking branch 'origin/jon/bartar-crusade' into next/415 2023-01-13 17:58:12 -07:00
Philip Monk
0791c455a6 hoon: put doccords behind parser flag 2023-01-13 17:41:07 -07:00
Philip Monk
40451fa727 Revert "Revert "Merge pull request #6039 from tadad/da/apt-in""
This reverts commit e306d32c74.
2023-01-13 16:13:03 -07:00
Philip Monk
a7a3790346 kelvin: bump to 139 2023-01-13 16:12:35 -07:00
Philip Monk
0119eef28d Merge branch 'next/arvo' into jon/doccords 2023-01-12 13:14:06 -07:00
Philip Monk
e306d32c74 Revert "Merge pull request #6039 from tadad/da/apt-in"
This reverts commit 31bb93846c, reversing
changes made to 7940dd442b.

Reverting because we can't upgrade jetted code without ensuring the jets
change in lockstep.
2023-01-11 15:12:11 -07:00
Philip Monk
7bbcceebaf hoon: typo 2023-01-11 14:47:13 -07:00
Philip Monk
f36591493c kelvin: landscape is only compatible with 416 2023-01-11 14:44:55 -07:00
drbeefsupreme
5b99f74c94 hoon: remove deprecated lustar parser
See #6052. This is completely different from the +* used at the top
of doors, and has almost entirely been replaced by |$. The exception is
the use of the `%made` spec, not present in `|$`. I do not see an
obvious way to change `|$` to use `%made` since this `+*` parser uses
the name of the arm in the `%made` structure, unless we change the
AST of |$.
2023-01-04 18:33:47 -05:00
drbeefsupreme
d5bf903f56 Merge branch 'next/arvo' into jon/doccords 2023-01-04 10:22:17 -05:00
drbeefsupreme
d7edbd63da hoon: doccordsify hoon.hoon comments
making hoon.hoon more legible to doccords. also moving some things
around that seemed to be in the wrong place
2022-12-16 15:47:09 -05:00
drbeefsupreme
3da062594e hoon: sweeten =+ foo |@ ++ $ bar -- patterns
|*  foo  bar is sugar for =+  foo  |@  ++  $  bar  --, and newbies find
the old style confusing. this switches out the |@ pattern for the |*
one, at least in layer <=4. the only ones remaining are +toad, +rune,
and +runo, which are already tweaked in #5873 so we omit them here.
2022-12-16 12:46:13 -05:00
drbeefsupreme
e04262ed2d hoon: swap ?. for ?: on +loaf and +loan
no idea how this ended up happening, but apparently it was my fault.
2022-12-15 14:24:38 -05:00
drbeefsupreme
517945c582 hoon: remove $plat
$plat was a type of $plot added in
bc6ad0456d

plots are no longer a thing, so
neither should be plats.
2022-12-14 20:43:39 -05:00
drbeefsupreme
44aa90c9ad hoon: remove +hint:ax
all this did was set .nut. while it could be used with doccords, it is
currently unused, and none of the other values in the sample of _ax are
set this way (bug, def, cox, hay, dom). i experimented a little bit with
trying to make use of this but it made things overall more unreadable,
and it wouldn't make sense to do it without doing the same for other
values of the sample. im guessing this is just an old style.
2022-12-14 20:27:08 -05:00
drbeefsupreme
68c2ab5e25 hoon: fix .nut comment
notes aren't just for doccords, of course
2022-12-14 16:25:04 -05:00
drbeefsupreme
25dba7e672 hoon: remove extra hoon casts in +decorate
everything appears to work fine without them and I don't think it is any
less unclear what this gate is doing.
2022-12-14 16:02:41 -05:00
drbeefsupreme
d508c8c507 hoon: add comment about .nut in +ax 2022-12-07 16:17:57 -05:00
drbeefsupreme
627827f029 hoon: revise leap:docs and apse:docs
when +apse sees a link, it presume that the following a batch comment,
and stops parsing so that it can be picked up by apex:docs next

this required a change to +leap, which has been rewritten to pretty much
look like +gap but stop parsing when encountering doccords.
2022-12-06 14:30:31 -05:00
drbeefsupreme
b76134fb1d hoon: attach all untagged arm docs
previously we just threw them out and wasn't sure whether it was the
right answer. this violates the principle of least surprise - even
though it hard to see the value of attaching multiple empty $cuff notes
to an arm, we shouldn't stop the programmer from doing it without any
indication or explanation as to why. its the behaviour you'd expect
given how doccords is structured.
2022-12-06 13:16:45 -05:00
drbeefsupreme
75cf230d54 hoon: revise doccord intermediate parse structures
it is desirable for both apex:docs and apse:docs to parse into an
intermediate representation that never ends up in an AST so that it is
clear that these parsed representations may be altered in the future
without worrying about old types nesting with new types. this was
already the case for $whit, but apse:docs parsed directly as a $help,
which is used in ASTs. so apse:docs now parses as a $whiz, which is
simply a cord. in the future, if postfix comments are used for something
like invariants, or allow $links, we may want to change this.

this also changes $whit to remove .use, which was unused. similarly,
+glom is removed since its not used anywhere.
2022-12-06 12:12:45 -05:00
drbeefsupreme
3b6f0f5808 hoon: remove comment on batch arm docs above chap
this might actually be undesirable, don't want to leave this as a trap
for somebody in the future thinking we knew it was definitely the right
answer. having batch comments follow the chapter declaration does make a
certain amount of sense, stylistically
2022-12-05 18:13:42 -05:00
drbeefsupreme
ce209fc2c7 hoon: %gist spec doccords are tagged
future-proofing %gist specs by putting a %help tag on the $help. this
looks pointless at first glance, but it allows the opportunity for %gist
specs to have a $% in the future in a way such that the old type nests
with the new one, eliding the need for a typo->type migration
2022-12-05 18:03:22 -05:00
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