Skip to content

vyperlang/vyper / skills

vyper-compiler

Verified

Vyper smart contract compiler internals. Use when working on the Vyper compiler codebase — compilation pipeline, Venom IR, semantic analysis, code generation, testing, or contributing. Triggers on vyper compiler development, Venom passes, AST/semantics changes, codegen work, or test writing.

FileKindSize
SKILL.mdskill md4.4 KB
codegen.mdmarkdown1.1 KB
contributing.mdmarkdown7.8 KB
semantics.mdmarkdown2.3 KB
testing.mdmarkdown1.6 KB
venom.mdmarkdown2.0 KB

codegen.md

View on GitHub
# Code Generation

## Experimental Pipeline: Direct-to-Venom

AST → `vyper/codegen_venom/` → Venom IR → optimization passes → assembly → bytecode.

### `vyper/codegen_venom/`

Translates annotated Vyper AST directly to Venom SSA IR.

- `module.py` — entry point, module-level codegen
- `expr.py` — expression translation
- `stmt.py` — statement translation
- `arithmetic.py` — numeric operations
- `builtins/` — built-in function codegen
- `abi/` — ABI encoding/decoding
- `context.py` — codegen context (variable tracking, etc.)

### Venom → Assembly

After Venom IR is constructed, `vyper/venom/` runs optimization passes then
`venom/venom_to_assembly.py` emits EVM assembly. The assembler in `vyper/evm/assembler/`
produces final bytecode.

## Default Production Pipeline: Legacy IR

AST → `vyper/codegen/` → s-expression IR (`IRnode`) → `vyper/ir/compile_ir.py` → assembly → bytecode.

This is the current default. See [vyper/ir/README.md](../vyper/ir/README.md) for IR grammar and structure.

Key difference: legacy IR is tree-shaped s-expressions, Venom is SSA basic blocks.
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 322kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 322kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 322kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 198kUpdated Claude CodeCodexVerifiedInstall