Skip to content

Machine readable info #51

@bitdivine

Description

@bitdivine

First off, thank you for a useful project.

I used to use wasm-nm (src) to get the symbol table from a Wasm file. It's basically the UNIX nm but for Wasms. Unfortunately wasm-nm is unmaintained and doesn't work on recent Wasm files that have new instructions.

Thankfully ic-wasm info also provides the list of exported functions and it works with recent wasms, so that is great. My only minor gripe is that the output is not very machine readable. I have to parse it with sed and if ever you change the format, those sed scripts might well break.

Would you be open to providing a machine readable output? For example, ic-wasm info --json so that the output can be parsed with jq?

If so, I would be happy to provide a PR to do this. I would propose to gather all the info collected here into a struct. On that struct I would have a to_string() method that provides output identical to the current output. I would then add the option of serializing that struct as JSON instead.

What do you think?

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