Arc Forumnew | comments | leaders | submit | lojic's commentslogin
3 points by lojic 6663 days ago | link | parent | on: ~Tilde and macros

Are you sure the simple def fixes it?

  arc> (def litmatch1 litmatch)
  #<procedure: litmatch1>
  arc> (litmatch1 "b" "brian")
  nil
  arc> (~litmatch1 "b" "brian")
  t
  arc> (~litmatch1 "z" "brian")
  t

-----

6 points by lojic 6664 days ago | link | parent | on: Arc Cluster Implications

Here's an Apache virtual host config that allows Apache to sit in front of an Arc web server via mod_proxy_balancer. I just took my typical Rails config and tweaked it slightly. You need to have the mod_proxy_balancer module loaded.

I've setup a pseudo IP of 10.0.0.71 and put www.lojic.com in my /etc/hosts file with that IP for testing. I'll try 2 Arc processes with sticky sessions later, but for one server the following works fine. If you don't have a bunch of other virtual hosts active, you could probably just use 127.0.0.1 w/o setting up the pseudo IP.

Having Apache sit in front of the Arc server allows using SSL easily, serving up static files directly for extra speed, etc.

  <VirtualHost 10.0.0.71:80>
    ServerName www.lojic.com
    ServerAlias lojic.com
    DocumentRoot /home/brian/software/arc/arc2

    <Directory /home/brian/software/arc/arc2 >
      Options FollowSymLinks
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>

    # Configure cluster
    <Proxy balancer://lojic_cluster>
      BalancerMember http://127.0.0.1:8080
    </Proxy>

    RewriteEngine On

    # Prevent access to .svn directories
    RewriteRule ^(.*/)?\.svn/ - [F,L]
    ErrorDocument 403 "Access Forbidden"

    # Redirect all non-static requests to cluster
    RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
    RewriteRule ^/(.*)$ balancer://lojic_cluster%{REQUEST_URI} [P,QSA,L]

    # Deflate
    AddOutputFilterByType DEFLATE text/html text/plain text/xml
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

    ErrorLog logs/www.lojic.com-error_log
    CustomLog logs/www.lojic.com-access_log combined
  </VirtualHost>

-----

4 points by lojic 6664 days ago | link | parent | on: Arc omptimization, again

Are you actually experiencing a problem now, or just anticipating one? I currently program primarily in Ruby which is one of the slower languages around, and I've yet to max out a CPU with a web app, and I simply wouldn't use Ruby for serious number crunching.

Maybe my view is a naive one, but I feel that if Arc is successful, the effort to improve performance will be made.

On the other hand, it is a bit strange to see the docstring repeated like that.

-----

1 point by sacado 6663 days ago | link

Well, that's actually what kept me from Ruby and made me stick with Python for a while. I needed a little speed. Not that much, but Ruby was just below the barrier.

-----

14 points by lojic 6664 days ago | link | parent | on: Arc2.tar

Does this mean you'll be accepting patches for cool new features for News.YC? :)

-----

7 points by lojic 6664 days ago | link | parent | on: Arc2.tar

Not to beat a dead horse ( http://arclanguage.com/item?id=3351 ), but what platform are you developing Arc on? 'date -u -r' doesn't work on Linux or OS X, so we have to keep patching arc.arc with each new release.

edit: I looked at the patch more carefully and it looks like BSD accepts -r, so the next question is, would you mind adding some platform dependent conditionals?

-----

4 points by pg 6664 days ago | link

I develop on OSX but the code runs on FreeBSD on the News.YC server.

-----

2 points by lojic 6664 days ago | link

I guess I'm confused then. Does the date function in arc.arc work for you on OSX?

-----

3 points by lojic 6664 days ago | link

My bad. In my haste, I simply ssh'd to my Mac and issued 'date -u -r' and didn't take the time to see that it was simply complaining about the fact that I didn't provide an argument for -r. So, I guess it's a problem for Linux, and not for OSX.

-----

3 points by cooldude127 6664 days ago | link

works for me on OS X. both the anarki and the vanilla arc2 date functions produce the same result.

-----

2 points by tjr 6664 days ago | link

Works for me on OS X as well.

-----

3 points by nex3 6664 days ago | link

Anarki should work fine on all Unixes (or at least Linux and BSD-based ones) and maybe Windows.

-----

1 point by lojic 6664 days ago | link

I'd like to stick to the canonical source for a while before I consider forks.

-----

3 points by mst 6664 days ago | link

anarki isn't really a fork any more than -ac is a linux fork.

Nor any less, I suppose.

Draw your own conclusions.

-----

7 points by lojic 6665 days ago | link | parent | on: arc-mode.el for emacs

From what I've read, pg uses vi, so I expect he's developed a filetype for Arc. I was actually a heavy vim user for a couple years, but recently switched to Emacs in part because of the Lisp support. I was back to my vim productivity level in about 3 days, so maybe you could give it a shot :)

-----

4 points by lojic 6665 days ago | link | parent | on: Does Arc need modules? Maybe not.

This may be related to #2, but I find modules/classes, very helpful in finding functionality. Someone just asked on IRC if there is a function to determine if a file exists. In Ruby, I would expect to find such a function in the File class, and sure enough, there is a File.exist? function.

This can be done in other ways such as partitioning functionality into files (if the code is the spec/doc), or organizing documentation in certain ways, but it's been my experience that a module/class system makes finding functions easier.

-----


Let's stay focused here people. Who's going to be the first to produce an Arc version shorter/nicer than the Ruby version? :)

-----

4 points by kennytilton 6665 days ago | link

Word. But I guess without built-in pattern matching or regex yer just gonna be translating Norvig's 150-line version. Fewer chars (esp. parens) but not much else.

-----

1 point by lojic 6665 days ago | link | parent | on: Automatic .arc reloading in background

How about parameterizing csv with the sleep value ?

-----

1 point by lojic 6665 days ago | link | parent | on: Community wiki

In the short term, a search feature for the forum might do the trick. I keep resorting to Google to find old threads which is less than ideal.

But in the long term, I agree that something like a wiki would be quite valuable. We shouldn't have to keep searching for old items. If pg did it as part of the site, maybe editing could be granted with a minimum point threshold to provide some level of protection from spam/graffiti. Plus pg, rm, etc. could exercise more control over some of the core info.

And I agree that doing it in Arc, while unnecessary, would be valuable in putting more pressure on the language.

-----

More