Skip to content

Conversation

b-studios
Copy link
Collaborator

This is a quick experiment related to #878 to see how bad things go if we completely disable box inference and only keep unbox inference.

@b-studios
Copy link
Collaborator Author

For funsies, I also completely removed unbox (and fun) as keywords from the language. This implies, we would need to update the tutorials on the website etc.

var x in outer = 42; x
};
val g = test2;
val g = box test2;
Copy link
Contributor

@jiribenes jiribenes Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RE #878: This is exactly a place where I'd be fine with inferring box :)
(the RHS of a val)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I know. I wanted to see how bad it is if we don't infer boxes at all. This might drive home the point that there is a difference even more (even though it is annoying). I am actually more annoyed by foo(box compareInt).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I always explicitly write the box in map::fromList(..., box compareInt)

@jiribenes
Copy link
Contributor

jiribenes commented Jul 22, 2025

My hope was that this could make Namer a bit easier in some cases, but I don't see Namer changes, so I'm not sure whether that's true 🤔
(Stuff like #807 should then allow for a better error message)

@b-studios
Copy link
Collaborator Author

Maybe, I didn't think about it, but just followed the type errors :)

@b-studios b-studios marked this pull request as ready for review July 28, 2025 15:06
@b-studios
Copy link
Collaborator Author

We need to change the docs on the website when merging.

@b-studios
Copy link
Collaborator Author

b-studios commented Jul 31, 2025

We still need to update the website, for example here

https://effekt-lang.org/tour/captures

saying

-A boxed computation may only be used after unboxing it, which is only permitted when all its captures are in scope. 
+A boxed computation may only be used after unboxing it (which happens automatically), which is only permitted when all its captures are in scope. 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants