Arc Forumnew | comments | leaders | submit | aw's commentslogin

The reader is implemented in Arc in the runtime project I'm working on (https://github.com/awwx/ar).

-----

2 points by aw 5442 days ago | link | parent | on: How to interact with a running arc instance?

I wasn't quite able to tell from your description what is the missing piece for you: is it starting Arc inside of screen at server boot time, or restarting Racket/Mzscheme if it crashes?

I think what you want is for server boot to run screen, which runs a shell script that starts/restarts Arc, which writes its pid out to a pidfile. Does that sound about right? Each step in that process is pretty easy.

-----

2 points by aw 5444 days ago | link | parent | on: Multi-arg anonymous functions broken?

I don't use Anarki myself, but figuring this out is easy with git.

Your first step is to find out if this was working earlier in the current branch; that is, did this get broken by a later commit or was it simply never ported to Arc 3.1?

If your find an earlier commit on the branch where it was working, finding out which commit exactly broke is easy: write a small shell script that returns true or false depending on whether the feature is working, and then use git-bisect (http://www.kernel.org/pub/software/scm/git/docs/git-bisect.h...)

Once you've found the commit that broke the feature, you can either look at the change yourself and/or contact the author of the commit.

-----

2 points by aw 5450 days ago | link | parent | on: Tips on implementing arc

There are features that Arc gets for free when implemented on top of Scheme that may be hard on other platforms such as full continuations, tail calls, and the numeric tower e.g. exact rationals. Since you sound like you're interested primarily in a practical system (DirectX game development), you can avoid getting bogged down by not worrying about the features you don't need. (For example, you might choose to have this implementation of Arc only support escape continuations).

To keep the complexity down and the progress encouraging, I find it helpful to work on an implementation as a series of steps instead of doing everything all at once. For example, you might start by implementing just enough of the runtime so that you can load the first form in arc.arc, do. Then implement just enough more so that you can implement safeset, and so on.

-----

2 points by aw 5450 days ago | link | parent | on: `,@'

quasiquote works like a macro (in fact, you can implement it as a macro), and macros expand into a single value. That is, in

   (a b c (foo) d e f)
foo can expand into X or (X Y Z), but it can't splice itself into the surrounding list.

If you extend macros so that they can splice themselves, then you could implement a quasiquote that would be able to do that as well.

-----


To clarify: my comment was about my experiment with having tables print with "{a 1 b 2}":

  arc> (list (obj a 1 b 2))
  ({b 2 a 1})
it was this that I found hard to match key value pairs in a long table output and the curly brackets weren't standing out enough by themselves for me when I was scanning a large amount of debugging output.

For input, when I'm the one doing the typing :) -- and anyway the number of key value pairs is usually small anyway -- I'm all for typing fewer parentheses ^_^

-----

1 point by evanrmurphy 5457 days ago | link

Thanks for clarifying, I was being careless about the distinction.

  {glad-to  'hear
   you-like 'writing
   this-way 'though!}
:P

-----

1 point by aw 5459 days ago | link | parent | on: How to Future-Proof Your Code

What's an "OP"?

-----

1 point by rocketnia 5459 days ago | link

In this context, it means "Original Poster." I've also seen it mean "Original Post," and I've used it that way myself, but I think that's less common.

-----

2 points by aw 5459 days ago | link | parent | on: Say I wanted to use Arc in my Python project

I like this blog post on why to use HTTP by default: http://timothyfitz.wordpress.com/2009/02/12/why-http/ (that is, unless you have some reason why HTTP isn't good enough, use HTTP :)

akkartik mentioned my library to call Python from Arc. Going in the other direction is also easy. To call Arc from Python, have Arc run a web server on a port (say 8080 or 9001 or whatever) that you firewall off so that only your Python program can get to it, and have Arc accept HTTP requests with things to do and have it respond with a JSON response.

-----

2 points by aw 5463 days ago | link | parent | on: Noobing with news.arc

Saying (do.foo ...) instead of (foo ...) just makes it so that 'foo isn't in function position. That means the local variable 'foo will always be used instead of some macro named 'foo that happened to be defined in another library.

I remembered talking about this once and found the comment: http://arclanguage.org/item?id=11697

It looks like it would be an easy change to Arc to have local variables take precedence, though I haven't tried the patch myself.

-----


  ({ a 1  b 2  c 3)
did you mean to have a closing curly bracket here, or is "{" acting like an operator?

-----

1 point by evanrmurphy 5467 days ago | link

I meant to leave it unclosed. Yes, it's acting as an operator - a convenience function for something like obj. (Using the modified reader from http://arclanguage.org/item?id=12866, there's no need to do |{| or anything like that to treat the curly brace as a symbol.)

-----

More