evincarofautumn / kitten

A statically typed concatenative systems programming language.
http://kittenlang.org/
Other
1.09k stars 39 forks source link

REPL cannot load Prelude if the current working directory is incorrect #121

Closed SamirTalwar closed 10 years ago

SamirTalwar commented 10 years ago

It appears the REPL is looking for Prelude.ktn in either . or ./lib. When in another directory than Kitten's own source root, it fails to load it.

I think the best solution would be to compile the Prelude's various files into the Kitten executable, and look up files internally if they are not available on the system path.

evincarofautumn commented 10 years ago

Thanks, couple of possible solutions here, in increasing order of goodness:

SamirTalwar commented 10 years ago

Got it. It looks like the first one should work, but, y'know…

    , configLibraryDirectories = []  -- TODO
dmbarbour commented 10 years ago

I think use of an environment variable would be very appropriate here.

On Sun, May 25, 2014 at 9:52 AM, Jon Purdy notifications@github.com wrote:

Thanks, couple of possible solutions here, in increasing order of goodness:

  • Work around the issue by passing --library /path/to/lib.
  • Compile the prelude into the executable. It can be stored as a Program literal so no parsing or compilation has to be done.
  • Come up with a story for installation, so that the compiler can look in a standard path such as /usr/local/lib or /Library/Frameworks. It would also be possible to store bytecode here instead of source.

— Reply to this email directly or view it on GitHubhttps://github.com/evincarofautumn/kitten/issues/121#issuecomment-44135749 .

evincarofautumn commented 10 years ago

It looks like the first one should work, but, y'know…

f5774e7624589b7416272dfdef9db35bc99a88d0

evincarofautumn commented 10 years ago

I think use of an environment variable would be very appropriate here.

82924c53a68f7264b7cf8fb9d6168a7e2bc202b8

dav-s commented 9 years ago

I ended up making an alias for kitten as /path/to/build/kitten --library /path/to/build and it is working for me now.