Arc Forumnew | comments | leaders | submit | byronsalty's commentslogin
1 point by byronsalty 6288 days ago | link | parent | on: Really using git

Sorry about the dup post - I blame it on blackberry.

-----

1 point by lojic 6285 days ago | link

No problem, I'm sure the forum code has:

  (merge-post posts 3089 3090)
:)

-----

6 points by byronsalty 6288 days ago | link | parent | on: Really using git

Well the real nice part would be PG himself using git and doing diffs against other repos to see what's festering in the community.

Right now the forum seems to be the only what of contributing patches to arc and this seems ripe for having things lost. (And who wants to bring up the same patch twice if it went unnoticed the first time).

-----

1 point by byronsalty 6288 days ago | link | parent | on: Really using git

I was thinking of this while watching the video - when Linus talks about smartness is a good indicator of someone to pull from - that the minimum level of smartness to participate becomes being able to setup a public repo.

This is somewhat exclusionary but I'm sure there are worse litmus tests on who's code to trust.

-----


Well I don't think it's ugly, but ugliness aside it's very descriptive in one char. I'd personally like to see this convention carried over. Ruby uses the same convention so it's not just Scheme.

If this was intentionally left out my guess would be that PG was trying to save those chars for something meaningful to the compiler (syntax) not for aesthetics.

-----

1 point by are 6287 days ago | link

It should be possible to detect, at define-time, whether a function/macro has side-effects (see the ideas for a conservative purity analyzer in http://arclanguage.org/item?id=558).

So if the function/macro has side-effects, def/mac could e.g. also assign it to a second symbol with "!" appended.

'?' could also be done similarly, but would be more difficult. Here is a start:

def/mac should also assign its function/macro to a second symbol with "?" appended if:

1) The function/macro has no side-effects (no "!")

2) The function/macro has a least one argument

3) The function/macro could return the empty list

-----

1 point by Jekyll 6285 days ago | link

join? ?

list? ?

sort? ?

first? ?

It's not doing it for me.

Leaving aside the issues of detecting a query, I think it's a really bad idea to have the compiler force (badly guessed) semantic knowledge on me.

It's my code, I wrote it, and I don't want any compiler telling me that a query that caches previous results must be imperative! and not end in a ? .

I also thing needlessly polluting a namespace with addition symbols is a bad idea. You only get one namespace in arc, try to preserve it for the future.

-----

1 point by tokipin 6288 days ago | link

that makes sense. '!' is already being used (though the convention doesn't interfere with the syntax at the moment)

bear with me here, but '!' means the function isn't pure, right? if so, who cares? it seems like an ivory tower thing. ? is fine, though maybe prefix notation can be considered

  isPair
  isNumber
  dangerSet
  dangerSet-car

-----

5 points by absz 6288 days ago | link

Just because something is academic doesn't mean it's not worthwhile. For instance, map, keep, reduce, etc. are different if passed a function with side-effects. What happens if you give them a function which modifies the list as it's being traversed? A pathological example:

  arc> (= x (range 1 5))
  (1 2 3 4 5)
  arc> (map [do (= (cdr x) (cddr x)) _] x)
  (1 3 4 5)
  arc> x
  (1)
However, if map is passed a pure function, you can e.g. run one copy of the function on each core and run it in parallel.

And "dangerSet" is both non-Lispy and non-Arcy. It's non-Arcy because it's long. And it's non-Lispy because of that capital letter: danger-set would be marginally better. But nevertheless, pair? is shorter than is-pair, and (in my opinion) reads much more nicely.

-----

1 point by byronsalty 6291 days ago | link | parent | on: More generic if macro

Well leaving ifn out of the picture, I did a codetree on using genif to replace aif and iflet and unfortunately the size increased from 7759 to 7777.

Of course if iflet really is buggy then the code tree would likely increase to fix the bugs.

-----

2 points by byronsalty 6291 days ago | link | parent | on: Automatic .arc reloading in background

Yep this is definitely for dev only.

I found in practice that 5 seconds we fast enough, I would save the file, switch to browser and refresh and it would be there. Of course 5 seconds is the worst case - 2.5 seconds would be the average.

-----

2 points by byronsalty 6292 days ago | link | parent | on: Anarki Conventions

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 6291 days ago | link

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

-----

3 points by byronsalty 6292 days ago | link | parent | on: Favicon?

I just added .ico support to srv.arc and added this icon as the favicon.ico in the the public_html folder.

Anyone using an updated version of arc from git should now have a favicon of the lambda. Feel free to change the actual file used when the icon wars subside.

-----

6 points by byronsalty 6292 days ago | link | parent | on: On Lisp as a guide to Arc

all of the anaphoric methods (aif, awhen, aand, ...) are also from On Lisp.

-----

2 points by byronsalty 6294 days ago | link | parent | on: Traversal

Wow. This is why I'm playing with arc. This hurt my brain for about 10 minutes but now that I understand it - it seems like the most natural way to do this.

I also got an OnLisp dejavu. Another good thing.

-----

More