Arc Forumnew | comments | leaders | submitlogin
A few newbie questions
5 points by jcw 5609 days ago | 8 comments
I've been playing around with arc for the past few days, it's been a blast. The tutorial is excellent. However, I'm still lost on a couple things. I'm sure a couple of them are immediately obvious, so please bear with me:

1. What is currently the best way to do graphics programming in arc? All of the good resources on this seem to be pretty outdated: http://arclanguage.org/item?id=1616 http://arcfn.com/2008/05/using-opengl-with-arc.html

Furthermore, is there a way to use PLT Scheme's graphics library without actually loading the arc interpreter in DrScheme? This method (the first link) hangs indefinitely for me. I see that anarki can access mzscheme functions, could this possibly be used?

I understand Rainbow can do graphics stuff pretty well.

2. If arc compiles down to scheme, and mzc compiles down to native code, would compiling arc's interpreter and libraries give us a significant speedup? Not in terms of arc programs, but the interpreter itself. There's a considerable delay every time I run "mzscheme -f arc.as" that prevents me from using arc as a general scripting language.

3. What is everyone's opinion on PicoLisp? It has a minimal C implementation, its own webserver, and hooks into existing C libraries very easily. Are these eventual goals of arc (c implementation/hooks)?



4 points by rntz 5609 days ago | link

1. I don't know how you'd do graphics with arc in general, but if you need to access mzscheme, anarki can do so very easily. If you want to access a scheme function named 'foo, just write ($ foo), or abbreviated, $.foo.

To get started with anarki, install git (http://git-scm.com/), then do:

  $ git clone git://github.com/nex3/arc.git
  $ cd arc
  $ ./arc.sh
  Welcome to MzScheme v4.2.1 [3m], Copyright (c) 2004-2009 PLT Scheme Inc.
  Use (quit) or ^D to quit, (tl) to return here after an interrupt.
  arc>
(This is assuming you're on Linux. I don't know how one would go about setting up anarki on Windows or OS X.)

2. If I understand it correctly, mzc doesn't compile to native code; it just wraps everything up in a neat executable containing the mzscheme binary and the byte-compiled scheme code. There was some discussion earlier about getting mzc to work with arc: http://arclanguage.org/item?id=10157.

3. I haven't looked at picolisp. I do not think that a C implementation/hooks are particularly a long-term goal of arc, especially considering Arc is intended to be the "100-year language", although design decision are of course pg and rtm's domain. However, arc is built on top of mzscheme, and mzcheme has a C FFI I believe, so setting up arc to hook into C should not be impossible.

-----

3 points by conanite 5608 days ago | link

I understand Rainbow can do graphics stuff pretty well.

rainbow comes with tetris, minesweeper and and an arc editor that use the swing library from java so there is lots of sample code to work from. If you've used swing before, you should find it pretty easy from rainbow, and I've tried to design the arc interface so it looks as arc-ish and un-java-ish as possible.

But please bear in mind rntz's observation about the long-term goals of the 100-year language; I'm pretty sure java integration is way off the bottom of the list :)

If you need help to get swing up and running from rainbow, let me know.

-----

2 points by jcw 5604 days ago | link

I downloaded and played around with Rainbow. The examples are great!

-----

2 points by tc-rucho 5605 days ago | link

I'm also interested in doing graphics with Arc, but since using ffi seemed to be an overkill when it comes to opengl, I'm doing some IPC stuff in plain X (not the fastest but the easiest and most flexible to get going). I've thought of modding picolisp to work with arc natively, but I think it's not worth the effort right now, since any design decisions regarding unix integration and stuff are most likely to be trampled and disregarded silently by the vanilla branch (I already see many GOOD improvements in Anarki suffering this). I think I'd wait for arc to be more mature before attempting to write a compiler or interpreter from scratch.

-----

2 points by palsecam 5604 days ago | link

> I'm doing some IPC stuff in plain X

X you mean X.org?! I don't understand here, but it's because I'm not a graphic guy and I've never understand X.org (if you are effectively speaking about it).

Can you provide more explanations and/or some example code please? I'd be really glad to understand.

> I think it's not worth the effort right now, [...] most likely to be trampled and disregarded silently by the vanilla branch

+1, for the silently mainly. But don't get too frustrated, it will make you have heartburns and this is not good :-D, or yes get frustrated, but at least know you're not alone thinking this kind of thing

-----

2 points by tc-rucho 5603 days ago | link

Yes, X.org.

All the drawing is handled externally by... a drawing server which processes drawing requests from Arc. But it's not even in alpha state so I'm not releasing it yet. Also because I'm thinking in trashing it and start from scratch using opengl instead of xdraw and change the way it communicates with Arc.

But I'm too busy at the moment, it will have to be in my next holidays (roughly 4 or 5 months).

-----

1 point by palsecam 5602 days ago | link

Ok thanks for the info. Will `man xdraw'. Client/server is such and old and great idea :-)

-----

2 points by jcw 5604 days ago | link

That's an interesting idea, basing a c implementation of arc off of picolisp.

-----