Hacker News new | ask | show | jobs
by mahmud 6230 days ago
> Can you give me an example of a snide remark that could be rewritten?

Here is a quick list of what I think needs further deliberation and scrutiny on your part.

> 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.

[You came to the wrong Lisp then, as Arc has no libraries compared to all the mainstream lisp dialects]

> I found the [Scheme] rationale of hygienic macros -- avoiding all possibility of conflicting identifiers in macro expansions -- to be compelling. After all, who would want to write a macro that breaks just because the user happens to be using a variable of the same name as one used in the macro?

[Actually, scheme's hygienic macros shift the burden of capture-avoidance to the compiler. It's CL that has to use gensym.]

>I now understand that all these language features that people work hard to create solve some problem, and it can be a useful and important problem to solve, and yet it can be a problem I don’t care about, a problem I don’t have. That doesn’t necessarily make it a bad language feature, but it can make it one that I don’t want to pay the cost of using.

[This is fraught with reasoning errors. If you want a language that only has the features you want, create your own DSL. And even after that, you might apply that a la carte reasoning to the runtime and question why you might need a certain garbage collector, if any at all, or why you might need your runtime to have bindings for the OS system calls when you don't use them. Slippery slope. Richness is usually a good thing, not bad.]

>Yet in Java, it’s hard to get anything shorter than ten or twenty lines of code. See some code duplication, and by the time you’ve written the classes and interfaces and methods you need to write to remove the duplication, the code is just as long as it was before.

[A personal opinion that will send java programmers in uproar. not that java doesn't suck ;-]

>Languages written by hackers for hackers like Perl and Ruby and Python are lots better (and, I find for myself, a lot more productive for me for the kinds of projects I work on), and I can write shorter programs in them, yet they don’t help me go further

[and now the Perl, Python and Ruby programmers feel trolled and will jump at your neck. You requirements are of the DWIM kind.]

>they don’t help me make my program shorter.

[Yes, and an Aston Martin can't tow a boat. Right tool for the job]

>Now I see some pattern in my code, if I’m doing more typing than I want to be doing, BAM I write a macro and use it. Just like that

[and the Lisp programmer collective is surprised by your surprise.]

and so on and so forth.

3 comments

[You came to the wrong Lisp then, as Arc has no libraries compared to all the mainstream lisp dialects]

I'm not saying that Arc has better libraries than other Lisps, I'm saying that for me the advantages of Arc outweigh for me the disadvantages of not having the libraries that other languages do.

[Actually, scheme's hygienic macros shift the burden of capture-avoidance to the compiler. It's CL that has to use gensym.]

Yes, what I was saying was that when I learned about hygienic macros I thought they were a good idea for that reason.

Richness is usually a good thing

If I can choose to use a feature or not (as it typical with libraries: I can choose to use a library or not) then the cost to me of a feature that I don't want is zero; if I have to use a feature or it is harder to avoid then it matters to me whether the cost to me of that feature outweighs the benefit to me.

A personal opinion

Not at all. While it wasn't the purpose of my thank-you to do such a demonstration, it's easy to compare the relative length of code needed to do a particular implementation in different languages.

feel trolled

Yes, perhaps it is common for people who like X to be mad if I say that I prefer Y.

DWIM kind

I'm not following you.

and the Lisp programmer collective is surprised by your surprise

Perhaps they have had better luck than I have at writing hygienic macros.

None of the remarks you list seem snide to me.
His intent has been "largely positive", but what do you expect people to say after his "Perl, Python, Ruby, Java, Scheme and Common Lisp suck because they didn't allow me to write compact code" remarks?

Here is what will happen: Perl and Ruby programmers will ask you to show code and they will rewrite it in one-liners. Java and Python programmers will stuff code into packages/modules and write a tiny 5-line "client" for it. And Scheme and Common Lisp programmers will take absolute pleasure in skinning your argument about macrology and hygiene, the Common Lispers keeping a bucket of salt nearby for the rubbing.

"Yet in Java, it’s hard to get anything shorter than ten or twenty lines of code."

I am a Java programmer, I find much to like about Java, and I agree totally with this statement. I tried writing some functionality in Clojure, then re-writing in Java. It was a factor of 2 or 3 increase in lines of code.