Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Module system followups #183

Closed
9 of 11 tasks
SquidDev opened this issue Oct 11, 2019 · 3 comments
Closed
9 of 11 tasks

Module system followups #183

SquidDev opened this issue Oct 11, 2019 · 3 comments
Labels
enhancement Yet Another Module System Issues/PRs relating to YAMS
Milestone

Comments

@SquidDev
Copy link
Member

SquidDev commented Oct 11, 2019

In which Pooh discovers that modules weren't as simple as he had been led to believe.

The driver

  • Cache invalidation: Currently files are stored in the cache forever. Ideally we would be able to detect if a file has changed and, if so, reload it.

    I think the best way to handle this is with a clock with a major (tock) and minor (tick) counter. By default, changed files are not reloaded.

    • On a new tick (say, a new REPL input), erroring files may be reloaded (as this can be done safely without affecting the environment).
    • On a tock (:load), all changed files will be reloaded.
  • Rethink how we handle errors. Currently we try to be conservative with what modules we report errors from, but this ends up hiding important information.

  • Prelude support: I know @zardyh is doing some work on this already, but worth thinking about how it integrates with the driver.

  • Driver monitoring: Can we have a way to listen to various changes within the oracle? This'd be especially useful within the REPL, when using :dump.

  • Write tests for it all!

REPL and editor support

  • Add a :compile out.lua command to the REPL, which just compiles the currently loaded file to Lua, and writes it.

  • The current Emacs integration writes to a temporary file and lints that instead. It would be nice to have support for saying "process this text, pretending it's a file in the cache" (and so erroring on loops).

  • Preserve the cache across :load/:reloads. Currently we trash everything and start again, which is a little wasteful - ideally we'd perform a "tock" (as mentioned in cache invalidation) and re-run the appropriate core.

Note, several of these are dependent on cache invalidation.

Misc

  • Somewhat related to the REPL, but it might be nice to have a "watch mode", which just monitors changes for files and prints out the latest errors on stdout.

  • How do we want to handle libraries? There's an argument here for going a Javascript-esque route, where ./foo.ml will be a relative import, and foo will be an absolute one (hey it's better than "foo.h" vs <foo.h>).

    Alternatively, one could go the Futhark route, and just not have any library path instead - everything goes in your source tree!

  • Support for include. This should be pretty easy - it's pretty much identical to the existing open code, but extending both scopes.

@plt-amy
Copy link
Member

plt-amy commented Oct 11, 2019

Prelude support's happening in feature/guillotine-the-builtins. However, I'm not french, and so I suck at guillotining.

@plt-amy
Copy link
Member

plt-amy commented Oct 12, 2019

Prelude support's done in #184

@plt-amy plt-amy added this to the 1.0.0.0 milestone Oct 13, 2019
@plt-amy plt-amy added the Yet Another Module System Issues/PRs relating to YAMS label Oct 13, 2019
@plt-amy plt-amy pinned this issue Oct 25, 2019
@SquidDev
Copy link
Member Author

SquidDev commented Nov 4, 2019

While editor integration is next on my todo list, having done some more research, I don't think it falls under the current module driver system.

I'm going to close this for the time being, and call this iteration of the module system "done". We'll see what emerges over the next few weeks as far as editor logic goes, and how much can be integrated with the existing systems.

@SquidDev SquidDev closed this as completed Nov 4, 2019
@plt-amy plt-amy unpinned this issue Nov 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Yet Another Module System Issues/PRs relating to YAMS
Projects
None yet
Development

No branches or pull requests

2 participants