Skip to content

Dynamic string construction in WASM codegen #52

Description

@aallan

Summary

Only string constants (literals) are supported in WASM codegen. There is no dynamic string construction at runtime.

Current state

  • String literals are interned in a StringPool and placed in a WASM data segment
  • IO.print can print constant strings
  • No string_concat, to_string, or other dynamic string operations in codegen
  • String operations in contracts are handled by the verifier (Z3), not at runtime

What's needed

  • Dynamic string allocation in linear memory
  • Runtime implementations of string_concat, to_string, length for strings
  • Integration with garbage collection (issue Garbage collection for WASM linear memory #51) for reclaiming string memory

Spec reference

Chapter 11, Section 11.12 "Limitations"

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegenCode generation backendenhancementNew feature or requestlimitationKnown compilation limitation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions