The Solang Solidity Compiler is a new compiler project, which compiles Solidity to wasm or bpf. The compiler does not yet detect if a variable is used before it is assigned, or detecting that a value set is never used. For example: For example: contract test { function f(bool condition) public return (int) { int x; int y = 5; if (condition) { x = 102; } return x; } } This code has two problems: y is never used, and the value of x might be returned without it being given a value. In compiler theory this is done with reaching definitions. Solang already has an implementation of reaching definitions for the constant propagation pass, which will have to be generalized. Unused variables should be removed from the generated code. Secondly, implement a common subexpression elimination pass, which also uses the same reaching definitions implementation, to ensure subexpressions can safely be substituted. Learning Objectives 1) learn how to be a positive collaborator and contributor in an active open source project. 2) Learn how to work within the Hyperledger open source ecosystem and culture. 3) Understand smart contracts and the Solidity language 4) Gain a greater understanding of compiler optimizations and compiler theory Expected Outcome 1) Solang gives errors when undefined variables are used 2) Solang gives warnings when variables are not used, and removes them from the generated code 3) Solang does a common subexpression elimination pass
No project history available for this organization.
Counts are based on projects listed in the Contribo catalog.
Showing 1 of 1 projects. Click any project card for scope, mentors, and proposal studio.
The Solang Solidity Compiler is a new compiler project, which compiles Solidity to wasm or bpf. The compiler does not yet detect if a variable is used before it is assigned, or detecting that a value set is never used. For example: For example: contract test { function f(bool condition) public return (int) { int x; int y = 5; if (condition) { x = 102; } return x; } } This code has two problems: y is never used, and the value of x might be returned without it being given a value. In compiler theory this is done with reaching definitions. Solang already has an implementation of reaching definitions for the constant propagation pass, which will have to be generalized. Unused variables should be removed from the generated code. Secondly, implement a common subexpression elimination pass, which also uses the same reaching definitions implementation, to ensure subexpressions can safely be substituted. Learning Objectives 1) learn how to be a positive collaborator and contributor in an active open source project. 2) Learn how to work within the Hyperledger open source ecosystem and culture. 3) Understand smart contracts and the Solidity language 4) Gain a greater understanding of compiler optimizations and compiler theory Expected Outcome 1) Solang gives errors when undefined variables are used 2) Solang gives warnings when variables are not used, and removes them from the generated code 3) Solang does a common subexpression elimination pass