Arc Forumnew | comments | leaders | submitlogin
Running in DrRacket?
2 points by nupa 1872 days ago | 5 comments
Is it possible to access the arc repl in DrRacket, say by doing `#lang anarki` ? Currently I'm getting the error

#%module-begin: bad syntax in: (#%module-begin)

Interactions disabled: anarki/lang/module-begin does not support a REPL (no #%top-interaction)



4 points by rocketnia 1871 days ago | link

The simple answer is no, there is no particularly good way to access the Anarki REPL in DrRacket at the moment.

There is a `#lang anarki`, but as far as I know nobody has used it yet. I only gave it a minimal amount of support to make it possible to use Anarki to write modules Racket code could (require ...), and I didn't pay any attention to DrRacket.

I recommend ignoring `#lang anarki` for now, because it might be subject to change as we figure out more of what things like DrRacket need from it.

Instead, I recommend running Anarki from the command line if you can, as described in the Anarki readme: https://github.com/arclanguage/anarki

Are you on Windows? Most of the instructions don't talk about Windows yet, but it's still possible there.

To open a REPL:

Linux and macOS:

  ./arc.sh
Windows:

  .\arc
If you've written a file of Anarki code in my-code.arc, you can run it like so:

Linux and macOS:

  ./arc.sh -n my-code.arc
Windows:

  .\arc my-code.arc
All these commands must be run from the Anarki directory (where arc.sh and arc.cmd are).

-----

3 points by nupa 1870 days ago | link

Thanks! And yes I'm on windows, although that command didn't work at first -- protip, you can't run it from a powershell prompt, it has to be a cmd prompt. Weird.

-----

2 points by rocketnia 1870 days ago | link

Interesting, 'cause I even tested it at a powershell prompt to make sure before I posted. What problems were you seeing?

-----

2 points by nupa 1844 days ago | link

Apologies, I just saw this reply now. It looks like this:

    PS C:\git\anarki> .\arc
    Program 'arc.cmd' failed to run: Access is deniedAt line:1 char:1
    + .\arc
    + ~~~~~.
    At line:1 char:1
    + .\arc
    + ~~~~~
        + CategoryInfo          : ResourceUnavailable: (:) [], ApplicationFailedException
        + FullyQualifiedErrorId : NativeCommandFailed

-----

2 points by rocketnia 1843 days ago | link

Thanks. I'm afraid I've never encountered something like that, but I can suggest a few things just in case....

Since arc.cmd is practically a one-line script, what do you get if you try to run the `racket` executable directly, like so?

  racket -t boot.rkt -e "(anarki-windows-cli)"
I've found pretty much just one thread online where people reported a similar issue (https://github.com/Microsoft/WSL/issues/2323). People attempted various fixes in the thread, and they didn't work for everyone.

Some of the approaches they took:

- There's a diagnostic tool which some people found limited success with. It would fix the location of their temp folder. Then a few days later it would break again. Here's a link to the comment that links to that tool: https://github.com/Microsoft/WSL/issues/2323#issuecomment-31...

- One person gave detailed instructions for diagnosing and fixing permission issues, in case that's what it is: https://github.com/Microsoft/WSL/issues/2323#issuecomment-41...

- It seems it might be some difference depending on whether the account you're doing this with is roaming or an administrator. At least, a lot of people in the thread thought it would make a difference. Maybe your command prompt works with Arc because it's a different user.

If you find out any more about what's going on, I hope you'll keep us in the loop. :)

Of course, since you already have this working via the command prompt, it's understandable if you prefer not to mess with it.

-----