Arc Forumnew | comments | leaders | submit | elibarzilay's commentslogin
6 points by elibarzilay 6317 days ago | link | parent | on: let and with

Easy to check yourself -- try this:

  (with (x 1 y 2) (with (x y y x) (list x y)))

-----

3 points by chaos 6316 days ago | link

There is also withs:

    (withs (x 1 y 2) (withs (x y y x) (list x y)))

-----

3 points by elibarzilay 6317 days ago | link | parent | on: let and with

If you mean a single form, then that won't work, because arc destructures values. For example:

  (let (x y) (list 1 2) (+ x y))

-----

3 points by elibarzilay 6317 days ago | link | parent | on: Arc, a Comedy of Errors: Part I

You can also evaluate #f and get MzScheme's #f.

But that shouldn't matter, since they all behave in the same way as booleans. (Try to use each one in an `if' and see that it works.)

-----

1 point by ehird 6317 days ago | link

Does that make a difference? For a start, if () evaluates to anything it should evaluate to itself (I don't think we have any disagreement here), and 'x should certainly be x. Now, this implies that when you put a quote before (), it's read in as a different object. This is obviously nonsense: it's the Arc evaluator's `quote' that does this, as a way to work around the underlying Scheme. But missing that () by itself would evaluate to the underlying Scheme's () is just shoddy.

Paul Graham, you had years to do this. Why did you have to make something so incomplete and hacky? I didn't even expect Jesus, like most people - I thought it would be nothing too great. But this is just ridiculous.

-----

5 points by pg 6317 days ago | link

This is a trivial sort of ridiculous, though. Nil and the empty list are logically undistinguishable.

The reason I made something so incomplete in superficial respects like this is that I focused instead on things that mattered. Particularly, making programs shorter-- which I deliberately phrase in that low-key way, but which is in fact pretty near identical with what programming languages are for. In that respect Arc seems from my experience to be significantly better than CL or Scheme.

-----

1 point by kennytilton 6317 days ago | link

The funny thing is that just as you did this with Arc I have been trying to push somethinganything out the door on my own product (it too is pretty far along, it too has a ways to go) just to motivate me with user feedback. Seriously reconsidering...

-----

1 point by ehird 6317 days ago | link

I think your focus entirely on shortness is a bit misguided. If that's your goal, you should give up and just use Perl or similar. But of course that isn't you're entire goal, so you're being (unintentionally) misleading. I'm sure a goal isn't inconsistency like this.

-----

7 points by pg 6317 days ago | link

Perl programs for doing common things to strings are short in characters. They're not so short in tokens. But more importantly, Perl doesn't have the kind of brevity you can get from having macros.

-----

2 points by elibarzilay 6317 days ago | link | parent | on: Regular expressions

No, but it will be easy to add it.

-----

1 point by elibarzilay 6317 days ago | link | parent | on: Profiling?

MzScheme has a better profiling facility (the errortrace collection), but using it without source information is not too helpful. It is possible to do that (and I have a patch that does it), but it's not a quick solution.

-----


This cannot be done in a quick patch. If you want mutation in 3.99, you have to use mpairs -- but then you run against rest arguments being the usual immutable pairs.

-----


It will need much, much more than just an FFI to compile itself.

-----

2 points by elibarzilay 6317 days ago | link | parent | on: Why Arc? Why MzScheme?

Arc is more than a "skin" -- it is a different language, which is compiled to mzscheme.

-----

8 points by pg 6317 days ago | link

Yes. Architecturally Arc is like a skin on MzScheme, in the sense that we made MzScheme do as much of the work as we could. Semantically it's not especially like Scheme.

So you should just judge Arc for itself. Its main disadvantages over other Lisp dialects are that it's slow and lacks libraries. Its main advantage is that programs come out shorter.

-----

1 point by sarosh 6317 days ago | link

Not sure if this is the proper thread for you to address this, but I'm curious as to whether you think there would be in value to something like Arc -> C/Java/? for libraries/frameworks/speed

(which would (theoretically) be just a kludge/hack on Bigloo http://www-sop.inria.fr/mimosa/fp/Bigloo/)

-----

4 points by Zak 6317 days ago | link

RTFAQ: http://paulgraham.com/arcfaq.html

Arc is intended to not be attached to any other language or VM. That's not to say you couldn't implement your own Arc runtime on top of a language of your choice. In fact, since there are already Schemes that run on top of both C and Java, you could do so simply by porting the Scheme parts to an appropriate Scheme. It's under 1000 lines of Scheme.

-----

2 points by sarosh 6316 days ago | link

Thanks for the heads up (didn't know about the FAQ). The porting of the relevant Scheme option seems interesting; I'll have to check it out

-----


Jacob, your patch is too intrusive, there is a much easier way to fix this bug. I'll do that in a new message.

Also, you've replaced the `all' definition by the built in `andmap', but that is actually slower.

-----

5 points by elibarzilay 6317 days ago | link

For some reason I don't see the other post in the forum, so I'll repeat it here:

The arc compiler plants many `'nil's to avoid empty bodies. This patch avoids this, and this solves the problem with 372.

Get it at http://tmp.barzilay.org/arc-patch

-----