84 points · by pogos · 17y ago · 80 comments
I can not believe for once that this guy obtained hacking nirvana through Arc. Not once! Why? because the Arc documentation is so meager as to be non-existent. You will need serious feet-wetting with more established Lisp dialects before you can "get there" with Arc.
All the epiphanies he lists are easily experienced with most modern Lisp dialects; either he "got it" before and just needed to extend the credit to Arc, for some reason .. or he isn't there yet, at least not to its full potential.
It had to be said, as much as I hate to be rude and blunt like this :-|
It was noticing this difference that made me decide Arc was ready to release. If it (a) felt significantly better to me, who (b) am experienced with existing Lisp dialects, and (c) writing a type of application (HN) that's not wildly specialized, then it had the "quantum of utility" I usually use as the test for releasing a version 1.
Any chance of releasing a book or spec alongside Arc at some point? Or are you encouraging people to just play around with it for now? I'm just wondering whether the idea here is to encourage exploration through scarcity, or that there's insufficient resources to produce the documentation, or if it's just too early on at this stage.
However, it's IMO, unacceptable for a fairly new Lisp programmer to cast aside 50 years of Lisp research, development and deployment while brushing aside the industry's backbone languages, and herald Arc as the best thing ever when it isn't even finished.
I can accept personal choice and opinion, if kept to one's self and made in private. Even if someone sings Arc, or Clojure or Common Lisp or Scheme, praises, I am fine with it. But to say "Languages X, Y, Z suck because they don't allow me to write succinct programs", well, you're just trolling for X, Y and Z programmers to come out and straighten you out. The sort of macrology he is after (code-compacting type, not language extension) is pretty basic and could be done with the C pre-processor and M4. You can even write compact assembly programs with GASP, HLA, and NASM macros; it's not rocket science.
I reserve my judgment for Arc until it's done. There is no manual yet to hold the compiler accountable, and to save me from guess-work. However, what I can't ignore is blind fanboyism; if everybody here sang Arc praises, when it is just arc-tutorial.txt and arc.arc, and there were no "dissenting" honest voices, well, the place just wouldn't be the same.
He did not say other languages suck. What he said was he prefers Arc over those languages, and explained why.
I can summarize the whole thing as:
"I really like working with arc, and it makes me happy enough to blog about it."
So yeah, while I didn't find it particularly worth upvoting, I'm not sure why you are trying to convince this guy he is somehow _wrong_ about being happy, and telling him he shouldn't dare write about it. You can no more do that than convince someone who claims their favorite color is red that it is in fact blue.
> The guy expressed an opinion...
In technical circles even opinions have to be defensible. You can't just accept "X sucks and Y rocks" as an opinion and let it pass. The whole place will become abuzz with irrational thought, and overrun with "we are all right" group-think liberal-arts type BS.
Why not? The only reason that 'the whole place will become abuzz with irrational thought, and overrun with "we are all right" group-think liberal-arts type BS' is because people can't just accept things like this as somebody's opinion... they have to create a language war out of simple blog post about liking something.
(To everyone else, I'll quit now I promise, obviously I'm not helping the matter!)
s/verbal body-slam/public demonstration that I am an absolute tool/Ok. I will accept that.
Here is my take on your personal essay, it's also a matter of personal opinion made after sufficient technical evaluation of the matter: I think you need to be a little more critical of your own reasoning, specially when writing for programmers. The spirit of your essay has been largely positive, IMO, but go easy on the snide remarks and the dismissive attitude of other technologies you have very little experience in (yeah, it shows.) Otherwise a much less sympathetic reader than I, and a far more competent one, will come aboard and tear your argument to pieces.
A better way to frame your enthusiastic writing would be "I can do X in Arc, I really wish ${LISP_DIALECT} would let me do the same". This is both curious and also accepting of one's own self-limitations. Someone will come aboard and show you what you have been missing, and you might as well get pointers to the literature that further your understanding of Arc or whatever other technology.
Regards.
(I appreciate your suggestion to say that I wish another Lisp dialect was more like Arc, but I'm not sure how I'd choose one since I don't really have a favorite aside from Arc).
What the hell is your problem with a) someone creating their own Lisp implementation, and b) someone else enjoying using it?
I should have been nice, we're all equally-right in some way. hugs.
"I’ve long liked Lisp, but hadn’t been programming in Lisp for a long time because I hadn’t found any features in Lisp compelling enough to overcome the advantage other languages had in having large libraries available and such like."
I mean, come ON. If Lisp wasn't compelling enough because of the perceived lack of libraries, then Arc is the last way to come back to Lisp as it has NIL.
It's completely acceptable to have a preferred Lisp, but it's unacceptable to do so for irrational reasons ;-) Every time you need a new library/feature in Arc you're most likely to call out to the MzScheme runtime and FFI. It's highly hypocritical of you to dismiss a language for lack of libraries, then jump on another language it hosts.
I think you've misunderstood this sentence, which explains why you don't understand the logic.
He is dismissing Lisp because [library pain] is not alleviated by [compelling language features]. For him, in Arc, [compelling language features] do alleviate [library pain], so he is happy to use Arc. This logic is fine even if the [library pain] in Arc is actually worse than the [library pain] he experienced in Lisp, because [compelling language features] differs too.
So, no hypocrisy. You could still argue that he should have experienced less library pain in Lisp than he did experience, or that Lisp might have compelling features that he overlooked, or even that library pain cannot in principle be alleviated by language features, though I won't comment there.
Actually it didn't, but that hasn't stopped you before;
I have a desire to not just stand here and take it on the chin as mahmud publicly proclaims that I'm pandering, a Lisp newbie, irrational, a blind fanboy, hypocritical, dismissive, and unfair. On the other hand I don't want to waste everyone's time with a tedious flamewar.
Thoughts?
It's easy to misinterpret what people say on the net.
FWIW I too had a very positive superficial read of Arc when it was first published and I'm neither a fanboy nor a Lisp newbie. Scheme is one of my true loves.
I think that too much of writing about programming is focused on the details of the programming act, and too little on the result of the programming.
Reading about finding and learning a programming language is like reading about an artist choosing a brush. Reading about the technical details of someone scaling a Django app on a single server to serve 1000 concurrent requests per second is like seeing the finished artwork.
Wands are a much better metaphor to make. Or perhaps, what if you had a magic brush that could at any time be extremely fine or large or anywhere in between depending on how you felt? That would be some brush, especially when you compare it to the many medium sized brushes which aren't so fine when you need them to be.
Okay, so maybe the metaphor is still stretching a bit, but these are no ordinary brushes; they are worth writing about.
Yeah you're doing something wrong there. I know it's fashionable to bash Java and say how lame and verbose it is, but it does wear a bit thin. I actually enjoy writing Java. Perhaps due to me having grown up programming assembly - I don't mind verbosity. Java is an extremely solid fast language.
You mean "the JVM is an extremely solid fast runtime" - languages by themselves aren't fast or slow ;-)
Java as a language, the syntax, is for me sane. It gets a lot of things right, and some things wrong, but on balance, it's sane enough to use. Just like English as a language is sane enough to use, whilst having lots of stupid inconsistencies in spelling/pronunciation etc.
And it's likely to be the fastest/most optimized of any JVM target language.
My statements that I prefer Arc for the kind of programming I do was not intended to be a put-down of other languages.
If you should be so unfortunate to be stuck trying to write good code in Java, ...
One solution is to remove the connotations, eg:
If you are writing code in Java, ...
Note: this version is more concise :-)
But please keep the factual points, such that Java's verbosity can mean that removing duplication doesn't make it shorter. I thought that was an insightful and pithy expression of the idea. But I also note that that's not the only benefit of removing duplication.
Do linguists agonize over language efficiency as much as some programmers do? For example, writing English is maybe far more letters/strokes than Japanese (idk), but we don't all start learning Japanese and bash English.
And as such, for most people it is much harder to have a "favorite spoken language" that they can use as a platform to bash other languages. The way that programmers, text editor users, and coffee drinkers bash each other is bashing someone for an acquired taste. Bashing other languages is almost like bashing someone's physical appearance, and the immaturity becomes very obvious a lot quicker.
Also, regarding compactness of the spoken language, on average, English is longer than, say, Chinese. But brevity is NOT the goal. The tradeoff is redundancy, which English has much more of (e.g. parallelism and verb/plurality agreement). Old Chinese, with all its homophones, has plenty of texts written so compactly that if you don't read the text you will not understand it (at least for modern pupils).
http://arclanguage.org/item?id=9257
One of the things I want to add next is graphics libraries. Does anyone have any recommendations for what to plug into to munge images?
ImageMagick (http://www.imagemagick.org/) has worked well for us. There are bindings out there for many languages, including Common Lisp (http://common-lisp.net/project/cl-magick/); you might want to look there for inspiration.
http://arclanguage.org/item?id=4070
Are you planning to do another poll ?
http://rhodesmill.org/brandon/2009/graphicsmagick-saved-the-...
Thanks Anarki and arcfn.com!*
They were both tremendously useful/helpful when I last used arc.
*All creators and contributors.
http://blog.bitquabit.com/2009/05/20/your-language-features-...
That was comparing Smalltalk to C#, but it is a similar idea. Smalltalk and Lisp belong to that elite fraternity of programming languages where the ability to easily extend the syntax is built into the language. The mechanisms are different, but the expressive power is similar.
The Rewrite Tool is not dynamic. Perhaps this is the key? But I could imagine a Smalltalk function that takes a method, applies a Rewrite Tool syntactic transformation to its source, compiles the method as a Block, then calls this Block with the arguments that would've been send to the original method.
Something like:
perform: methodName
with: arguments
rewriting: aMatchingPattern
as: aRewritePattern
Where aMatchingPattern would be something like: ``@rcv
ifTrue: `Block1
ifFalse: `Block2
Then aRewritePattern could be something like: "Order of Blocks reversed"
``@rcv
ifTrue: `Block2
ifFalse: `Block1
Just be careful to cache the result of the compilation by method name and Class, and this wouldn't be too much slower than a conventional #perform:This particular example would let you dynamically call any method, but with all of the if-then-else equivalents with the then and else clauses swapped.
Would this constitute Smalltalk Macros?
I don't understand what you said, but in non-hygenic Lisp macros (the kind you get in CL, Arc, and Clojure) a macro is simply a function that expands into code before being compiled or evaluated. You can almost think of it as an extremely clever query-replace functionality in your text editor that always happens before you compile or run your program.
This is why so many Lispers claim that Lisp is at the top of the heap when it comes to language power. If you can arbitrarily expand your code into some other form at compile time, you can pretty much do anything any other language can do. A canonical example of this is that the object system added to Common Lisp is just a bunch of macros. Name your programming paradigm, and there's a very good chance someone has implemented it in Lisp, with macros.
What you describe sounds more complex than Lisp macros, which brings us to the necessity of all the parentheses. The idea of macros only works well when the language is built up out of a data-structure supported by the language. In Lisp, of course, programs are lists and macros let you do anything to your program that you can do to a list. When people try to add "macros" to languages where the code is not a data structure, there usually needs to be some intermediate representation of the parse tree, and then things tend to start getting ugly as the relation to what the source code would look like is quickly lost.
Having said all that, I'm curious if anyone that knows both Smalltalk and Lisp can name concrete examples of programming in Smalltalk and finding something you were unable to do without macros.
What I find a little disgusting is when my "meta-programming" in Ruby starts doing things like when an exception occurs, it points to a line number slightly different than where it really is, or when the backtrace becomes all the more "hacked" with harder to understand things thrown in there. It serves to remind us that there are tradeoffs involved. Also there is the issue creating shareable modules and when you start hacking it away it can make it all the more harder to share. But it's more than fun, it does work, it's just that one can have mixed feelings because for ever cool finding or development, there can exist a little nuisance as well or something that you cannot quite do anymore because you deviated from mainstream...
I gotta go have lunch!
Be well.
(defmacro foo (args go here) `(code goes ,here))
On the other hand, Scheme has this monstrosity for defining macros that I can't describe because I never managed to keep straight in my head how it was supposed to work.Hygiene is a red-herring. It's easy enough to achieve with a defmacro-style macro system - just use gensyms.
Hygiene can also be baked-in to a nice lispy defmacro-style system; there's no reason that hygienic macros have to be scheme-style. Variable capture can be permitted with a (capture x) special form. (I like to use ^x as a shorthand for that).
At that point, macros start behaving scope-wise similarly to lexical functions, and captured variables behave kind of like dynamic variables in a function.
It suddenly occurs to me that this form of hygiene could be implemented in the expansion of let, lambda and defun forms, at which point (someone yell at me please if I'm wrong), plain-ol' defmacros would be hygienic, unless there's a type of variable capture that I'm forgetting about right now...
> It's easy enough to achieve with a defmacro-style macro system - just use gensyms.
Gensym cannot prevent global identifiers from being shadowed in macro use environment.
(define-macro (my-if a b c) `(if ,a ,b ,c))
(define (boo)
(let ((if list)) ; if is shadowed
(my-if 'x 'y 'z))) ; evaluates to (x y z), not y
In CL you don't need to worry much, since (a) it is Lisp-2 so variables won't shadow operators, and (b) using packages greatly reduces accidental shadowing. In Scheme the chance is much higher; you probably don't bind 'if' locally, but you can't check every user-defined global procedures the macro inserts into the output. (define-macro (my-if a b c) `(std.if ,a ,b ,c))
(define (boo)
(let ((if list)) ; if is shadowed
(my-if 'x 'y 'z))) ; gives (std.if x y z)
(define (boo2)
(let ((std.if list)) ; error! cannot shadow module vars.
(my-if 'x 'y 'z)))
I've posted this around a few times asking why this isn't already used in Lisps and never seem to get a convincing argument back. The only conclusion I can draw from this is that CL-ers are ashamed of the fact that multiple namespaces aren't actually necessary and Schemers are rightly ashamed of hygienic macros. Please convincingly prove me wrong!(ps. This ofcourse would not be limited to the languages std module but would also apply to any exported module symbols.)
Then there's a macro in Arc, for example,
(mac awhen (expr . body)
`(let it ,expr (if it (do ,@body))))
which, on the one hand, yes it is true it's not hygienic. But, on the other hand, I can bang out in seconds. So now I'm moving ahead writing my program instead of struggling to write a macro. And the lack of hygiene has never been an actual problem for me in practice.I imagine that a Scheme programmer who was experienced in writing hygienic macros and so could write them quickly, and who was more bothered by the lack of hygiene than I am, could well reach a different cost/benefit decision than I do and decide they'd rather go with hygienic macros.
It's a wonderful thing to have a language that matches how you think, an extension of your mind analogous to how physical tools can be an extension of your body, with a heft, weight and balance that causes them to leap to hand, and guide you at times.
But my particular tasks at the moment involve so much more work at the drawing board (the figuring stage) that having better tools doesn't actually help me - much as I would love them to.
It's very true that the tools you need depend on your personal way of thinking, the task, the stage of the task, and how many times you've done it.
That said, have fun with Arc ;-)