-
Notifications
You must be signed in to change notification settings - Fork 11
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
stdlib and prelude #59
Conversation
2748e4a
to
d9b0e06
Compare
Honestly, in the spirit of small, atomic changes, we could just merge this as-is and add more stuff to the prelude and stdlib in follow-up PRs. |
I like having small atomic changes :-) I have a concern about this way of doing it. I am afraid that it ties Klister to running from the root of the repository. Shouldn't we be using Cabal's |
I think that "stdlib" should be removed from Main.hs, then your KLISTERPATH determines where to find the prelude and standard library. Does that address your concern? |
I like the idea of installing the stdlib using data-files. |
It does not! I'd like Klister programs that use the standard library to just work, regardless of the CWD or the setting of environment variables. In other words, the Klister executable should be able to find the I think there's three reasonable ways to achieve this:
I like 2, because the standard library is standard, and really part of the language, and should just always be there. |
me too! large changes take me forever to review (sorry it's taking me so long) |
One further issue to think of: with KLISTERPATH, I can break a library by adding a local file with a name that conflicts. The import in the library, which may be a purely internal thing, might become ambiguous with something I've just created. What about resolving ambiguities thusly: first, check for adjacent files with the given name. Then, check for stdlib. Only after that, fall back on KLISTERPATH. Or we could indicate these situations by expanding the concrete syntax of module paths a la Racket. |
I like this! Eventually, we could also have logical module paths like Haskell or Coq, rather than a flat namespace. I think that would complement the search order. I will make the change to use Cabal data files before merging. |
d9b0e06
to
ee7e358
Compare
One other way (maybe this fell outside of "reasonable" 😄) would be to bake the standard library into the Klister executable using Template Haskell. This has the advantage of always "just working" for the user, and has some performance advantages (no need to touch the filesystem, do expansion, nor parse when importing a stdlib module). |
For precedent on this approach, we can look to Cryptol: https://github.com/GaloisInc/cryptol/blob/7e841e915f34a21bbfad67070c7338662ac28601/cryptol.cabal |
ee7e358
to
7b75caf
Compare
7b75caf
to
3b8c41b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good!
3b8c41b
to
ed349cb
Compare
ed349cb
to
f73c138
Compare
Progress on #54, requires #57, fixes #64