New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add first draft of const eval skill tree to this repo #43
Conversation
Can you point to a rendered version of this to make reading the PR easier? |
It's a lot of work to set up a webpage. I have no system set up in order to do something like that easily and I couldn't find a throwaway website hoster. I added instructions to the PR for how to render the skill tree. |
About to build and host on turbo.fish :) |
I'll try to get a rendering setup on this repo |
https://static.turbo.fish/const-eval-skill-tree/skill-tree.html
EDIT: automated, will check that is catches the next few updates, if it breaks after that let me know. |
Thanks <3 |
Okay so we can look at https://static.turbo.fish/const-eval-skill-tree/skill-tree.html to review the toml file in this branch? That's amazing. :D |
Yeah, but it takes up to five minutes for it to update, bc. I can't do webhooks on things I don't have owner access to, so the bot now just checks whether the HEAD of the PR has changed every 5 minutes to determine whether to re-build. |
What is this for? Documentation purposes? |
@vertexclique I see it as a tool for goal-setting. When a topic is as complicated as this, instead of holding the entirety of it in your head, a visualization tool like this one is really handy :) |
All right, I took a look at this. Looks good overall, though some of it is a bit scattered.
I had to read this 5 times to understand what you mean.^^ I first thought it was about functions like
IMO the longer-term plan here should be to only promote things implicitly which, syntactically, we would also allow in patterns. That's an easy principle, and getting rid of the
I don't think we can ever run this as-is in CTFE, or at least it needs more than the skill tree currently documents. In Miri, this function was only properly supported after we added intrptrcast! The issue is that it can compare pointers to zero-sized allocations with integers, and there is no way we can answer that question in CTFE. So I think there are two options:
This also needs a link from "something with (fn) ptr equality"
Needs a link from
I don't think this has anything to do with |
Oh, I just realized this is actually more powerful than match foo { some_pattern_fn(x) => x, _ => return } But that seems fairly orthogonal to me to... all of CTFE, really. It requires a totally different way of "evaluating" functions. So I wouldn't even make it part of the same skill tree. |
Since we made raw ptr comparisons unsafe already in const contexts, we don't need an intrinsic, we can just make that comparison behave this way. |
We could, but that seems even more risky. I'd rather call out more explicitly that this is not the pointer comparison operation one is used to. |
@jplatte the skill-tree tool changed how it works. The command to regenerate is now I added some stylesheet magic to cause the arrows to get thicker and colorful when the mouse hovers over them, I think this should address the concern by the lang team about the tree being hard to trace with all of those arrows. This already got a lot better after I removed if/match and loop, but still. |
@oli-obk if/when this repo lands, we can set it up to auto-publish the mdbook to rust-lang.github.io/const-eval with relative ease. Then you could also add other things to the book if they made sense. |
@oli-obk Updating to skill-tree 2.0 + mdbook is more work than I was able to invest today. However, skill-tree-upd did crash and I've restarted and made it a bit more robust now. I hope it continues to be valuable without updating to 2.0, but otherwise I can try to update to 2.0 tomorrow. |
@jplatte thanks for all the work you've put into this, it has made discussion in this PR much more effective. I'll figure out how to run this in CI for auto-publishing now. |
rust-lang/rust#57563 (comment) doesn't seem to be in the skill tree? Is it worth adding? |
added it |
@oli-obk shall we .. merge this and set it up so that it gets published at |
I haven't done the work we talked about at the const eval lang team meeting yet. Most notably not all nodes in the skill tree have a hyperlink to a tracking issue, but maybe it would be better to merge first and then keep adjusting it. |
We'll have to do a bit of setup to get it published. To be honest I usually just ping @Mark-Simulacrum or @pietroalbini who have access to handy scripts to make that work =) |
Happy to do the legwork to get this published, just give me a ping on Zulip (#t-infra works) with the repo and domain you want it published at. |
src/skill-tree.toml
Outdated
name = "transmute" | ||
label = "transmute" | ||
requires = ["unconst_rules"] | ||
items = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably add const_fn_transmute
, or rather make it one node with const_fn_union
.
I find it hard to review something like this, so I am in favor of merging it (with |
@Mark-Simulacrum I set up github actions to generate the mdbook on the |
No description provided.