Arc Forumnew | comments | leaders | submit | sacado's commentslogin
3 points by sacado 6164 days ago | link | parent | on: What's next?

higher level decisions are pg's part : http://arclanguage.org/item?id=1469

-----

2 points by applepie 6163 days ago | link

Well, this is not a game where we have to follow rules.

This is real life, so if we can make a better language, we don't have to wait pg to come. (And I've lost the hope he does).

-----

2 points by almkglor 6163 days ago | link

Anarki! Anarki! Go go Anarki!

-----

3 points by stefano 6164 days ago | link

Look at the link date...

-----


There are bugs in the implementation of hash tables, he confirmed this. Don't try them with strings as keys for example (I mean, strings you modify).

-----

2 points by sacado 6180 days ago | link | parent | on: rainbow update

Yep. A java interface would give access to so many libraries that it would solve a lot of problems as for arc's lack of popularity...

-----

2 points by conanite 6178 days ago | link

working on it. Are there any libraries you're thinking of using already?

-----

2 points by stefano 6178 days ago | link

Being able to access graphic libraries would be great.

-----


See the reddit discussion too : http://reddit.com/r/programming/info/6jgnp/comments/

-----

3 points by sacado 6183 days ago | link | parent | on: Why Arc is bad for exploratory programming

Kens is rather dishonnest there. There have been improvements in Arc's performances (including a few experimental ones with the 'compile keyword I added a few times ago) and accessing libraries is rather easy through mzscheme or the experimental FFI (it has to be improved, sure, but it's not that hard if someone wants to). The curently-developed arc2c should solve a good part of these problems, too.

Besides, Arc is too young to have lots of libraries programed in itself, but they're coming. What if, in 1991 (the year Python was released) someone said "Python is bad for exploratory programing : it does not have libraries" ?

-----

5 points by stefano 6183 days ago | link

You're right: Arc is just too young to have a huge (or even a medium sized) collection of libraries, because it takes a lot of time to write libraries to fetch web pages (BTW, look at http-get on Anarki), manipulate images and so on. We should talk about Arc in terms of what it will be able to become, not in terms of what it is today. In this view, the only real problem is the lack of a module system to support the construction of libraries.

-----

4 points by bOR_ 6183 days ago | link

He makes an important distinction in two kinds of exploratory programming, and just sort of is unlucky that he needs the second kind (whereas I'm happy, as I need the first kind)

  I think there are two different kinds of exploratory
  programming. The first I'll call the "Lisp model", where 
  you are building a system from scratch, without external 
  dependencies. The second, which I believe is much more 
  common, is the "Perl/Python model", where you are 
  interacting with existing systems and building on previous 
  work.

-----

1 point by almkglor 6182 days ago | link

> accessing libraries is rather easy through mzscheme or the experimental FFI (it has to be improved, sure, but it's not that hard if someone wants to)

1. it has to be improved

2. if someone wants to

^^

-----

1 point by sacado 6183 days ago | link | parent | on: New types in Arc?

Actually, you could probably do that (if you really want to) by overriding the 'annotate function and using a 'locked* list, so that you can only annotate an object with a type name that is not already in the locked* list :

  (redef annotate (type obj)
    (if (mem type locked*)
      (err "This type is locked")
      (old type obj)))
Here, 'old is a "keyword" of 'redef that calls the old version of 'annotate (the unprotected one, that cannot be accessed from outside anymore).

-----

2 points by almkglor 6182 days ago | link

And how do you unlock it for the constructors that are supposed to do the proper locking?

Hmm.

  (let real-annotate annotate
    (def theorem (f)
      (if (check-f-is-valid-theorem f)
          (real-annotate 'theorem f)
          (err "Not a valid theorem")))
    (= annotate 
       (fn (type obj)
         (if (is type 'theorem)
             (err "Spank!  Spank!  Under the boots of your master!!")
             (real-annotate tpye obj)))))
It does have the drawback that you can't, say, reload the file, but hey, you did say you didn't want anyone else to create theorems except by that method, so even redefining that method won't work!

-----

2 points by almkglor 6182 days ago | link

Okay, here's a better way of presenting it:

  (def-B&D-type theorem create-theorem (f)
    (if (check-f-is-valid-theorem f)
        (annotate 'theorem f)
        (err "Not a valid theorem")))
Where def-B&D-type is:

  (mac def-B&D-type (type constructor . body)
    (w/uniq real-annotate
      `(let ,real-annotate annotate
         (let annotate ,real-annotate
           (def ,constructor ,@body))
         (= annotate
            (fn (type obj)
              (if (is type ',type)
                  (err "Spank!  Spank!  Under the boots of your master!!")
                  (,real-annotate type obj)))))))
Note however that even under this, it's still possible to redefine 'check-f-is-valid-theorem.

For that matter, it's still possible to defeat "safety" in language X: just implement a version of language X which doesn't have that safety.

In practice, nobody will bother to do (annotate 'foo something-which-is-not-a-foo) anyway.

-----

1 point by thefifthman 6183 days ago | link

That sounds exactly like what I need. Thanks a lot!

-----

1 point by sacado 6183 days ago | link | parent | on: Arc3.tar

That's a good idea, and I think that will eventually be how it will work. But I think it's too early for that : obviously, he wants to completely design & implement the core functions (alone) before working (and let other work) on libraries.

-----

9 points by sacado 6183 days ago | link | parent | on: Arc3.tar

Maybe you should send him an e-mail and ask him explicitly. He doesn't seem to come here these days anyway... I hope that's not because he's horrified by what we did to his baby :)

-----

1 point by almkglor 6183 days ago | link

I'm a baby eater!!! Wahahahahahahahaha!!!!! Phear m3 & my 1337 Baby-eatxor skillz!!!!!!1

-----

3 points by sacado 6183 days ago | link | parent | on: Printing squares

I'd rather see some ssyntax here, e.g. expanding 1..5 to (range 1 5). Well, that's a matter of taste, but I don't really like the (1 5) approach, and the ssyntax version looks more usual and more explicit (it looks like what you find in others languages).

Anyway, for your solution, you have to hack ar-apply or ar-funcall if I remember well. That's where ac.scm is dispatching between real functions and collection accesses.

Anyway, on Anarki 'defcall should do it :

  (defcall int (a b) (range a b))
  (1 5)
  ==> (1 2 3 4 5)

-----

7 points by absz 6183 days ago | link

On Anarki, you can add the ssyntax:

  (add-ssyntax-top
    ".." (range L r))
Then you have

  arc> 1..10
  (1 2 3 4 5 6 7 8 9 10)
.

EDIT: Actually, it's slightly nicer to do

  (add-ssyntax-top
    ".." (range ...))
so that you can then specify the step size:

  arc> 1..10
  (1 2 3 4 5 6 7 8 9 10)
  arc> 1..10..2
  (1 3 5 7 9)

.

-----

1 point by almkglor 6182 days ago | link

As an aside, this appears to be popular, it might be possible to add this to the ssyntax extension.

As an aside, I suspect that much of the slowdown from the new ssyntax/ssexpand comes from scheme-side 'ac emitting a lot of 'ar-eval calls, but I'm not sure, since I haven't studied 'ac output much yet.

-----

1 point by almkglor 6183 days ago | link

Where'd you implement 'add-ssyntax-top ? I can't seem to find it anywhere in Anarki.

-----

1 point by absz 6183 days ago | link

Whoops, forgot about that. It's just a thin wrapper around a-ssyntax-top:

  (mac add-ssyntax-top body
    `(a-ssyntax-top ',(pair body [list (string _1) _2])))
. It's just quoting and pairing things. It'd be nice to have a-ssyntax-bottom, too...

-----

1 point by almkglor 6182 days ago | link

I suggest you push this onto Anarki (and possibly implement a-ssyntax-bottom). ^^

-----

1 point by absz 6182 days ago | link

I will do so soon, and hopefully when I get a chance to study ssyntax.arc a little more, I will add a-ssyntax-bottom.

What might be nice would be to have numerical precedence levels (reals, not integers), so that you could add an operator later with the right precedence without redefining everything.

-----

1 point by sacado 6183 days ago | link

Oh, great, I forgot this one...

-----

1 point by absz 6183 days ago | link

I'm not sure what you mean by this: forgot that this functionality existed?

-----

1 point by sacado 6183 days ago | link

yep, that's it. I never used the ssyntax-definer, so I forgot it was existing. Sorry, but it's a little late here, so I can hardly even understand myself :)

-----

1 point by skenney26 6183 days ago | link

defcall looks interesting. Is there any documentation on other uses of it?

I like the idea of using the .. syntax:

  (spaces:map sq 1..5)

-----

4 points by absz 6183 days ago | link

defcall is pretty simple to use. The syntax is the same as that of def, except instead of a function name, you provide the type of the object. The function receives both the objects and its "arguments". E.g.

  arc> (defcall sym (self n)
         (repeat n (prn self))
  #<procedure>
  arc> ('a 3)
  a
  a
  a
  nil

.

-----

1 point by sacado 6184 days ago | link | parent | on: Dual syntax for Arc

Actually, you already can.

First, mzscheme lets you use this syntax :

(a . + . (b . + . c))

Well, I find it ugly and hard to type (that's about 20 characters, instead of about 10), but that's a question of point of view, and at least you can do that.

There was also an experimental version of infix notation for numerical operations on Anarki a few time ago. You could do :

(a + b + c)

However, the implementation was very slow, so I think it is not used by many of us those days.

-----

2 points by eds 6183 days ago | link

> However, the implementation was very slow, so I think it is not used by many of us those days.

I'd like to find a way to improve the speed of the current infix implementation, but I'm not sure it can be done without using macros, which would require some sort of type inferencing or static type declarations.

-----

1 point by almkglor 6182 days ago | link

Or just:

  (nfx a + b - c)
An old dorky buggy implementation for CL:

http://www.dwheeler.com/readable/readable/trunk/gloria-infix...

-----

1 point by sacado 6183 days ago | link

Once again, maybe the solution is ssyntax (yep, this is my new motto :) :

  { a + b + c } <==> (+ a (+ b c))
Hmm, not an easy one though.

-----

1 point by absz 6183 days ago | link

The ssyntax system cannot do this: it's limited to working on symbols. You would need access to the readtables in mzscheme to make this work.

-----

More