Arc Forumnew | comments | leaders | submitlogin
7 points by ambition 6154 days ago | link | parent

As a principle to consider, how about: "Any change to anarki should not break any program which runs correctly on the latest arcn, if the program does not exploit bugs in arcn."

What do you think?



3 points by almkglor 6152 days ago | link

You know, any change to anarki which adds macros, of all things, would break some programs that run correctly on the latest arcn.

For example, suppose I were to define a simple macro, nothing:

  (mac nothing () nil)
Then the following simple program will run correctly on arc1, but fail if you define the above macro:

  (def doda (xs)
    (let nothing (table)
       (each x xs (assert (nothing x)))
       nothing ))
I think the above issue definitely needs to get fixed.

-----

2 points by raymyers 6151 days ago | link

True. Anarki-only macros should probably be banished to the `lib' folder, so they have to be (require)'d before they start modify your code.

-----

2 points by nex3 6151 days ago | link

I'm not so sure about this. I think changes of the filling-up-namespace sort are reasonable, for the same reason being a Lisp-1 is reasonable: conflicts happen rarely in practice.

A better solution would be to try to ensure that only generally useful macros are added to arc.arc, and that they have names that are unlikely to be used as local variables. Or even better would be to make local variables shadow macros.

Consider this, though: "help" is defined as a macro. Some of the REPL-var code needs macros. The drop-into-scheme operator is a macro. I don't think we want to make people load a library file to use these.

I see the compatibility rule as more of a guideline - try not to break the functionality of stuff that already exists. But I don't think it should limit experimentation and exploration, including exploration of what's useful to have in arc.arc.

-----

2 points by raymyers 6151 days ago | link

OK, I'll backpedal a bit here. The last thing I want is to have to require "lib/help.arc" :). It should be easy to find out what macros have been added though -- as much for curiosity as for compatibility. I'll try and whip up a script tonight, unless someone beats me to it.

-----

4 points by raymyers 6151 days ago | link

Script complete. It crawls `arc.arc' and every file loaded by `libs.arc'. So now, if you type the following,

    (require "lib/new-macros.arc")
    (new-macros)
... you will discover that the non-Arc1 macros in Anarki are currently:

    ($ % % %% %%% breakable defsop help make-br-fn or= redef)

-----

1 point by nex3 6151 days ago | link

Most excellent. It's great to see how easy it is to analyze Arc code using Arc.

Anyway, of those, the only one I see potentially conflicting with a variable name is "breakable", and that seems quite unlikely.

-----

2 points by akkartik 6151 days ago | link

Great thread to see how y'all converged on a design decision after some back and forth.

-----

4 points by raymyers 6153 days ago | link

That's a great requirement, but it might easier to obey if there was a test suite.

-----

4 points by nex3 6153 days ago | link

Please, feel free to make one (or rather, contribute... offby1 has the beginnings there already).

-----

3 points by nex3 6153 days ago | link

I agree. I've pushed something to that effect.

-----

2 points by byronsalty 6153 days ago | link

Ok. The public_html change I made to srv last week will break anyone expecting to serve files out of the root directory (as they would with arc1). Should I revert this change? Then plead PG to pick it up with arc2...

Actually I could default the docroot to "" instead of "arc/public_html". I think it's ugly but if we want to be compatible with arc1 then this would do it.

-----

3 points by nex3 6153 days ago | link

I think this isn't so much a language issue as a configuration issue, so it should be fine.

-----

2 points by raymyers 6152 days ago | link

If anyone notices an issue regarding Anarki's compatibility with Arc, please note it in BUGS. Thanks :)

-----