Re: An example of substituability test that is recursive

2019-01-31 Thread John Rose
(FYI, offline comment with my reply.) Begin forwarded message: From: John Rose Subject: Re: An example of substituability test that is recursive Date: January 31, 2019 at 11:48:53 AM PST To: Palo Marton Cc: Rémi Forax , Brian Goetz On Jan 31, 2019, at 11:28 AM, Palo Marton mailto:palo.mar

Re: An example of substituability test that is recursive

2019-01-31 Thread Karen Kinnear
lt;mailto:fo...@univ-mlv.fr>wrote: > > > > De: "John Rose" mailto:john.r.r...@oracle.com>> > À: "Remi Forax" mailto:fo...@univ-mlv.fr>> > Cc: "Karen Kinnear" <mailto:karen.kinn...@oracle.com>>, "valhalla-spec-experts" &

Re: An example of substituability test that is recursive

2019-01-31 Thread forax
> De: "Karen Kinnear" > À: "Remi Forax" > Cc: "John Rose" , "valhalla-spec-experts" > > Envoyé: Jeudi 31 Janvier 2019 21:36:09 > Objet: Re: An example of substituability test that is recursive > Option #1 was what I was suggesting

Re: An example of substituability test that is recursive

2019-01-31 Thread Karen Kinnear
.fr wrote: > > > > De: "John Rose" > À: "Remi Forax" > Cc: "Karen Kinnear" , "valhalla-spec-experts" > > Envoyé: Jeudi 31 Janvier 2019 19:05:33 > Objet: Re: An example of substituability test that is recursive > On Jan 31

Re: An example of substituability test that is recursive

2019-01-31 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Karen Kinnear" , "valhalla-spec-experts" > > Envoyé: Jeudi 31 Janvier 2019 20:43:33 > Objet: Re: An example of substituability test that is recursive > On Jan 31, 2019, at 10:41 AM, [ mailt

Re: An example of substituability test that is recursive

2019-01-31 Thread John Rose
On Jan 31, 2019, at 10:52 AM, Brian Goetz wrote: > > Let’s not do this to Java, shall we? > > https://twitter.com/seldo/status/1090931182227861508 > > >> solution 2: you claim it's too complex and you just let the user deal with >> it

Re: An example of substituability test that is recursive

2019-01-31 Thread John Rose
On Jan 31, 2019, at 10:41 AM, fo...@univ-mlv.fr wrote: > > yes, i creates a DAG that will be too long to traverse :( > you basically, DDOS yourself if you do a ==. The complexity is exponential in depth, and can be more than linear in heap allocation, because of the risk of repeat traversals. A

Re: An example of substituability test that is recursive

2019-01-31 Thread Brian Goetz
Let’s not do this to Java, shall we? https://twitter.com/seldo/status/1090931182227861508 > solution 2: you claim it's too complex and you just let the user deal with it > by calling equals() (and provide a way for a user to call the default subs).

Re: An example of substituability test that is recursive

2019-01-31 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Karen Kinnear" , "valhalla-spec-experts" > > Envoyé: Jeudi 31 Janvier 2019 19:05:33 > Objet: Re: An example of substituability test that is recursive > On Jan 31, 2019, at 6:34 AM, [ ma

Re: An example of substituability test that is recursive

2019-01-31 Thread forax
> De: "John Rose" > À: "Remi Forax" > Cc: "Karen Kinnear" , "valhalla-spec-experts" > > Envoyé: Jeudi 31 Janvier 2019 19:03:13 > Objet: Re: An example of substituability test that is recursive > On Jan 31, 2019, at 3:19 AM,

Re: An example of substituability test that is recursive

2019-01-31 Thread John Rose
On Jan 31, 2019, at 6:34 AM, fo...@univ-mlv.fr wrote: > > The other solution is to say that == should do an upcall to equals (after the > null checking and the class checking), if equals throw a StackOverflow, it's > the expected behavior because the user is in control of that behavior. What yo

Re: An example of substituability test that is recursive

2019-01-31 Thread John Rose
On Jan 31, 2019, at 3:19 AM, Remi Forax wrote: > > here is an example that recurse to its death with the current prototype Fun fact: Change the Link to a Tree and you go from linear to exponential in the depth. *Just* a fun fact; it doesn't change Remi's point, which is that we can construct v

Re: An example of substituability test that is recursive

2019-01-31 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" > Cc: "Karen Kinnear" , "valhalla-spec-experts" > > Envoyé: Jeudi 31 Janvier 2019 17:56:47 > Objet: Re: An example of substituability test that is recursive > Curren

Re: An example of substituability test that is recursive

2019-01-31 Thread Remi Forax
nvier 2019 12:19:32 > Objet: An example of substituability test that is recursive > Hi Karen, > here is an example that recurse to its death with the current prototype > > import java.lang.invoke.ValueBootstrapMethods; > import java.util.stream.IntStream; > > public class

Re: An example of substituability test that is recursive

2019-01-31 Thread Brian Goetz
; De: "Remi Forax" >> À: "Karen Kinnear" >> Cc: "valhalla-spec-experts" >> Envoyé: Jeudi 31 Janvier 2019 12:19:32 >> Objet: An example of substituability test that is recursive > >> Hi Karen, >> here is an example

Re: An example of substituability test that is recursive

2019-01-31 Thread forax
- Mail original - > De: "Karen Kinnear" > À: "Remi Forax" > Cc: "valhalla-spec-experts" > Envoyé: Jeudi 31 Janvier 2019 14:57:32 > Objet: Re: An example of substituability test that is recursive > Remi, > > Thank you. So there we

Re: An example of substituability test that is recursive

2019-01-31 Thread Karen Kinnear
Remi, Thank you. So there were two kinds of “recurse to its death” we talked about 1) expected behavior 2) surprise This strikes me as the expected behavior - where we can set expectations. If we were to always return false - how would you make this kind of example work? thanks, Karen > On Ja

An example of substituability test that is recursive

2019-01-31 Thread Remi Forax
Hi Karen, here is an example that recurse to its death with the current prototype import java.lang.invoke.ValueBootstrapMethods; import java.util.stream.IntStream; public class Substituable { static value class Link { private final int value; private final Object next; public L