Giter Site home page Giter Site logo

huff-ast's Introduction

Huff-AST

Huff-AST is basically a compiler that uses the Abstract Syntax Tree (AST) implementation for Huff, crafted in Rust to facilitate seamless conversion between Solidity and Huff. This project was born out of a compelling idea during the last Huff hackathon: a development tool capable of converting Solidity to Huff and vice versa. Faced with the challenge of choosing a feasible implementation method within a limited time frame, several approaches were considered.

Implementation Approaches

  1. Bytecode Reverse Engineering:

    • Initially contemplating bytecode extraction and reverse engineering, it was quickly dismissed due to the complexity and unreliability of converting bytecode to Solidity. The potential for inaccuracies and the considerable development time required led to the exploration of a more reliable solution.
  2. AST-Based Conversion:

    • Recognizing that both Huff and Solidity are Ethereum Virtual Machine (EVM)-compatible languages, the decision was made to generate ASTs for both and abstract away the language-specific details. The conversion process involves:
      • AST Generation: Parsing the source code of the input language (e.g., Solidity) to generate its AST.
      • IR Generation: Converting the AST into an intermediate representation that abstracts away language-specific details.
      • Language-Specific Transformation: Applying algorithms and rules to the IR to handle differences between the source and target languages.
      • Transformed IR: Producing a transformed IR that captures the essence of the program in the target language.
      • Code Generation: Finally, generating code in the target language using the transformed IR.

Rust Arc

Recently embarking on a Rust learning arc, I've come to appreciate that the best way to solidify language proficiency is through practical projects. As a developer, the desire to build unique, complex tools, and contribute to open-source projects is a driving force—an experience akin to an orgasm, but with programming. Thus, I present Huff-AST, representing the initial strides towards a tool capable of converting between Solidity and Huff. While the project's ultimate worth remains uncertain, your feedback is invaluable

thank you @filipviz for being a sponsor project still in works should be done by march

huff-ast's People

Contributors

malik672 avatar

Stargazers

Michail Molfetas avatar Matthew Stoic avatar 0xYYY avatar Nazgul avatar Hashira avatar evalir avatar Carlos Gonzalez Juarez avatar sudo rm -rf --no-preserve-root / avatar Léo FASANO avatar David Kulman avatar refcell avatar s1cs avatar techer.eth avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.