Skip to content

feat: Add support for Vyper in the Playground #407

@enochakinbode

Description

@enochakinbode

Description

Currently, evm.codes is the gold standard for interactive EVM opcode debugging, but it is primarily focused on Solidity and Yul. As Vyper remains a critical language for Ethereum (powering protocols like Curve and others), adding Vyper support would make this tool the ultimate cross-language playground for the ecosystem.

The Challenge: Python in the Browser

Since Vyper is a Python-based application with specific dependencies, running it in a browser environment requires a way to execute Python code without a backend. I have been researching ways to achieve this and would like to propose an implementation strategy.

Proposed Technical Approaches

To run the Vyper compiler client-side, we could utilize one of the following:

Pyodide (WASM): (Recommended) A WASM-based CPython interpreter. It is robust, handles complex dependencies well, and can be isolated in a Web Worker to prevent UI blocking.
Brython: Transpiles Python to JS at runtime.
Skulpt: A pure JavaScript implementation of a Python interpreter.

Given that Vyper relies on specific libraries (like ast and semantic-version), Pyodide seems the most viable for a high-fidelity compilation experience similar to the existing soljson.js workflow.

I would like to implement this!

I am highly interested in carrying out this work. My goal is to create a seamless experience where switching the language dropdown to "Vyper" initializes a Vyper-specific worker, compiles the source to bytecode, and feeds it directly into the existing EVM emulator.

I’ve been exploring the site's architecture and would appreciate any guidance on the preferred way to integrate this into the existing Playground component.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions