Skip to content

言語: 所有権・参照セマンティクス RFC #112

Description

@ryuichi1208

目的

値型と heap-backed 型の意味論、関数引数の渡し方(値 / 参照 / move)、ライフタイムの扱いを明文化する。

背景

現状の暗黙ルール(推測):

  • int / float / bool は値型
  • string / Bytes / List[T] は heap-backed (内部ポインタ)
  • ファイバー間で spawn f(s) した場合、s (str) の所有権はどうなる?

#67 メモリ管理戦略 RFC が "TBD" のまま放置されていることもあり、GC / ARC / borrow checker のいずれを採るかが浮いている。

スコープ

  • 値型と参照型の境界を明記
  • 関数引数のパッシングルール
  • spawn 時のキャプチャ意味論(値 / 参照 / move)
  • tcp_close / file_close 後の use-after-free 防止策

検討事項

  • 完全 GC (Go)
  • ARC (Swift)
  • Rust 風 borrow checker(重い)
  • 単純な値コピー + heap は単純参照(C風、安全性は低い)

関連

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:lang言語仕様・構文・型システムdocumentationImprovements or additions to documentationpriority:low将来的に欲しい

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions