Arc Forumnew | comments | leaders | submitlogin
Show and Tell:
15 points by antiismist 4686 days ago | 10 comments
So here is my arc-based site:

A while back I made, which was sort of a reddit for sports. I found out that it is hard to get people to submit sports stories. So I redid it as a Drudge Report for sports news.

Behind the scenes, the site checks ~100 sports feeds, and using classifier.arc and some other things, puts it into a league and judges the story for interestingness. Interesting and timely sports stories are put on the page, sorted by league (or by topic if the topic overwhelms the league, e.g. the Brett Favre unretirement or A-Rod divorce stories).

Anyway, let me know what you think!

PS: I know that it doesn't display quite right in IE - I'm working on that..

5 points by jmatt 4685 days ago | link

I enjoy seeing real examples of arc. From my experience much more can be learned from creating live applications compared with writing interesting bits of code.

I find the language discussion interesting, don't get me wrong. Some of the discussions have actually been useful. But in the end most languages are steered by "real projects" as stefano has put it. The top real world apps that I can think of are and I'd expect PG's and antiismist's experiences with these first real world application to effect arc as much as or more than Anarki code base. Even though there has been a lot more time and effort that has gone into Anarki.

[edited: more]


2 points by stefano 4685 days ago | link

It's nice to see someone using Arc to do some real world projects.


2 points by bOR_ 4685 days ago | link

Although just from the website it is a bit hard to see how arc is being used. Perhaps if something interesting during building the site was encountered, this could be shared?


11 points by antiismist 4685 days ago | link

Sure, I can share some things I've learned. The caveat of course is that I am no elite hacker, so some of this is going to be obvious or not really correct...

- macros: In news.arc, they are all over the place. So I tried to code in a similar style, but it turns out that if something can be done via a macro vs being done with a function, then it is more natural for me to use a function. I work a lot with the REPL, and it turns out to be really annoying to change a macro, and then I have to track down all the places that use that macro, and "refresh" them to use the new macro. Especially with macros that call macros that call macros, and I change the macro at the end of the chain. Whereas with a function, I just have to paste in the new function and it takes effect right away.

- news.arc stores posts in a hash table. I started off modeling ballerinc that way. But as time goes on, I am starting to move things over to plain old lists. Basically, working with a hash table pushes me into code that uses side effects to get things done, like using each. Whereas with lists, the code is usually cleaner and shorter.

- repl: using the repl on the running web server is pretty amazing. Already I have pushed changes directly to the live site. For ballerinc restarting the server takes about 10 minutes, so this has been a life saver. I don't worry about "releases" at all anymore - just make the feature, test it, and deploy it.

- the codebase is about 386 LOC. For the past week I've been adding features and doing code cleanup, and the LOC keeps going down.


1 point by skenney26 4684 days ago | link

Any advice related to setting up and running your web server would be highly appreciated. I recently got a hosting account and was stuck trying to figure out how to keep the server running after logging out of ssh. Also, have you had any security concerns while developing your applications?


3 points by antiismist 4684 days ago | link

I use the screen utility. Basically, I always have screen running, and the repl / vim running. With the repl running in screen you can detach via control-a d, and then log off, and the repl keeps on running. Then you ssh back in, and can reattach via screen -dr.

I haven't had any security concerns - I have a couple admin pages but of course one has to be an admin to see them.


2 points by zitterbewegung 4685 days ago | link

How do you parse the rss feeds?


2 points by antiismist 4685 days ago | link

That part is a big hack...I have a ruby script that generates an s-expr of the feed, and work from that:

       (each i (read (tostring (system (string "ruby bench.rb " r!url))))
           (add-post (alref i 'title) (alref i 'link) r!league))


2 points by zitterbewegung 4684 days ago | link

There is a function (xml->xexpr) in PLT scheme which could also generate an s-expr of the rss feed.


1 point by antiismist 4684 days ago | link

I had trouble figuring it out ...

If you had a URL for an RSS feed, how would you get an s-expr containing all the links and titles in the items?