Open pkoppstein opened 2 years ago
you might be looking for https://github.com/joshgoebel/wren-console/ ?
@ruby0x1 - No, this question has nothing to do with wren-console or JSON. It is about specifying the location of a module in an arbitrary location, as per the "subject". Thanks anyway.
Module resolution is handled by the host, so for example how dome handles modules is different to wren cli, and the log you linked mentioned stuff from wren console (specifically wrenc) which implied the resolution question might be host specific. @joshgoebel can check, I haven't read into the issue just yet.
@ruby0x1 I don't know what this is (from the log)... wren-console
shows both the host and wren version when asked. (the prior --version
output from 0.2.91 was even longer)
% wrenc --version
wrenc v0.3 (with wren v0.4)
My guess was they were using wren-cli
renamed to Wren but compiled from source (hence the 0.4, but I didn't look to confirm)?
@pkoppstein wren-essentials
contains binary modules (including JSON)... so that's not going to work well with just an import
anyways (even if you get the path sorted)... you'll need to build it into your binary CLI (or use wren-console
which does that for you).
There is of course the experimental binary module loading support, but as mentioned in the, very experimental.
@pkoppstein I think you'll find wren-cli
simply doesn't know how to resolve absolute paths. Only "relative" and simple paths (ie, built-ins)...
Reference: https://github.com/wren-lang/wren-cli/blob/main/src/cli/vm.c#L135
This is something wren-console
supports IIRC (there are several PRs along those lines) - as it's module loading system has been mostly/entirely re-written (in Wren). I'd suggest this issue be renamed to be a feature request asking that wren-cli
add absolute path support.
@joshgoebel - I've added ER to the "subject" as you suggested. I was originally going to do so, but then I came across the munificent quotation at the very top of this thread, so it began to look more like a bug. Thanks.
@ruby0x1 - Sorry for the confusion about wren-console
vs wren-cli
. I guess you saw my original post via Discord, rather than the revision that I posted almost immediately afterwards.
Over at https://github.com/wren-lang/wren/issues/346 I see:
That does not seem to be true of wren-cli. I think it should be possible to specify an absolute path. Or am I missing something?
Example
Changing the first / in the import to // did not help.