As for performance... hard to say, I think. My version conses up a big list and then reverses it, your version conses up a big list and then maps it. So without some actual testing or analysis...
Update: Ah, I see somebody already pointed you to it (http://arclanguage.org/item?id=3919). The point of the UI is that new replies to threads you were involved in will show up in reverse chronological order with all their context (parent comments).
I actually didn't click through on lojic's comment, I'm sorry to say, from "old news" I assumed the link was to someone else complaining about the same thing, not pointing to a fix!
Thanks! Unfortunate that news.yc went through a revision on the day you became aware of hystry. Hmm, perhaps I should crawl arclanguage and news.yc with separate crawlers even if it's the same code.
(Ulterior motive in writing this reply: to make sure parent gets crawled by hystry after restarting :)
My more serious objection is the inclusion of $ in the "stable" branch. Whatever makes it easy for you to do experiments in the wiki is fine with me. However the stable branch is advertised as being arcn + bug fixes, and I don't think taking over a punctuation symbol in support of fixing a couple of bugs such as "date" and "mkdir" qualifies.
Yeah, I wasn't really sure about this. It seemed to be the path of least resistance, but if you want to write make-directory, which-os, and so forth (or their more primitive components) in Scheme and get rid of $, go for it.
There is still seval, right? You could use seval rather than $ in the stable branch, since it won't have to be updated except for arcn releases and bug fixes, so maintenance won't be too much of a problem. And it doesn't require writing entirely new library functions to implement.
Everyone has exactly the same amount of time: 24 hours in a day.
Every task that a person does means that there is something else that they are not doing.
To incorporate bug fixes sounds easy, but consider for example all the fixes floating around for "mkdir". Each one fixes mkdir for their operating system and their version of mzscheme, yet it's time consuming to ensure that a bugfix doesn't break someone else's installation.
When a bugfix has been tested and used by lots of people and there is a consensus that it is the right thing to do, then it would be easy for Paul to incorporate it into an arcn. When someone simply says "here's a fix!", then it takes a lot more time to figure out if it is the right fix and if it isn't going to make it worse for someone else.
This why the whole "network of trust" concept as it relates to massive distributed software projects is important. I'm sure if Arc will do well then PG will need to establish people whom he trusts to aggregate packages and give him only the good ones in order to cut down his personal time investment. Some guys on this forum are definitely knowledgeable enough and motivated.
The BUGS file in master? I know it's in master and all, but since master's sort of the main branch, it makes sense for it to have information that pertains to the whole repo. Plus we don't want to clutter up stable with extra files.
Also the check in ensure-dir to see if the directory already exists has been taken out going from arc2 -> stable, which means that if the os is unix or macos, you're going to be firing up the shell on every single call to ensure-dir.
It's probably not worth worrying about for this patch, because mkdir is in a different place in stable... I'll worry about that. But for future reference, the original post has a good procedure.
Your approach has the elegance of needing only one access method, however I'd prefer to see setting one side of the bitable not overwrite a value stored on the other side.
If I should happen to choose a username that matches your cookie value and I login, I will destroy your session.
Make them different types, I suppose, say capture cookie values into cons cells, or adding a character to cookies which is disallowed in usernames. Admittedly hackish, but then otherwise if you get my cookie as your username, looking up my cookie gets your cookie, which still destroy my session.
Sorry, I wasn't clear: I meant I wanted the two sides of the bitable to be separate: setting side a would automatically set side b and vis. versa., but I would still be choosing to do a look up in side a or side b, and I'd still be choosing to set side a or side b (though with the bidirectional table setting side a X Y would be the same as setting side b Y X).
(def bidir-table-sided ()
(with (a-to-b (table)
b-to-a (table)
erase-link
(fn (k-to-v v-to-k k)
(let v (k-to-v k)
(= (v-to-k v) nil
(k-to-v k) nil)))
report-error (fn (side) (err:string "bidir-table-sided: not side a or b - " side)))
(add-attachment
'= (fn (v side k)
(let (k-to-v v-to-k)
(case side
a (list a-to-b b-to-a)
b (list b-to-a a-to-b)
(report-error side))
(if
(no k)
(err "bidir-table-sided: can't assign nil key")
v
(do
;first erase
(erase-link k-to-v v-to-k k)
(erase-link v-to-k k-to-v v)
;now link them
(= (v-to-k v) k)
(= (k-to-v k) v))
; else delete
(erase-link k-to-v v-to-k k))))
; no keys attachment: not a real table, since
; we specify a side
(fn (side k)
(case side
a (a-to-b k)
b (b-to-a k)
(report-error side))))))
To use:
(= (foo 'a 42) 1)
(foo 'b 1)
Can obviously be extended so that the user can specify the sides, for example you can just specify 'user and 'cookie as the side, this is just proof-of-concept.
Good to ask the question, lojic. I'd also like to point out that if Paul wants to manage Arc that's great, but that it's also OK if Paul doesn't want to become a Linus Torvalds :).
(I personally would be perfectly delighted if Paul continues spending his time thinking about making code shorter).
And if it should happen that Paul doesn't want to spend his time accepting patches, we'll be just fine: we have Anarki and other Arc distributions where we can fix any bugs we want.
You're right, but it can be dangerous too : we would end up having two (or more) competing implementations of the language and have libraries compatible with "PG Arc" and others compatible with "Anarki".
We finally would have to choose which implementation to work on (the official one ? Or the one with cool features missing from the official ?) and have to port every missing library to our chosen version. Something current in the Lisp world, but that's also one of the reasons why Lisp seems frightening to others and why Python or Perl have more users.
Although I'm a Lisp newbie, the more I learn about Lisp, the more I like it. However, one of my frustrations (which seems to be all too common), is dealing with the myriad of implementation choices, libraries, etc. There are pros and cons to those choices, but more cons ;)
For me, the BDFL model has worked quite well for Ruby, Python, etc. I expect I'm very biased since I'm a Ruby programmer currently, but I think it's fair to say the model works well to avoid dividing and conquering itself.
There are many things to like about Arc, but I think the fact that it could potentially unify a large community around a single implementation is very powerful.
I've also heard that it's better to put systems in place before you need them instead of afterward.
The only practical alternative to BDFL is design by committee. For Anarki, the committee is anyone with git installed. Much as I love the work being done on Anarki, the model won't scale and either pg, nex3 or someone else will end up having to make the decisions.
So I'm sort of saying... it'll work out in the end, maybe.
The conflict I see is between pg releasing Arc at this very early stage because he found it useable vs you all going batsh*t over the volatility. You are both right! It is great that the users are chomping at the bit for something stable, but pg warned everyone that this was an experimental release and he planned to trash all our code at will. :)
Looking at Arc as a Lisp veteran I can assure you all that you totally need to reset your expectations and sign up for a fun exploration of a possible (emphasis on possible, because the more I learn of Lisp-1 the more I consider it a grave error) ... of a possible sweet spot in the abstract Lisp language space.
If Lisp-1 does turn out to be a grave error, it doesn't seem like it would be that difficult to either add the Scheme features that make Lisp-1 work, or turn it into a Lisp-2, given the side of the Arc codebase.
Right now, I'm just looking for the best Lisp to develop web applications with. Ruby on Rails is my benchmark, and I think it can be improved on with Lisp, but that remains conjecture at this point.
Just to be clear. I'm not asking for stability at this point. I agree that maintaining backward compatibility would waste time & effort. Arc can still evolve like crazy and break existing code, but it would be nice to have a way for the community to feed patches & bug fixes to pg besides the Arc forum.
No, it does not work that way, although people who do not understand macros (such as Guido) live in fear of that hobgoblin.
Macros are not used to create unrecognizable languages. They are used when an API has grown to the point where writing the code to use it can be automated. That is probably hard to parse if you fear macros, because you can only fear macros if you do not know how they are used. But the idea is simple.
This little call tends to require this little call before it and this little call after it, or something like that. And this pattern appears often enough, or the Lisp developer recognizes it as the sort of thing that will appear again and again, and they just say, macro time!
They then give the macro a totally comprehensible name derived from the bits of the API being hit and, golly, no confusion.
The other time you see macros is in things like aif. There will only be so many of these, and they will confuse people not at all.
It seems to me some people want macros to be a problem. They never are.
Yes, well. In the office no one wants to touch my code, because it's built from bunches of macros, and no one else here knows how macros work. Oh well. Could be just me, I suppose.
Edit: gets even worse when I use C macros in C code ^^, they even instated a rule that loops should use for(i=0;i<limit;++i) and not my otherwise shorter repeat(i,limit) macro
We almost agree. :) I don't know, when they look at your functions do they know what they do? When they see a class name do they understand the class hierarchy? Or do they start browsing? As for repeat(i, limit) being banned, I presume because no one could guess what it does, well, I am looking at bartender's school. The more I learn about software the harder it is to work with some people. :) But I don't blame Dilbert on the C preprocessor.
LOL. I think the problem, partly, is the fact that we're attached to a Japanese company and the Japanese might not have that good a grasp of what "repeat" means (they tend to have a sneering attitude to anything non-Japanese, which means they suffer in the english-language department). I did manage to talk some guys into using repeat, but they got ordered by the Japanese to change it to "for", presumably because the Japanese knew "for", didn't know what "repeat" meant, and couldn't figure out how #define worked.
Edit: Too bad I'm a teetotaler, I'd have gone to bartender school too.
"one of my frustrations ... is dealing with the myriad of implementation choices"
As Sartre said, you are not free to be not free. Have fun with Arc, use Common Lisp. Lisp-1 buys you nothing but aggravation, minimal just means you end up building your own full tool chest that is incompatible with anyone else's so you can never share code.
The idea that Lisp's greatest strength - the inherent ability to transform to whatever you want it to be - is also its greatest weakness, since it prevents you from easily communicating with others what you intend - that is, one man's 'let (CL, Scheme) is another man's 'with (Arc).
Having ported my groovy Cells project to Arc, I can confirm that it was a pain where I sit that "only the names have been changed" in several cases. :) But pg gets the benefit of the doubt from me because I own both his books and he kinda rocks when it comes to Lisp.
The funny thing is that perhaps unbeknownst to you all the Lisp establishment is ragging on pg for Arc being too much like Lisp, you (and I a little) are hosed that he diverged from Lisp, so him being smart I would guess he is now ignoring everyone. :)
The only thing I can offer is that it totally sucks to have an installed base and not be able to change things cuz you will break all the code ofyour users. Only at times like this is an inventor free to change everything and anything, I guess pg did.
I don't really see Anarki as a fork of Arc, and certainly not as a competing implementation. I see it as a place to put bug-fixing patches, to experiment with crazy implementation ideas, to keep libraries and add-ons, and so forth. I keep it up-to-date with the latest arcn.tar, and we all try not to make the API incompatible. If PG ever says that there's some feature in it that he won't include in the official distribution, at least one that involves patching ac.scm, we'll get rid of it. The rest can be included as arcn-compatible libraries.
So I don't predict that there'll really be incompatibility issues in the future.
Well, as far as I know, there are some improvements (bug fixes & efficiency issues) made in ac.scm from arc2 that have been ignored on the anarki version (where other patches & fixes were previously applied). In other words, anarki's current version of ac.scm is much closer to anarki's "arc1+" version than to arc2's version. I tried to merged them a few days ago, but apparently it broke in some versions of mzscheme. I might try again later.
No big deal however, these are only minor issues, but it might get harder as pg improves his own version while we get addicted to (and improve) the cool features implemented in the version we're working on. One day or another, it will be almost impossible to merge them. (Animal species work that way btw)
There shouldn't be anything in arc2 that isn't in Anarki except maybe a couple srv.arc improvements that are more or less a subset of the improvements made earlier in Anarki.
I did a full merge of arc2 when it was released (see http://www.arclanguage.org/item?id=3427), and when there were conflicts, generally favored PG's solutions to the ones already present. If there is anything missing, I'd love to know what it is.
That one is not crucial, as it only brings a minor performance gain in most of the cases. However, I'm more skeptical about that :
(define (ac-fn args body env)
(if (ac-complex-args? args)
(ac-complex-fn args body env)
`(lambda ,(let ((a (ac-denil args))) (if (eqv? a 'nil) '() a))
'nil
,@(ac-body body (append (ac-arglist args) env)))))
Versus the code from Anarki, still the original arc1's version :
(define (ac-fn args body env)
(if (ac-complex-args? args)
(ac-complex-fn args body env)
`(lambda ,(let ((a (ac-denil args))) (if (eqv? a 'nil) '() a))
,@(ac-body* body (append (ac-arglist args) env)))))
Isn't it a bug fix ? The one someone told about, with '(), () and nil not being always equivalent ? If so, that's more problematic. I tried to merge these codes together, but it was obviously broken and was reverted later in the git.
Those do seem to be mistakes. It looks like this might have been caused by the Windows-newlining of ac.scm, which screwed with the Git history a little. I'll change these to the arc2 versions... if you see any other inconsistencies, let me know.
I've changed ac-call to the arc2 version, but I think you're wrong about ac-fn. The following:
(define (ac-fn args body env)
(if (ac-complex-args? args)
(ac-complex-fn args body env)
`(lambda ,(let ((a (ac-denil args))) (if (eqv? a 'nil) '() a))
'nil
,@(ac-body body (append (ac-arglist args) env)))))
is how it's been in arc0, arc1, and arc2. The following:
(define (ac-fn args body env)
(if (ac-complex-args? args)
(ac-complex-fn args body env)
`(lambda ,(let ((a (ac-denil args))) (if (eqv? a 'nil) '() a))
,@(ac-body* body (append (ac-arglist args) env)))))
is unique to Anarki, and was added as part of a patch for MzScheme compatibility.
After getting rid of all the trailing-whitespace-removal that was clogging the diffs, I think ac-call was the only non-purposeful difference between ac.scm in Anarki and arc2. Let me know if you notice any more, though.
Well, the future will tell us, but for the moment, Anarki is a non-official experiment around the "real" Arc, and as far as I know none of the propositions made in Anarki can be found in the official versions (it's very early for that, I know). On the contrary, debian stable & unstable are both official and the vocation of unstable is to become the next stable version.
"as far as I know none of the propositions made in Anarki can be found in the official versions"
There are a few bug fixes that appeared first in Anarki, were brought up on the forums, and ended up being added to arc1 or arc2. But you're right, I don't believe PG pulls changes from the repo directly.
I'm no lawyer and I haven't read the artistic license very closely, but Anarki's under the same license as the original codebase, so I'm pretty sure there shouldn't be a problem...
I understand your point, but I am sure you'll agree that Paul definitely will accept a feature if it is really cool. Thereby Anarki is de facto Arc Unstable.
At the same time, it's good to have some 'central planning' since this gives motivation to contributors and makes them feel part of "Arc's history" (not that reading Arc's forum is not engaging enough, but...), otherwise they may feel that their work is not appreciated and just stop hanging around...
As much as everyone wants freedom (as in speech not beer) it's not so much fun when your working code is on the line. Even in a 3-week old experimental programming language. Funny that.
So someone usefully adds docstrings to the OpenID code in Anarki, and when I push my next version I'd need to be dealing with code that has docstrings in it.
I think it's perfectly fine that Anarki prefers to have its documentation in docstrings. I welcome anyone who wants to to add the OpenID code to Anarki to do so (it's in the public domain, after all). If you had said, "can I add this to Anarki", I'd say "sure, I'd be delighted". If there are any patches that would help make my code easier to incorporate into your distribution, I'd be happy to consider them.
But your question was "could you add it to Anarki". The answer is no, I'm not going to take the time to be a downstream maintainer for code in a distribution that has conventions that I don't like. In fact, I'm not sure I'd become a downstream maintainer of code in a distribution that I did like.
Everyone, every single person, has exactly the same amount of time. We all have 24 hours in the day. We all have different goals, different desires. If someone out there likes the direction Anarki is going in and thinks this OpenID code I wrote is useful and wants to spend some of the limited time they have to add it to Anarki, I'm delighted. More power to you, whoever you are.
And if no one wants to take the time to do that, that's OK with me too! :-)
I don't suppose you'd be willing to put your OpenID stuff in a git fork of the Anarki official branch, then? The official branch is just arcn.tar, and it would allow us to easily share patches back and forth.
If you need hosting, I have more GitHub invites than I know what to do with.
I am in fact leaning towards basing my projects on your new stable branch. arcn + bug fixes sounds like a good place to build upon ^_^ Plus I could see myself cherrypicking particular functionality that I want from the wiki.
I did my first commit using git ever this morning pushing the atomic-invoke bug fix to the stable branch... let me know if I did everything in the right way in terms of the log message and so on; I know nothing about what typical git project conventions are.
I assume that once I read some more of the git tutorials I'll discover I can easily publish at least a read-only copy of my git repository off of my web site, yes?