Skip to content

Conversation

crusso
Copy link
Contributor

@crusso crusso commented Aug 21, 2025

@ggreif all seems ok to me.

import Prim "mo:prim";
actor a {

  public func m() : async () {
    Prim.debugPrint(debug_show {
      cycles = Prim.cyclesAvailable();
      deadline = Prim.replyDeadline()
    });
  };

  func sync() : () {
      Prim.debugPrint("f()");
  };

  func fstar() : async* () {
    Prim.debugPrint("fstar()");
    await (with cycles=200; timeout = 400) m();
    ignore (with cycles=400; timeout = 800) m();
  };

  func f() : async () {
    Prim.debugPrint("f()");
    await (with cycles=600; timeout = 1200) m();
    ignore (with cycles=800; timeout = 1600) m();
  };

  public func go() : async () {
      await (with cycles=100; timeout = 200) m();
      sync(); // some effect
      ignore      sync(); // some effect
      let _ = fstar(); // no effect
      ignore fstar(); // no effect
      await* fstar(); // some effect

      let _ = f(); // some effect
      ignore f(); // some effect
      await f(); // some effect

  };

};

output:

debug.print: {cycles = 100; deadline = 1_755_789_114_000_000_000}
debug.print: f()
debug.print: f()
debug.print: fstar()
debug.print: {cycles = 200; deadline = 1_755_789_214_000_000_000}
debug.print: {cycles = 400; deadline = 1_755_789_214_000_000_000}
debug.print: f()
debug.print: f()
debug.print: f()
debug.print: {cycles = 600; deadline = 1_755_789_214_000_000_000}
debug.print: {cycles = 600; deadline = 1_755_789_214_000_000_000}
debug.print: {cycles = 600; deadline = 1_755_789_214_000_000_000}
debug.print: {cycles = 800; deadline = 1_755_789_214_000_000_000}
debug.print: {cycles = 800; deadline = 1_755_789_214_000_000_000}
debug.print: {cycles = 800; deadline = 1_755_789_214_000_000_000}
ingress Completed: Reply: 0x4449444c0000

Copy link
Contributor

Comparing from 6a60840 to b968d01:
The produced WebAssembly code seems to be completely unchanged.

@ggreif ggreif changed the title experiment: sanity check async vs async* experiment: sanity check async vs async* Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant