Arc Forumnew | comments | leaders | submitlogin
Programmatically interacting with running mzscheme?
2 points by tokipin 5668 days ago | 17 comments
I might think about making a noob-oriented Arc IDE. Ideally I would have the console/output be within the IDE itself (rather than run stuff in an external OS console.)

What would be the easiest way of doing that? I tried looking through the PLT source but it was not very straightforward...



2 points by shader 5668 days ago | link

I've been using a setup for running the arc server that allows me to connect to an already running arc service. I have a shell/mzscheme file that launch the arc server, and in a separate thread runs the repl parameterized to read and write on two pipes. Then I have another shell program that just reads from the one pipe, and writes to the other. Finally, I rlwrap that, and I'm connected to the arc repl just as if I had run it normally from the command line.

It's great for making a server that can be launched by cron or initd, and still be able to connect to it. You could alternatively use a socket based system, or disable the close-on-eof, and then you wouldn't have to worry about quitting your server when you disconnect. Though, odds are you aren't going to be worrying about that anyway, as you're only using it for an ide.

I can show you a copy of the file, if you want ;)

-----

1 point by tokipin 5665 days ago | link

thanks. i'm on Windows though and slightly fascist and unreasonable in that i'm not particularly worried about the program working on another platform. i should have mentioned that though. (also i think if anyone needs a noob-oriented IDE, it's going to be Windows users)

-----

2 points by shader 5665 days ago | link

The same system should work for windows. Windows does support named pipes, and you don't have to use unix shell code to launch the arc process, since you're writing another program anyway.

-----

1 point by shader 5665 days ago | link

Yeah, everyone else uses emacs, vim, or textmate.

-----

1 point by rntz 5665 days ago | link

Emacs runs on windows.

-----

1 point by shader 5665 days ago | link

Yes, but anyone running Windows is much less likely to use emacs or vim over some gui ide. Linux users are much more likely to be willing to learn those two.

-----

1 point by eds 5668 days ago | link

Have you looked at GNU Screen (http://www.gnu.org/software/screen/)?

It does most of what you describe (connecting/disconnecting from a running Arc repl). I don't know if you can use it to save cron jobs, but that's not something I typically need to do.

It doesn't, however, solve the IDE problem.

-----

1 point by shader 5668 days ago | link

Yes, I use screen very heavily, and I do use it to leave an arc process running, and connect to it again later.

But it can't connect to an arc repl that was executed by a non-interactive shell, such as via cron or initd. That's what I use the pipe system for, and a similar system could easily be used by an ide to communicate with arc and not create a visible shell window.

-----

2 points by conanite 5668 days ago | link

Have you looked at arc-welder (arc IDE distributed with rainbow, uses java/swing for UI) ?

You can evaluate code from the IDE, although for the moment output goes to the console. This is trivial to change though. I've just recently added a crude jump-to-definition feature so it's quick and easy to find function and macro definitions. Screenshot at http://www.fnargs.com/2009/05/introducing-welder.html

I'm preparing a new, faster rainbow which will hopefully be ready in the next few days. Let me know if you're interested in trying it out.

Alternatively, if you don't want to go anywhere near java (understandable), you might find this interesting for ui development in arc: http://arcfn.com/2008/05/using-opengl-with-arc.html

-----

1 point by tokipin 5665 days ago | link

yea Java is out of the picture ~.~

mainly because i like the WPF (.NET 3.0+) controls which have an elegant non-saccharine quality

-----

2 points by CatDancer 5668 days ago | link

You might look at prompt.arc for a starting point. It allows Arc expressions to be evaluated from a web page; your IDE could connect to the running Arc process as an HTTP client and evaluate Arc expressions in the same way.

-----

1 point by tokipin 5665 days ago | link

cool, i'll probably try that out

-----

2 points by eds 5668 days ago | link

Has anyone tried SLIME with Arc yet? I believe SLIME works with some varieties of Scheme, so it may be possible.

-----

3 points by shader 5668 days ago | link

No I haven't. I've been meaning to look into that, but so far I've just been using arc.el. If you know anything about getting arc to work with slime, and have any success in that area, I'd be interested.

-----

1 point by tokipin 5665 days ago | link

i actually use Vim which is more than sufficient for my needs. what i'm thinking of making is a completely noob-oriented IDE, one where ideally the user does not even have to know about mzscheme this or arc3.tar that

the look and feel is also important :D

-----

2 points by anarcer 5667 days ago | link

Could ABLE (lisp editor) be a good start point?

http://phil.nullable.eu/

-----

1 point by tokipin 5665 days ago | link

that's the kind of thing i'm going for, but i couldn't find the source for that program o.o

-----