Coder Social home page Coder Social logo

Comments (2)

tzaffi avatar tzaffi commented on August 16, 2024

@barnjamin

Also, we need docstrings whenever that explain the sourcemap-related params image

We already have a doc-string:

#689 adds it to Router.compile() as well:

  • for the router in upcoming #689:

    pyteal/pyteal/ast/router.py

    Lines 1245 to 1271 in f94fa7a

    Args:
    version (optional): The TEAL version to compile to. Defaults to `DEFAULT_TEAL_VERSION`.
    assemble_constants (optional): When `True`, the compiler will assemble constants to
    intc and bytec blocks. Defaults to `False`.
    optimize (optional): An `OptimizeOptions` object to use to provide optimization information
    to the compiler.
    approval_filename (optional): The filename to use in the sourcemap for the approval program.
    If not provided, the router will use the Router object's `name` field with suffix "_approval.teal".
    clear_filename (optional): The filename to use in the sourcemap for the clear program.
    If not provided, the router will use the Router object's `name` field with suffix "_clear.teal".
    with_sourcemaps (optional): When `True`, the compiler will produce source maps that map the
    generated approval and clear TEAL assembly back to the original PyTeal source code.
    Defaults to `False`.
    pcs_in_sourcemap (optional): When `True`, the compiler will include the program counter in
    relevant sourcemap artifacts. This requires an `AlgodClient` (see next param).
    Defaults to `False`.
    algod_client (optional): An `AlgodClient` to use to fetch program counters. Defaults to `None`.
    When `pcs_in_sourcemap` is `True` and `algod_client` is not provided, the compiler will
    assume that an Algorand Sandbox algod client is running on the default port (4001) and -if
    this is not the case- will raise an exception.
    annotate_teal (optional): When `True`, the compiler will produce a TEAL assembly with comments
    that describe the PyTeal source code that generated each line of the assembly.
    Defaults to `False`.
    annotate_teal_headers (optional): When `True` along with `annotate_teal` being `True`, a header
    line with column names will be added at the top of the annotated teal. Defaults to `False`.
    annotate_teal_concise (optional): When `True` along with `annotate_teal` being `True`, the compiler
    will provide fewer columns in the annotated teal. Defaults to `True`.

from pyteal.

tzaffi avatar tzaffi commented on August 16, 2024

Problem

There currently isn't any information in our Read the Docs about source mapping. This makes it harder for developers to get started with the feature.

Solution

Add a new page, probably after the Compiler Optimization section briefly showing the usage pattern. It doesn't have to be a very long page.

Dependencies

Urgency

High - I don't consider the source mapper to even be "beta" until there are doc's that anyone can read in their official place that provide an explanation of how to use the feature.

Addressed by #692

from pyteal.

Related Issues (20)

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.