Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

system.FFI effect doesn't "subsume" other effects #349

Open
Darya- opened this issue Aug 26, 2019 · 2 comments
Open

system.FFI effect doesn't "subsume" other effects #349

Darya- opened this issue Aug 26, 2019 · 2 comments

Comments

@Darya-
Copy link
Member

Darya- commented Aug 26, 2019

In the text-editor application, annotate the logger type and module in the following way:

logger.wyv:

module def logger(logFile: fileSystem.File): Logger
effect Update = {}
def updateLog(msg: String): Unit
...

Logger.wyt:

resource type Logger
  effect Update
  def updateLog(msg: String): {this.Update} Unit

Then annotate textEditor's run and runPluginOnSetup methods in the following way:

In both textEditor.wyv and TextEditor.wyt:

def runPluginOnSetup(plugin: Plugin): {system.FFI} Unit
def run(): {system.FFI} Unit

Run the text-editor application.

Expected behavior: No error is thrown.

Actual behavior: The following error is thrown:
Effect annotation {system.FFI} on method run is not a subtype of effects that method produces, which are [system.FFI, logger.Update]; at location file wyvern/examples/text-editor/textEditor.wyv on line 134 column 5

@JonathanAldrich
Copy link
Member

You don't show the implementation of run and runPluginOnSetup, so I can't tell for sure what the issue is.

But if you were expecting system.FFI to be the universal effect (i.e. top in the lattice of effect sets), that is not how I envisioned it. Rather, I see it as a primitive out of which other effects can be built. If you have a strong reason to treat it as Top, we should discuss. Perhaps there should be some other thing that is Top.

@Darya-
Copy link
Member Author

Darya- commented Aug 26, 2019

The full implementations can be seen in the linked file: https://github.com/wyvernlang/wyvern/blob/master/examples/text-editor/textEditor.wyv.

Let's discuss this at our next meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants