chalk icon indicating copy to clipboard operation
chalk copied to clipboard

Add ProjectionTerm

Open JulianKnodt opened this issue 2 years ago • 9 comments

This starts adding terms into chalk so that associated consts can be equated.

JulianKnodt avatar Feb 08 '22 19:02 JulianKnodt

howdy @JulianKnodt, what's the status of this?

compiler-errors avatar Mar 06 '22 22:03 compiler-errors

@compiler-errors Started on it, been caught up with some other deadlines so have not had a chance to progress, will get to it eventualllyyyy but I'm unsure when I'll be able to.

JulianKnodt avatar Mar 07 '22 07:03 JulianKnodt

:umbrella: The latest upstream changes (presumably #753) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Mar 09 '22 21:03 bors

Is this PR in the right direction? I think chalk should not get its hand dirty with const evaluation, since const eval needs handling and interpreting whole rust syntax, and doing that in chalk is against modularization. I imagine that the user of chalk should provide const eval infrastructure, and evaluate const generics so chalk has them in the concrete shape.

In this way, chalk doesn't need to normalize associated constants (it can't normalize completely without full const eval), it just needs to provide a function that computes an ImplId + substitution from a <Type as Trait>, so that the caller can find associated constants and evaluate them (and other associated items for other reasons).

HKalbasi avatar Apr 16 '22 09:04 HKalbasi

@HKalbasi It's been a minute since I started this, and it's a good reminder for me to go back and actually implement this (I'm starting to finally get more time on my hands), but the context for this is that it would make sense to support const equality in the context of trait bounds (see here). While I don't know whether Chalk needs to support evaluating them, my understanding from a few months ago that chalk needs to support consts in a new position which it previously did not.

If any of this is wrong, please let me know, I haven't thought about this in a minute and should get back to it.

JulianKnodt avatar Apr 17 '22 04:04 JulianKnodt

I thought it is going to add a NormalizeConst (which is essentially const eval) similar to NormalizeFn in #726 and handles associated constants in <Type as Trait>::ASSOC_CONST position, but it is about associated constants in Trait<ASSOC_CONST=?> position, so my comment above is irrelevant. Sorry for noise.

HKalbasi avatar Apr 17 '22 05:04 HKalbasi

@compiler-errors Do you know who I can ask about Chalk? I'm starting to run into things I am unsure about, and am unsure where to look. Specifically, is there any existing infrastructure for consts inside of chalk?

JulianKnodt avatar May 05 '22 03:05 JulianKnodt

Generally I or @nikomatsakis should have the most knowledge of Chalk things. Easiest to ask in Zulip.

There is very little infrastructure for consts in Chalk. I think most/all of it is in chalk-ir, for variable kinds and such.

jackh726 avatar May 05 '22 04:05 jackh726

:umbrella: The latest upstream changes (presumably #767) made this pull request unmergeable. Please resolve the merge conflicts.

bors avatar Jun 21 '22 22:06 bors