bayareaguy


6 points by bayareaguy over 2 years ago | link | top
cached 10 days ago
Arc seems to embody the idea that "Language design is library design, and vice-versa", but how can we tell where the boundry is?

When I look at something like

  (defop said req
    (aform [w/link (pr "you said: " (arg _ "foo"))
           (pr "click here")]
      (input "foo") 
      (submit)))
what I see is more or less ordinary lisp that uses a library to solve an issue with applications that rely on http. I'm sure plenty of us could do the equivalent with the appropriate Python/Perl/Php/Ruby library, but then the obvious criticism would be that you're not really comparing lanugages. You would be comparing libraries.

Plenty of examples here: http://arclanguage.com/item?id=722

Is it really the case that when you boil it down, Arc (language+libraries) is about making small web programs? If not, why this challenge and if so I suspect it won't live up to the 100-year idea.


5 points by bayareaguy over 2 years ago | link
cached 6 days ago

4 points by bayareaguy over 2 years ago | link | top
cached 9 days ago
I can sympathize with you somewhat. I like lisp but I'm not a deep lisper. Personally I'd would like it more if it could play nice with Python modules. But that sort of thing is not where the real Arc "action" is at the moment.

Arc takes lisp in a new direction. The right thing to be doing now is not to get buried in details like foreign function interfaces but instead to see where pg's ideas lead. From what I can tell he's doing the same sort of thing Roger Hui and Arthur Whitney did when they took APL in the direction of J and Kx respectively - they let go of a few old things in order to make new ideas fit in better.

The theme of this party is succinctness. Let's all see how well that works out. How low can you go?


4 points by bayareaguy over 2 years ago | link | parent | top
cached 9 days ago
This is the common sh shell idiom to properly pass the original command line to the program being invoked.

"$0" expands to the program name ("ar.sh" in his example).

${1+"$@"} is conditional:

if $1 (the first positional parameter) is unset it expands to nothing.

however if $1 is set, it expands to "$@", which in turn expands to all the parameters, each one quoted as a separate word.


4 points by bayareaguy over 2 years ago | link | parent | top
cached 7 days ago
In Arc (and most other functional languages), you generally solve your problem by specifying how to transform some input into some output. It should be no suprise to anyone here that this is a great fit for the most visible aspects of Web programming.

In OOP you instead solve your problem by trying to neatly partition it into lots of little bits of state and specifying how each little bit reacts to changes. As the comment explains, OOP programs are often clumsier than functional ones because OOP enshrines scaffolding in the form of the class hierarchy and method/message dispatch model.

So when is OOP a good idea?

I tend to think that it boils down to the size and organization of your team, the number of independent "architects" in your system and how they are managed.

In a small team this should not be an issue and you're probably better off with a functional approach and perhaps rolling your own messaging scheme like the one in the article if you think you need one.

However in a large team you not only have to deal with whatever problem you're working on, you also have to deal with the secondary problems of how the developers interact with each other. The OOP scaffolding pg makes fun of is one way to make managing a larger team easier since it helps the developers play nicely, stick to their little part of the system and stay out of each others way. It's not the only way, but it is relatively popular in part because it allows some management decisions to be directly expressed in the class hierarchy and programming language.

Right now Arc doesn't look like a language for big teams, but perhaps with a good module system that could change.


4 points by bayareaguy over 2 years ago | link | parent | top
cached 7 days ago
I think pg agrees with you in http://paulgraham.com/noop.html when he writes:

5. Object-oriented abstractions map neatly onto the domains of certain specific kinds of programs, like simulations and CAD systems.

Also for things like instance creation and method dispatch, OO languages can easily be both faster and more concise than functional languages. In a performance-sensitive setting like a desktop gui or a window system this can easily decide the issue.

But while simulation and OOP do have an important historic relationship, I don't believe you actually gain any special modeling expressiveness by making your objects adhere to a "class" framework. What's worse, the hardcoded assumptions OO languages make about classes and methods can confuse the assumptions in a simulation (e.g. because you can implement an "IS-A" relationship with inheritance doesn't mean you should).

If you want objects in a functional setting, you can just create the appropriate "factory" functions and have those functions return "objects" (i.e. functions with state in closures) which dispatch "methods" however you want them to, just like Jim Rankin did in the article at the top of the thread.

Personally I prefer the approach in SICP ( http://mitpress.mit.edu/sicp/full-text/book/book-Z-H-19.html... ).


4 points by bayareaguy over 2 years ago | link | top
cached 7 days ago
Do any lisp systems handle seralizing closures?

3 points by bayareaguy over 2 years ago | link | top
cached 6 days ago
It looks like you need to manually create arc/posts too.

3 points by bayareaguy over 2 years ago | link
cached 5 days ago

2 points by bayareaguy over 2 years ago | link | parent | top
cached 23 days ago
Something doesn't look right here. I think I know what you're trying to propose but if

    foo:
        bar
        baz
is the same as

    foo bar baz
and

    if (predicate):
        (then-instr)
        (else-instr)
is the same as

    if (predicate) (then-instr) (else-instr)
then shouldn't the second example

    + 1:
        * x x
        * y y
be the same as

    + 1 * x x * y y
?

Or alternately if the indented lines gain implicit parens shouldn't

     foo:
        bar
        baz
be the same as

    foo (bar) (baz)

?