WAST: Ergonomic Code Generation


Now in public beta, please expect minor changes to public API’s

Release 0.0.1.post14

wast (WAST Abstract Syntax Tree) is the Python package that will make code generation practical and ergonomic

It was originally intended for advanced Python developers who are interested in reducing boilerplate code while working on libraries with huge API surface

Python AST node are represented using attrs based classes with validators preventing logical mistakes and converters enabling simple shortcuts

Autogenerated from Python.asdl found in CPython source tree. And uses previous version of itself for generating newer version. So a process similar to compiler bootstraping was required (first versions were written using built-in Python AST)

Getting started

wast is hosted on PyPI, so installation is as simple as:

$ pip3 install wast

The next steps will get you up and running in no time:

  • Getting started will show you a simple example of wast in action and introduce you to its philosophy

  • Examples has a small collection of more advanced examples

  • …and more to come (documentation being updated)

Indices and tables


Module Index

Search Page