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

Case study code is incomplete, run button doesn't work, no easy way to copy example code #80

Open
osa1 opened this issue Nov 13, 2024 · 1 comment

Comments

@osa1
Copy link

osa1 commented Nov 13, 2024

This is an issue report and feedback at the same time.

Consider this case study: https://effekt-lang.org/docs/casestudies/scheduler

Problems:

  • "run" button at the end does not work. It fails with "Cannot compile interactive.effekt".

  • If I want to try this locally, I have to copy and paste 4 different snippets of code. For that I have to manually select the code. These days it's more common to have a "copy contents to clipboard" button in code snippets. E.g. GitHub shows an icon for this on the top-right of code.

  • Even after copying all of the snippets to a file it doesn't work, because the snippets don't show the whole thing. At least some imports seem to be missing. Error from the REPL:

    > import scheduler
    [error] ./scheduler.effekt:8:14: Could not resolve type Dequeue
      var queue: Dequeue[() => Unit at {this, prog}] in this = emptyQueue();
                 ^^^^^^^
    

In general, it would be helpful if all complete examples in the web site had a link to the full file of the example that can be run locally by copying the entire file.

@marvinborner
Copy link
Member

marvinborner commented Nov 13, 2024

Thanks for the feedback!

The casestudies are actually generated from runnable files which we call literate Effekt. You can run this particular casestudy using effekt.sh examples/casestudies/scheduler.effekt.md (inside the Effekt repository).

Clicking on the "run" button will only cause "Cannot compile interactive.effekt" if you do not call the main() function (you can enter this yourself).

I agree, though, that both of these points could be made a lot more clear. Linking to the literate Effekt file also sounds like a good idea.

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

No branches or pull requests

2 participants