Repository navigation
proposal: Move attempt and Exit to Std.Exit - #489
Draft
Allianaab2m wants to merge 3 commits into
Draft
Allianaab2m wants to merge 3 commits into
Allianaab2m wants to merge 3 commits into
Conversation
Fiber.attempt(f) は Exit.attempt(f) に,Exit,Success,Failure の import は Std.Exit からにする.古い名前は残さない(proposals/std-exit.md).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
attemptとExit(Success,Failure)をStd.Fiberから新しいStd.Exitに移す.Fiber.attempt(f)はExit.attempt(f)になる.CauseはStd.Causeのまま.Proposal:
proposals/std-exit.md(status: draft).実装と spec の変更も同じ PR に入れてある.理由
attemptはファイバーを作らず,その場で f を走らせて Fail と Die を値にするだけで,並行と関係ないStd.Fiberを import しているリポジトリ外のコードは,どれもattemptしか使っていないStd.Fiber→Std.Exit→Std.Causeの一方向になる.Fiber.awaitはStd.ExitのExitを返す変更
crates/emela-core/lib/std/exit.emelを足し,Exitとattempt(@intrinsic)を移した.fiber.emelはStd.Exit.{Exit}を import するsources.rs)と lowering の対応(lower/fiber.rs)を("Std.Exit", "attempt")にした.Exitの enum は intrinsic の戻り値の型から引くので,IR と JS・C・WASM のコード生成はモジュール名に依存していない.emb の"Std.Fiber.Exit"だけ名前で比べていたので"Std.Exit.Exit"にしたExit.attemptにした[fiber],[fiber.cause],[error.defect],[lib.layers],[api.std.fiber],[api.std.exit](新設),[api.std.cause],[target.c.unsupported]Std.Httpのlaunch,テストのプログラム,Rust テストの中の Emela ソース,README,snapshot を書き換えたFiber.attemptを残してもSuccessとFailureの import は壊れるspec/history.mdは/acceptの bot が書くので触っていない.過去の history の項目と採択済みの proposal は記録なので書き換えていない.追従が要るリポジトリ外のコード
x/sql:トランザクションdeploy/control/src/sqlite.emelbrix(src/pbt/property.emel):import Std.Fiber.{Success, Failure}とFiber.attempt.tests/lawsが brix v0.3.0 に依存しているので,CI のlawsはこの PR では落ちる. brix を直してリリースし,tests/laws/Pome.lockを上げるまで merge できない確認したこと
cargo nextest run --workspace:1613 passed(wasmtime 50 を PATH に入れて WASM の parity も実行)cargo fmt --check,cargo clippy -D warnings,scripts/spec.py checkexamples/*のemela check・test・fmt --checktests/laws:brix の 15 errors で落ちる(上記)