-
Notifications
You must be signed in to change notification settings - Fork 24
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
[Doc] core libfuncs - implement the page skeleton #72
[Doc] core libfuncs - implement the page skeleton #72
Conversation
@remybar great start! Few thoughts:
|
Some thoughts on your Telegram message:
In the table overview, what about using Secondly, from my earlier chat with @barabanovro :
We should update the table structure to reflect the actual Sierra terms: |
5f30243
to
3a71ea6
Compare
Thanks @mazurroman for the feedbacks ! I've updated this PR:
We can write almost everything as refs, we just have to separate them with a |.
Now I plan to document the |
3a71ea6
to
2e307d7
Compare
PR update:
Don't hesitate to give your opinion about the |
2e307d7
to
17a8e6b
Compare
I tried to document
Some thoughts:
@mazurroman @barabanovro As you have far more knowledge than me about Sierra, maybe you can tell us how you would document |
@remybar This is a good idea — we will proceed with documenting the |
Hey @remybar @mazurroman, I have updated array_get with result branches and a few other changes, let me know what you think |
Thanks Roman for this update ! Some minor remarks:
Output RefsSuccess: Fallthrough Branch... the table ... Failure: Target Statement... the table ... One question: do we have to explain a little bit more |
If you have some time to have a look at this, we would be able to finalize this layout and start documenting all the functions in the next days :) |
Hey @remybar thank you for staying on top of this! Your feedback from yesterday was very good and we are in the process of incorporating it. Will get back when it's ready for another round of review. |
Hey @remybar, I've pushed the updates. Could you please wrap up the UI by arranging the Memory, Invoke Refs, and Fallthrough Branch Output Refs (Target Statement Branch Output Refs) tables side by side in a horizontal layout? Also, please share other ways to improve the UI here. |
Thanks Roman ! Ok I will try to improve examples readibility 👍 For the main table, would it be useful to group "fallthrough branch refs" and "statement branch refs" to "output refs ? I mean having a big "output refs" above "falthrough" and "statement". |
@remybar @barabanovro the direction here is good, however there are still few things that need to be improved. We really want to get it to a point where everything is clear.
@remybar, re your question: I think keeping the headers as-is is not too bad. Almost every libfunc will have |
@mazurroman |
I agree with @barabanovro, I would use param names only and explain in the "about sierra" page that we chose to use names instead of numbers to give more meaning to parameters.
Yes, I will try to improve tables layout for examples.
I agree.
Good idea ! I think it's not directly possible in a code block in mdx but I will think how to this.
I don't understand this point. To me, fallthrough branch is when there is no exception (the nominal case) and the statement branch is when there is an out-of-bound error. Both are mentioned in the description 🤔
Would it be better to have a separated "about sierra" page or just a short section above the table to introduce this "libfuncs" page and give more insights about how it works ? I would prefer the second option.
Yes, and after reading the code on starkware repo, I still don't know what is it and how it works 😅
Maybe we should add a sentence at the beginning of the example to describe what we do in the example. For example, "accessing the element at index 4 of an array of 4 elements leads to an out-of-bound error (so a jump to the statement 59)".
Yes, I agree it may be confusing ... Yes, why not using [] for a ref and nothing for a value.
Ok 👍 |
As we already explained what the function does and what the refs are, maybe we can just give a simple example like this. I think it would avoid confusion between refs and values as there are only refs in the code snippet and the memory mapping between refs and values is explicit. Depending on the libfunc and if it's easy to do or not, as on evm.codes, we can provide a link to see the example in the playground tool. So, the user can play with the tool, observe refs values, ... What do you think ? Example 1 - Fallthrough branchReading the element at index 1 from an array of 4 elements.
Memory
Example 2 - Statement branchReading the element at index 4 from an array of 4 elements leads to an out-of-bound error, so a jump to the statement StatementIdx (
Memory
|
I like the syntax blocks and the descriptions! I am not a fan of the memory tables you are suggesting, for the following reasons:
|
Summarising what's left based on the comments above: Left TODO:
Unknowns but still left to do:
|
699b10f
to
b7c64e9
Compare
b7c64e9
to
b7a0ecb
Compare
This new libfuncs page shows a table of Sierra libfuncs from markdown files stored in `docs/libfuncs`.
b7a0ecb
to
fb3d854
Compare
Related to #67.
This PR contains 2 commits:
libfuncs
page which is accessible from the header menu. This page shows a table of Sierra libfuncs built fromdocs/libfuncs
mdx files. Thedocs/HOWTO.md
gives more details about these mdx files.Now, the front-end displays the full list of libfuncs but all these functions has to be documented 🚀