Arc Forumnew | comments | leaders | submitlogin
Arc presentation
11 points by conanite 5748 days ago | 13 comments
As a punishment for talking too much about arc at lunch, I've been asked to make a presentation on lisp/arc at a small conference on agile software development.

The big appeal of arc (and any lisp, I suppose) is that macros can eliminate a lot of duplicate and boilerplate code that java and other popular languages cannot. D.R.Y. (Don't Repeat Yourself) is a big Extreme Programming mantra so I can see there should be plenty to say about macros. In fact it will be a pleasure to take common java idioms and show a concise arc equivalent for comparison.

In the collective opinion and accumulated wisdom of this forum, what other features of arc do you think make it relevant to a community of agile developers?



8 points by CatDancer 5748 days ago | link

The first thing that comes to my mind is more of a philosophy rather than a feature. One of the Agile principles is don't implement things until you need them... no speculative development: the tenth principle down in http://agilemanifesto.org/principles.html reads "Simplicity--the art of maximizing the amount of work not done--is essential." The XP process implements this with its rule that you only write code to implement the current iteration, no writing code to implement features that you "know" will be coming in future iterations.

When I first read the Arc web server code (srv.arc) I was astonished at how simple the code was.

srv.arc doesn't do everything I want, but other web frameworks don't do everything I want either. And I've found it much easier to hack srv.arc to do what I want, precisely because it isn't massively bloated with "framework" stuff, stuff that we imagine we'd need to write a web application, but we don't actually need or it turns out we need in some other way when we actually write an application.

Showing off how easy srv.arc is to hack is a great example of the Agile simplicity principle. Need to get a servlet to output a custom header? Plow through the documentation to find the right addHeader() invocation and what object to call it on. Need to get Arc to output a custom header? (prn "My-header: foo")

-----

1 point by conanite 5747 days ago | link

This is interesting, I had been thinking only of how the core language might appeal to an agile mindset but it's true that the libraries have a lot to offer as well.

-----

9 points by pg 5746 days ago | link

I don't know what exactly agile developers would care about, but the guiding principle of Arc is to make programs short. Partly because that's what programming languages are for, but also because programs are meant to be changed, and shorter programs are easier to change. The latter part sounds like it should be relevant to them.

-----

2 points by conanite 5744 days ago | link

Totally. "Embrace Change" was the mantra of the first book on XP. And to paraphrase "maximizing the amount of work not done" (thanks, CatDancer, for the link) we could say "maximizing the number of lines not written".

The usual techniques for enabling change involve exhaustive tests as well as not implementing stuff that might be unrequired. And DSLs. Hence Ruby gets a lot of attention because it's so easy to build a quick DSL in it. But as you've mentioned elsewhere, a layer of lisp macros in a program is effectively the DSL for that system.

Possibly the advantage of lisp in the context of DSLs is that the use of macros is thoroughly studied, and in a mature lisp the usual editing, debugging and optimization tools are available, whereas a home-made DSL might create as many problems as it solves ( ad-hoc, informally specified, bug-ridden, etc ).

-----

5 points by absz 5748 days ago | link

If you're coming from Java or another such language, then anonymous functions and the REPL are must-shows. The former really makes things far more clear and concise; just compare Arc's

  (let squares (map [* _ _] nums)
    ...)
to Java's

  ArrayList<Integer> squares = new ArrayList<Integer>();
  for (Integer n : nums)
    squares.addObject(n*n)
  ...
. The latter is fantastic for development; rather than having to code up a new test, save, and recompile every time you have something you want to test out, you can iteratively develop your test and run it immediately. This becomes even more of a net win when you realize you need to change that previous test case just a little; instead of open-edit-recompile-run, it's uparrow-edit-run.

If you're instead coming from something more like a scripting language, then yeah---macros and everything they can do is the biggest win.

-----

4 points by conanite 5747 days ago | link

True, [_] is one of those radical shortcuts that improves readability rather than obfuscates. Thank you.

As for up-arrow, I get "^[[A", so I haven't enjoyed the REPL as much as I ought to. I'm on a mac. Does anyone know a way to fix this?

-----

5 points by absz 5747 days ago | link

I'm on a Mac too; the trick is that you need mzscheme's readline library. In your ~/.arcshrc, put the line

  ($ (dynamic-require '(lib "rep.ss" "readline") (zero? 1)))
, and then you should have no problem.

(As a side note, you need to use (zero? 1) instead of #f because Arc turns #f into nil.)

-----

4 points by projectileboy 5748 days ago | link

Hey, I actually did a presentation on Arc for a weekend gathering in Minneapolis. It may or may not present things the way you're thinking, but you're welcome to lift whatever you'd like, if it would be helpful:

http://www.bitbakery.com/The_Arc_Programming_Language.ppt

It starts by just showing the same nuts and bolts stuff as PG's Arc tutorial, but then I elaborated on creating macros for creating objects and classes, which I thought would resonate with the target audience.

(Forgive the weird formatting; it's a Powerpoint export from Google Presentations.)

-----

2 points by conanite 5747 days ago | link

Thanks, this is an awesome presentation. I will definitely be stealing liberally from it if I do this.

(btw I uploaded back into google, I don't have ppt installed, it looks fine)

-----

1 point by drcode 5746 days ago | link

Do you live in MN? (I'm visiting there beginning of March...)

-----

1 point by projectileboy 5744 days ago | link

Yeah! See my profile for more info.

-----

1 point by justgord 5713 days ago | link

Ive been using arc for a while, but some things were made clearer by this presentation.

Any chance you'll put it up on a blog/website? [so it would come up when googled]

One reason I ask, is I noticed my Linux box go CPU bound when loading that ppt in OO.org [hardly your fault I know]

-----

1 point by lboard 5748 days ago | link

creating a DSL, bending language to the Problem domain.

-----