Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

++dole fails to it() and nlr() doubly-recusive types #115

Closed
ohAitch opened this issue Apr 18, 2016 · 8 comments
Closed

++dole fails to it() and nlr() doubly-recusive types #115

ohAitch opened this issue Apr 18, 2016 · 8 comments
Labels
enhancement tweaking or improving existing functionality %hoon reproduction known well-specified repro case type system

Comments

@ohAitch
Copy link
Contributor

ohAitch commented Apr 18, 2016

Command

> ? *|-((list (each @ {$})))

Expected

  it(?({$.y p/@} {$.n p/^#1.?(it({$.y p/@} {$.n p/#1}))}))
~

Observed

  it(?({$.y p/@} {$.n p/^#1.?({i/?({$.y p/@} {$.n p/#1}) t/#1} $~)}))
~

This manifests itself as pretty printer errors:

> `|-((list (each @ {$})))`~[&+1 |+~[&+2 &+3]]
~[[%.y p=1] [%.n p=[i=[%.y p=2] t=[i=[%.y p=3] t=~]]]]

And is more directly caused by dole cycle elision not back-propagating %list detection.

> ~(dole us p:!>(*|-($@($~ {i/$| t/$}))))
[ p={[p=1 q=[%pick p=~[[%plot p=~[[%face p=%i q=[%pear p=%f q=1]] [%face p=%t q=[%stop p=1]]]] [%pear p=%n q=0]]]]}
  q=[%list p=%it q=[%pear p=%f q=1]]
]
> ~(dole us p:!>(*|-($@($~ {i/$ t/$}))))
[ p={[p=1 q=[%pick p=~[[%plot p=~[[%face p=%i q=[%stop p=1]] [%face p=%t q=[%stop p=1]]]] [%pear p=%n q=0]]]]}
  q=[%list p=%it q=[%stop p=1]]
]
> `|-($@($~ {i/$ t/$}))`~[~[~ ~] ~]
~[[i=~ t=[i=~ t=~]] ~]
@Fang- Fang- added %hoon and removed %hoon labels Jan 26, 2018
@belisarius222 belisarius222 added enhancement tweaking or improving existing functionality %hoon and removed %hoon labels Jan 26, 2018
@Fang- Fang- added the reproduction known well-specified repro case label Jan 26, 2018
@jtobin
Copy link
Contributor

jtobin commented Jun 21, 2019

Closing as the given example no longer parses as of v0.8.0.rc.1.

@jtobin jtobin closed this as completed Jun 21, 2019
@ohAitch
Copy link
Contributor Author

ohAitch commented Jun 21, 2019

Does something similar like ? =/(a |-((list (each @ {$}))) *a) parse? Request to translate clear minimal reproductions to modern syntax before declaring compiler bugs probably fixed

@joemfb
Copy link
Member

joemfb commented Jun 21, 2019

I expect this to still be present, as old (current) pretty-printer has not seen any significant work. There is a new pretty-printer, but that's only partially integrated.

@jtobin
Copy link
Contributor

jtobin commented Jun 23, 2019

Does something similar like ? =/(a |-((list (each @ {$}))) *a) parse?

It parses, and then actually causes a bail: meme and locks up my ship on vere v0.8.0.rc.2. 😄

Something is obviously still a problem here, but I think the issue needs updating to report whatever that is more clearly.

@ohAitch
Copy link
Contributor Author

ohAitch commented Jun 23, 2019

Hm that sounds like a separate issue with {$} being bunted eagerly? Like, I would expect swapping *a with =>(*a ~) to still have the bail:meme, while the original issue concerns the pretty-printer.

@cgyarvin
Copy link
Contributor

cgyarvin commented Jun 24, 2019 via email

@ohAitch
Copy link
Contributor Author

ohAitch commented Jun 24, 2019

Yeah I'm guessing that's from the "molds are recursively defined as gates whose samples are the outputs of running them" change? Like obviously this code worked in 2016, and the type it refers to is perfectly clear - it presumably still works if you phrase it as

|%  +=  $  $@(~ [i=$%([%& p=@] [%| p=$]) t=$)  --

but the capacity for any kind of abstraction around that has been removed from the language

@ohAitch
Copy link
Contributor Author

ohAitch commented Jun 24, 2019

Or hm *|-({(list (each @ $))}) might work actually

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement tweaking or improving existing functionality %hoon reproduction known well-specified repro case type system
Projects
None yet
Development

No branches or pull requests

6 participants