News for hackers. Stuff that matters.
Re:A Year in Clojure by chongli on Sunday October 07, 2018 @11:34AM (#18161052)
I took a course in Racket in first year (required for all first year math/CS students at my school) and I've spent some time in the Clojure community as well. "Code as data" is an oft-repeated selling point of Lisp and Lisp-like languages.

When you actually start using these languages, you find yourself tempted to leverage this property and try writing lots of macros. But then you go back to the community and everyone tells you "the first rule of macros is you don't write macros." It turns out that if you use macros all over the place then your code becomes impenetrable. The problem is that macros allow you to circumvent the expected order of evaluation and produce your own novel syntactic structures. This puts lie to the old claim "Lisp has no syntax." In reality, Lisp has tons of syntax, it's just informal and buried within the definitions of macros.

It parallels the problem put forth in Jo Freeman's famous piece, "The Tyranny of Structurelessness" [1]. Any group that purports to adopt a structureless organization ends up having a hidden, informal structure. This is the way of Lisps as well.

[1] https://www.jofreeman.com/joreen/tyranny.htm

Re:A Year in Clojure by agumonkey on Sunday October 07, 2018 @04:22PM (#18162443)
There's also one very easy to understand part of the 1st rule. A macro is still a piece of logic, and functions do that very well, so do as most as you can as functions at the metalevel so you can enjoy ease of debugging and everything else; then coat it with macro sugar.
Re:A Year in Clojure by lvh on Sunday October 07, 2018 @12:12PM (#18161263)
Clearly languages have common idioms. Lisp just has most of them implemented in terms of very basic idioms. Saying “macros are bad because you can overdo it” is a little silly. Sure: prefer plain old data manipulation over syntax manipulation. But when you actually want syntax manipulation, it’s pretty darn nice.

Equivalent arguments exist for Ruby. Ruby isn’t bad because someone wrote a DSL that should’ve been a method and maybe a hash.

Re:A Year in Clojure by ech085 on Sunday October 07, 2018 @12:49PM (#18161469)
That was a fantastic read, so much insight into group dynamics!
Re:A Year in Clojure by moocowtruck on Sunday October 07, 2018 @12:11PM (#18161257)
i think https://www.cs.kent.ac.uk/people/staff/dat/miranda/wadler87.... 'why calculating is better than scheming' also makes this point too; i'm going to check out this jofreeman thing... never saw it before thanks!
Re:A Year in Clojure by lvh on Sunday October 07, 2018 @12:15PM (#18161274)
The author is one of the principal folks behind Haskell. But I can’t help but point out that I promise you you’ve never heard of the five or so lanaguages he mentioned as an alternative approach, and somehow this Lisp thing is still around. I suppose that which is dead may never die :-)
Re:A Year in Clojure by dragonwriter on Sunday October 07, 2018 @06:54PM (#18163067)
> But I can’t help but point out that I promise you you’ve never heard of the five or so lanaguages he mentioned as an alternative approach

I actually had heard of at least KRC and Miranda even before the first time I've read the paper, but even if I hadn't I would immediately be able to think of several languages with some or all of the additional features over the Lisps he was comparing them to for which he describes them as superior to Lisp for the purpose, including some modern Lisp derivatives.

Pattern matching, mathematical notation, and static typing with use defined types are all features that have become more, not less, common in languages since the paper was written.

Re:A Year in Clojure by Volt on Monday October 08, 2018 @07:54PM (#18172299)
To be fair, Haskell is the Common Lisp of lazy functional languages. You don't hear much about Maclisp or Zetalisp anymore either.
Re:A Year in Clojure by malloryerik on Sunday October 07, 2018 @06:29PM (#18162963)
Was the Racket course based on How to Design Programs[1]? How was it?

[1]https://htdp.org

Re:A Year in Clojure by chongli on Sunday October 07, 2018 @06:41PM (#18163015)
Yes, it was! The course is called CS 135: Designing Functional Programs [1]. I really enjoyed it, though I think most of the first years hated the course. Most people come to school having experience with imperative languages like Python and Java. When they got to recursion in Racket they really struggled!

I happen to own a copy of HTDP which I bought for the course. It's a suggested textbook but not required at all. I haven't had time to go through it though.

[1] https://www.student.cs.uwaterloo.ca/~cs135/