Arc Forumnew | comments | leaders | submitlogin
Arc2.tar
65 points by pg 6146 days ago | 47 comments
There's a new version at http://ycombinator.com/arc/arc2.tar

The biggest diff in this release is that it includes the source of News.YC. All you have to do to run it is type (nsv) at the Arc prompt, then go to http://localhost:8080.

Another pleasing thing in this release is the ability to say (only.foo (bar)) instead of (aif (bar) (foo it)).

I fixed a bunch of bugs found by users of this forum. Thanks, and please let me know about any new ones you discover.



7 points by lojic 6146 days ago | link

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 6146 days ago | link

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

-----

2 points by lojic 6146 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 6146 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 6146 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 6146 days ago | link

Works for me on OS X as well.

-----

3 points by nex3 6146 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 6146 days ago | link

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

-----

3 points by mst 6146 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.

-----

8 points by CatDancer 6146 days ago | link

Very cool!

Speaking of bugs, there's the bug that atomic stops being atomic if its thunk throws an error: http://arclanguage.org/item?id=2740

The comment in ac.scm says "maybe it doesn't matter since the thread will die?", but the error can be caught (or ignored with errsafe), so this is a serious bug that will bite.

Several people have fixed date to work on more operating systems, I believe the simplest version I've seen is the one I wrote: http://arclanguage.org/item?id=2652

-----

14 points by lojic 6146 days ago | link

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

-----

6 points by byronsalty 6146 days ago | link

PG: I urge you to look at the rootdir* (docroot) that was added to srv.arc. Adding this in would allow you move the gifs you need out of the base directory for arc. This was added previously and allowed me to easily move the news gifs into arc/news_public_html and serve them from there.

-----

3 points by pg 6145 days ago | link

I just arranged for static files to be read from a separate dir; it will go out in the next release.

-----

3 points by lojic 6109 days ago | link

Can you allow paths also?

http://arclanguage.com/item?id=5599

-----

9 points by immad 6146 days ago | link

pg: might want to update http://arclanguage.org/install with the new version.

-----

3 points by pg 6145 days ago | link

oops, fixed

-----

5 points by pg 6143 days ago | link

BTW, just noticed a bug: hours-since should be called minutes-since. Fix in next rel.

-----

3 points by byronsalty 6146 days ago | link

PG: I removed "news.arc" from the "libs.arc". Besides probably unnecessary for most users, this was overwriting the || op which was effecting the "It's Alive" op that used to be there.

-----

2 points by kens 6144 days ago | link

It looks like "on" is broken for tables. I'd expect "on" to get the values, like "each", rather than nil.

  arc> (each x (obj k1 'v1 k2 'v2) (prn x))
  v1
  v2

  arc> (on x (obj k1 'v1 k2 'v2) (prn index " " x))
  0 nil
  1 nil

-----

1 point by Jesin 6115 days ago | link

I think that's because on works like this:

  (for index 0 (- len.foo 1) ...)
Because the hash table you used didn't have any entries for 0 or 1, it gave nil.

  arc> (= a (table))
  #hash()
  arc> a!foo
  nil
  arc> (= a!foo 'bar)
  bar
  arc> a!foo
  bar
  arc> a.0
  nil

-----

3 points by mattjones 6146 days ago | link

This is really great stuff. Although I haven't done any serious Arc hacking yet, it's already had a big impact on how I code in Ruby. news.arc will be a great source of ideas.

BTW, does anyone have any deployments planned? Does it make sense to deploy production sites using news.arc, or is keeping up with Arc's evolution at this stage too much of a challenge?

I imagine it would be OK if you don't need to keep up with changes.

-----

5 points by cooldude127 6146 days ago | link

well considering the real live sites arclanguage.org and hacker news are deployed with news.arc, i would say you can deploy a real live site with it.

-----

3 points by mattjones 6146 days ago | link

It's more a question of the stability of the language specification. I don't doubt the code is solid enough for production sites; it's just that keeping up with Arc's evolution might be difficult. But as I pointed out, you might not need to do that. (I edited the original comment to be more clear.)

-----

9 points by zitterbewegung 6146 days ago | link

Does this version still require PLT scheme v352?

-----

4 points by pg 6145 days ago | link

We're still using 352, yes, but it may work on later versions.

-----

1 point by Jesin 6122 days ago | link

I'm using mzscheme 360, and it seems to work for me.

-----

2 points by kostas 6146 days ago | link

The install page http://arclanguage.org/install still refers to arc1.tar

-----

1 point by cooldude127 6146 days ago | link

how soon will this be on anarki? would do it myself, but i'm pretty sure i'd mess something up.

-----

10 points by nex3 6146 days ago | link

I'm about to start merging.

-----

7 points by nex3 6146 days ago | link

Alright, all done. If someone (bsalty?) could look at srv.arc, that would be great.

-----

2 points by byronsalty 6146 days ago | link

will do

-----

1 point by cooldude127 6146 days ago | link

now master needs some love

-----

1 point by cooldude127 6146 days ago | link

awesome!

-----

1 point by Keyframe 6146 days ago | link

arc> (nsv) The syntax of the command is incorrect. The syntax of the command is incorrect. The syntax of the command is incorrect. The syntax of the command is incorrect. The syntax of the command is incorrect. load items: Error: "directory-list: could not open \"D:\\Projects\\lisp\\arc\\ar c2\\arc/news/story/\""

nice.

-----

2 points by mec 6146 days ago | link

Same thing here, using windows:

  arc> (nsv)
  The syntax of the command is incorrect.
  The syntax of the command is incorrect.
  The syntax of the command is incorrect.
  The syntax of the command is incorrect.
  The syntax of the command is incorrect.
  load items: Error: "directory-list: could not open \"G:\\MzScheme\\arc2\\arc/news/story/\""
  arc>

-----

2 points by nex3 6146 days ago | link

I believe Anarki works on Windows, although I wouldn't swear to it. If it doesn't, patches would be appreciated.

-----

2 points by mec 6146 days ago | link

Forgive my newbness but I've not used git before and don't really have a clue where to start. I did read that you can connect to git repos with other clients (I currently have TortoiseSVN installed) and would love to know how to do that as it would probably be the easier than setting up cygwin and figuring out git. Any help would be appreciated.

-----

3 points by nex3 6146 days ago | link

I think Cygwin is the official way to use Git on Windows, but there's a MinGW that seems to be very functional (http://code.google.com/p/msysgit/downloads/list).

Once you've got one of those installed, the basic workflow I talked about at http://arclanguage.org/item?id=1387 should work fine.

-----

3 points by raymyers 6146 days ago | link

I would encourage you to go ahead and try using git. However, here's a current snapshot of Anarki you can play with.

http://cadrlife.com/arc/arc-wiki.tar.gz

-----

2 points by sjs 6146 days ago | link

You can use git as a frontend to an svn repo but I haven't heard about doing it the other way. Because git is a superset of svn it may be possible but a quick search turns up nothing. Setting up cygwin is a snap. I am still a git noob. After an hour or two of reading you'll be able to use the git basics and after a few hours more reading you'll be able to use the basics and actually know wtf is going on underneath.

http://robsanheim.com/2008/02/22/learn-git-10-different-ways...

-----

1 point by czoon 6140 days ago | link

is there any solution for this? . . The syntax of the command is incorrect. load items: Error: "directory-list: could not open \"G:\\MzScheme\\arc2\\arc/news/story/\""

-----

1 point by eds 6140 days ago | link

Yes, the Anarki git repo has a fix for this.

http://arclanguage.org/item?id=3647

There is also Anarki Stable which consists of only arc2 and bug fixes.

http://arclanguage.org/item?id=3849

-----

1 point by czoon 6140 days ago | link

thanks i ll try

-----

1 point by czoon 6132 days ago | link

from http://jfkbits.blogspot.com/2008/01/digging-into-arc-in-24-m...

(xdef 'mkdir (lambda (path) (make-directory path))) redefine mkdir. its solves problem.

-----

1 point by kajecounterhack 6146 days ago | link

Thanks Paul, I'll be checking this out as soon as I get my BSD running...

-----

1 point by krunalsagathiya 5739 days ago | link

hi if any buddy know how to work with arc2? i am really find diffucult to work with ARC2? i dont know how to use thanks

-----

2 points by thaddeus 5739 days ago | link

What is it, about arc2, that you're having difficulty with?

-----