Arc's Out
paulgraham.com
paulgraham.com
I forgot my news.yc password and wonder if resetting password in news.yc propagates to the arc forum.
I thought representative Lisp hackers liked long descriptive names over short cryptic ones? ;P
PS: I feel my karma's going to hell in 3, 2, 1...
edit: It wasn't a challenge. It wasn't "oh, I'll pretend to think my karma will go down to look like a cool rebel". Hope that clears things up.
Are you hoping to build a user community for Arc? If so, and why would you release Arc if you weren't, then why are you not interested in keeping track of changes that break things users might design/code against? Am I being stupid and missing something here?
Edit: I forgot to mention something else. Congratulations and thanks for sharing Arc with the rest of us :)
"We'll change stuff without thinking about what it might break, and we won't even keep track of the changes."
Is that really wise? What's wrong with doing a simple changelog with every modification? Since you'd expect only experienced programmers to be using Arc, you don't have to hold our hand explaining the implications of the changes - but making us diff the source would probably be a bit much.
I mean it doesn't have to be verbose even. Or even tidy. This would be better than nothing:
* Added a global weak reference hash map to treat any object like a hash using {} syntax, ie, (= {someobj hashindexobj} 5).
* Hash idea sucked. Removed.
I see merits in standards compliance, but making my life easier is not necessarily one of them.
It seems backwards to me though, surely the most "semantic-free" approach is to default to divs rather than tables to structure the markup.
(That may change in future, but right now I don't think any mainstream tools assume markup is semantic. And in any case, tables aren't much moreso than divs.)
Depends on what you're talking about; anything that uses microformats does, for example.
Tools generally can't assume that tables are semantic, because they've been so heavily abused. That's not going to change though. Perhaps the best solution is a <yes-this-is-really-a-table> element.
> tables aren't much moreso than divs.
Would you say that a table in a relational database isn't much more semantic than a string of bytes?
I don't plan on using arc for the time being, but I hope that maybe I can steal some ideas from it, so I welcome it's release.
The Scheme language sneakily increased the scope of the language designer's powers. From very early, maybe from the begining, the Scheme spec said that conforming implementations must do tail call elimination. The first time I read this, I thought "wait, can you require this in a spec?" Arc will see this increase, and raise it by some standards for profiling.
I thought that was a great idea. Too few languages have good support for profiling. Did the idea get dropped? I don't see anything obviously related in arc.arc or in the tutorial.
I wonder if PLT Scheme's profiling tools are good enough on Arc programs (or useful at all?). I hear they have pretty good ones, but haven't used them myself. Arc might be different enough from MzScheme that the information that the PLT profiler returns on Arc programs isn't so useful.
$ wc -l arc0/*
1093 ac.scm
535 app.arc
1496 arc.arc
16 as.scm
107 blog.arc
48 brackets.scm
61 code.arc
2 copyright
360 html.arc
7 libs.arc
80 pprint.arc
119 prompt.arc
462 srv.arc
223 strings.arc
4609 totalP.S. Do you have a personal vendetta against the W3C, or something?
Thanks PG
$ git clone http://codewikia.com/arcWhat's the license, by the way?
1. I think using cons to represent lists is an ugly hack. I mean, why should a cons only hold 2 elements? Why not generalize them to n elements, and call them lists?
2. Has anyone tried unifying macros and functions? The distinctions between the two is one of the worst part of Lisp IMO, and I don't think there should be anything fundamental about it.
Otherwise, it's nice to see a new Lisp of course.
1. Recursion and cons cells naturally complement one another. They can stand in for n-ary tuples, vectors, and arrays reasonably well for small values of n, and when your dataset gets large, well, you switch to a more efficient data structure. Hell, with Arc you even get 'push' and 'pop' as built-in functions. What exactly is the problem?
2. Again, I don't see how this is a problem. Macros are compile-time rewriting rules. In an eagerly-evaluated language like Lisp, they are pretty much a necessary evil to prevent unnecessary side-effects while still allowing for flexible syntax. I can imagine doing without them in a lazy language like Haskell, but I'm not aware of any popular, lazy languages in the Lisp family.
That being said, I'm interested to know if you've working with other languages where #1 and #2 aren't a problem.
2. Macros come with a ton of pitfalls and limitations. On Lisp has a nice list of reasons to avoid macros. But consider if your macros are really called at run-time rather than compile-time, and you have a special operator like eval, but that evaluates in the calling context. Then you can write normal functions like this:
(defmacro average (x y)
(/ (+ (eval-in-caller x) (eval-in-caller y)) 2))
and (defmacro my-if (condition x y)
(cond ((eval-in-caller condition) (eval-in-caller x))
(t (eval-in-caller y))))
defun can be written straightforwardly as a special case, and in fact extended so that eg.: (defun do-many-tymes (n-times ¬-evaluated body) ...)
would behave half like a function and half like a macro. These run-time "macros" can be function-quoted, recursive, and have no problem with variable capture. With such a defun, you no longer need a defmacro.These are my fantasies about fixing stuff, so I won't waste anyone's time by writing more. I don't know if that could work. Macros are just so ugly... I was curious to see if PG or anyone had tried alternatives.
(1) Let's separate implementation and semantics issues. In semantics level, list as a datatype is defined recursively:
List a = () | (a, List a)
This definition maps well to recursive algorithms.It also maps well to the implementation that uses cons cell, but as you say, it's not the only way to implement it. There was a technique called CDR-coding, which represents a list as if it's a vector (e.g. cell's CDR doesn't contain a pointer but it overlaps the next cell's CAR); specially tagged pointer distinguished normal cells and CDR-coded cells. I guess it was abandoned since deailng with set-cdr! would be very messy. But if you're creating a new dialect, you can go for big change like dropping set-cdr! (some of Scheme people even talking about dropping mutable cells.) In today's computer where access locality means a lot, maybe you can shed a new light to this old technique.
(2) I think the current state of macro was the result of simplification. IIRC, the old lisp dialects allow to pass around syntactic values (FSUBRs) as if it's first class, but it's easily messes up the semantics. It's conceptually simpler to restrict macros as curretly they are. If passing macro around is allowed, you'll never know how (+ 1 2) in the following function is evaluated until runtime:
(defun call-it (x) (funcall x (+ 1 2)))
It may be evaluated as a normal expr, or in a completely different way, depending on whether x is a macro or not. Or are you suggesting that, in this case, (+ 1 2) is evaluated immediately because funcall is not a macro? It is a possible strategy, but then it clipples the expressive power, since it can't represent the same thing as: (defmacro call-it (x) `(,x (+ 1 2)))
But there are still people who wants to unify macros and functions. Search comp.lang.lisp and comp.lang.scheme---I've seen some discussions there. Also search "first class macros"; there are some papers.Another way to eliminate (most) need of macros is to adopt normal order evaluation. I've seen some Lisp dialects using lazy evaluation by default. Beware that it changes the programming style a lot, though.
2. call-it: What's the problem with not knowing (+ 1 2) until run-time? Efficiency? Then I would argue that expressive power of the core language ought to take precedence. In an actual implementation, funcall could leave (+ 1 2) to be evaluated (or not) inside the function body. I would add funcall-normal-function to the language, which would amount to a funcall + (declare (normal-function f)). Both for documentation and for efficiency.
Of course, not knowing if (funcall x (print 2)) will print 2 is unsettling in a way, but that's the same basic argument that's made against macros. They disrupt the evaluation order.
I read about normal-order before, but it didn't make much practical sense. I'll Google your pointers and look it up.
Not only efficiency. You don't even know if (+ 1 2) means "1 plus 2" or "choose 1 or 2 randomly" or "generate a sequence of numbers between 1 and 2" until you know what x really is (assuming funcall does delay evaluation of its arguments and passes the original form in case x is indeed a macro).
The macro version of call-it has the same problem, of course, but if you embrace first-class macros in the above way, every higher order function call will have the problem. Considering how often HOF is used, the impact is huge.
However, as you suggested, you can have two versions of funcalls, one of which evaluates args no matter what x is; then this problem will be solved.
(Or you can use hygienic macros, then you can deduce what '+' means purely from its lexical context, at least.)
Well, yes, that would be the point :)
I think I understand what you mean, but I don't see how this is more dangerous/worrying than what is already there. Ok, so (funcall fn (+ 1 2)) may or may not evaluate (+ 1 2). But call-it is already willing to give total control to fn. Will fn call a continuation and never return? Launch nuclear weapons? Giving it additional control over the evaluation of the arguments seems innocent enough.
bash-3.2$ ls | xargs -n 1 wc -l
1093 ac.scm
535 app.arc
1496 arc.arc
16 as.scm
107 blog.arc
48 brackets.scm
61 code.arc
2 copyright
360 html.arc
7 libs.arc
80 pprint.arc
119 prompt.arc
462 srv.arc
223 strings.arc
4609 lines of code as of today. wc -l *Nobody said I was going to be a highly efficient Arc programmer. :)
Offtopic, but what exactly is that a picture of? I see chairs, and a face in the background (looks like a reflection) - is it a picture taken through a window? Why is it there?
The new picture on the frontpage of pg.com is a self-portrait shot in/through a window at the Grand Trianon, in the grounds of Versailles. I noticed that if I held my head in the right place I could line up my eyes with the wallpaper pattern.
But then I guess that is all part of exploratory programming.
Tables are meant for tabular data, and when you use them for layout it breaks those semantics, which in turn makes it much harder for screen readers to make sense out of it.
It's also just ugly, in my opinion.
This turns out to be a relatively poor user experience.
Right now that kind of thing is intractable because there's no easy way to distinguish a table-for-data from a table-for-layout. I think it could be cool to have some way of putting something in your page HEAD that means: "In this page, tables are used exclusively for tabular data: you can activate your reordering features".
As well, any bets on who writes the first book?
You could ask on comp.lang.lisp if you wanted some really well-informed opinions wrt the impact of Arc on CL, but I wouldn't advise it unless your skin is thick and flame-resistant.
http://groups.google.com/group/comp.lang.lisp/browse_thread/...
> MzScheme installations with unhygienic macros and empty lists that
> serve as false?
(keep [_] seq)
(keep [progn _] seq)
And thus I see the need for trues =P.and two little english
But, why should Arc libraries generate HTML at all, instead of a list?
So a hardwired table-HTML output isn't good.
Exactly! I think most developers don't get this statement. Committing yourself to data structures is like mixing cement IMHO. Once you've started this get harder to change quickly.
(load "blog.arc")"I spent a fews days"
Thanks for arc.
(while 1 (pr "This is so exciting! "));)
http://mooseyard.com/Jens/2008/01/96-characters-ought-to-be-enough-for-anyone/
i agree with all of that.If he can do all that in one hour, I am really impressed. It would take me more than one hour alone to research the utf-8 and CP-1252 encodings. Changing regular expressions libraries to work with 16 bit, as well as the index operations for strings might take some work, too.
I suppose that guy could rewrite the whole Arc within a day...
Is this why unicode is absolutely broken on ycnews? :( Seems a shame not to be even to use characters like pi in comments/titles IMHO Does a pound sign work? GBP
edit: no it doesn't. Seriously, if done right unicode support doesn't have to take that long. Especially if you're building something without the need for backward compatibility.
Just my 2c.
Maybe I'm being harsh :) I'm sure it's great really, but these days people expect unicode support on websites.
People care if a website is using correct unicode characters or not.
Perhaps they don't know/care because the majority of websites now are unicode, and just work.
I wrote a php forum a while back. You wouldn't believe the number of emails telling me that the gbp sign doesn't show up properly when they post a comment.
http://iolanguage.com/scm/git/checkout/Io/docs/guide.html#TO...
Perhaps arc could use the same approach.
> In Io, symbols, strings, and vectors are unified into a single Sequence prototype which is an array of any available hardware data type
> A String is just a Sequence with a text encoding, a Symbol is an immutable String and a Vector is a Sequence with a number encoding.
Pretty cool. Thanks for the link.
PG just released an entirely new dialect of lisp for web programming, he's mentoring about 20 startups right now, and runs Hacker News... "Oh, and can you add Unicode support, it would only take 2 or 3 days..."
I know that not having Unicode supported in your web language is inconvenient, and at times is a show-stopper. But really. Give the guy a break. If PG doesn't want to "spend a single day on character sets". Don't ask him to spend a day on character sets.
If you want Unicode support in Arc, code it up and submit it.
If PG explicitly says "ok, I don't have time to do Unicode stuff now, but my idea is that a string is a sequence of characters, regardless of how a 'character' is represented", then somebody can go ahead to change Arc Unicode-clean (it won't be much work assuming MzScheme has support of Unicode).
If PG says "the language Arc (not mere an implementation) doesn't support beyond Ascii", then I feel that PG reserves that part of design (e.g. it may conflate byte-array and multibyte strings, or it may use richer character representation than unicode codepoint, such as a character object that holds the sequence of base char + modifiers, or it may hold raw byte array plus encoding info). In that case I hesitate to change Arc code without understanding PG's intention.
The freedom of the citizen of Hacker News to express himself is being suppressed! Paul Graham, add support for blink tags now!