Skip to content
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

Monday 7th Janurary 2019 #1179

Closed
fubuloubu opened this issue Jan 6, 2019 · 13 comments
Closed

Monday 7th Janurary 2019 #1179

fubuloubu opened this issue Jan 6, 2019 · 13 comments
Labels
meeting Meeting

Comments

@fubuloubu
Copy link
Member

fubuloubu commented Jan 6, 2019

@fubuloubu fubuloubu added the meeting Meeting label Jan 6, 2019
@jacqueswww
Copy link
Contributor

jacqueswww commented Jan 7, 2019

AST output:

  • Create a proof of concept for AST output.
  • Then iterate on this implementation.
  • Formalized grammer, see k semantics.

@fubuloubu
Copy link
Member Author

fubuloubu commented Jan 7, 2019

Also, formalize the grammar (maybe in K?)

@nrryuya
Copy link
Contributor

nrryuya commented Jan 7, 2019

Great, you mean updating this work?
https://github.com/kframework/vyper-semantics

@fubuloubu
Copy link
Member Author

Yes!

+10 Brownie points if we somehow pull that as a submodule and have a nightly CI test against it

@nrryuya
Copy link
Contributor

nrryuya commented Jan 8, 2019

Cool. Through FVyper project I thought formal verification of Vyper compiler is as important as verifying Vyper contracts so I verified clear function as a PoC.
https://github.com/LayerXcom/verified-vyper-contracts/tree/master/k/built-ins

This verification is working in CircleCI, with other verification including ERC20.

AFAIK https://github.com/kframework/vyper-semantics is another compiler based on K.

@nrryuya
Copy link
Contributor

nrryuya commented Jan 8, 2019

Just a note, there is a Python semantics in K.
https://github.com/kframework/python-semantics

@fubuloubu
Copy link
Member Author

I would say if you want to do the work, the K setup gives you a template for how the larger build can work. One big note that came out of the meeting today is that we need to get better at documenting and testing against our grammar.

A good side effect is that can do formal verification of the compiler like this. Another good side effect is it makes refactoring WAY easier if we have test cases to run against our grammar (and we would like to do that). We found a LOT of very deep bugs from having this exercise performed by the Runtime Verification folks (creators of K) back in the springtime of last year.

@fubuloubu
Copy link
Member Author

fubuloubu commented Jan 8, 2019

An ultimate goal that was being planned for the work with K is to have a mode that could do a triangular verification of the sourcecode and the bytecode of a program, proving semantic equivalence of a program in K after it has been compiled (since there is formal semantics for EVM execution).

@mihairaulea
Copy link

hey @fubuloubu -- i am helping Slither add support for Vyper, and i am proficient with compilers and ASTs. I understand what needs to be done here. Do you think i could help?

@jacqueswww
Copy link
Contributor

jacqueswww commented Jan 8, 2019

@mihairaulea the biggest problem with getting this feature out at the moment is that we use the ast module of python 3 directly. As discussed in the call we probably want to put our own AST layer (could have a lot of replicated classes etc. but still unique concepts like payable and distinct types) in Vyper. Once we have this we can loop you in to do serialization thereof ?

Unless you are keen to do this conversion as well, o'course :)

@fubuloubu
Copy link
Member Author

@mihairaulea first step in my book is to define the grammar in an executable format (like K) that we can refactor our front end against.

@montyly
Copy link

montyly commented Jan 10, 2019

@jacqueswww @fubuloubu would it make sense if we go ahead and create a vyper_to_json utility, that takes a vyper code and outputs its representation to a json file?

From my (small) understanding of the vyper codebase, we could follow something similar to https://github.com/ethereum/vyper/blob/c558ce3d5e40ddeb95d583f6037c80ca9e40f94d/vyper/parser/parser.py#L205-L239
without the LLL part, and export global_ctx and the end.

Would that make sense and be helpful for your team?

@jacqueswww
Copy link
Contributor

@montyly yes that would be roughly what needs to be done, additionally a local context gets produced with each parse_func call - actually for context info it's very similar to https://github.com/jacqueswww/vyper-debug/blob/master/vdb/source_map.py#L40

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

No branches or pull requests

5 participants