
Macros: their power and challenges — (take 5 william-byrd) - fogus
http://clojure.com/blog/2012/02/16/take5-william-byrd.html
======
apgwoz
I hope that the macro system he's working on bares some fruit. Personally,
I've always liked explicit-renaming macros, as they provide you the benefits
of both hygiene and (almost) the convenience of defmacro. But, the pattern
language of syntax-rules makes it much easier to maintain macros, as you can
actually see what it is you're matching without first interpreting the series
of list operations... Hopefully the two will be married in some glorious way!

~~~
jlongster
Explicit renaming also gets annoying because it's done properly you need to
rename _everything_ , even basic forms like let, if, cond, etc.

~~~
apgwoz
Right, and that's the point. Though, I suppose it'd be easy enough to create a
code walker which renamed everything unless the symbol started with % or
something.

That, in my opinion is sort of the beauty of Clojure's macro system. By
default, all symbols referred to are expanded to there FQN unless of course
you use unquote.

My guess is that Byrd's problem with that is that it's not really a hygiene
solution so much as it is a system which takes full advantage of 2 things--
Clojure vars are immutable and namespaces are unique.

------
mindslight
I started writing a comment asking what is so complex about syntax-case, as
it's just pattern matching for procedural macros combined with the
optimization of bolted-on uber-symbols (syntax marks). Then I realized I'd
answered my own question.

I think clojure has a pretty good foundation for hygienic procedural macros -
increase the complexity of your symbol type and commit to their values asap.
Once you're in procedural macro land, you're inherently dealing with the
complexity of the syntax model, so it might as well be as simple as possible.

------
gwern
> Oleg is an emissary from some advanced alien race. Working with him is both
> exhausting and enlightening.

See? It's not just us Haskellers!

------
jules
Is the miniKanren talk available somewhere?

~~~
swannodette
Yep, [http://blip.tv/clojure/dan-friedman-and-william-byrd-
minikan...](http://blip.tv/clojure/dan-friedman-and-william-byrd-
minikanren-5936333)

~~~
apgwoz
Ack! blip doesn't have a non-flash option, nor does it work with gnash (at
least the versions I've tried).

~~~
ivank
youtube-dl handles blip.tv URLs

~~~
apgwoz
I also just found movgrab which seems to work fine. With youtube, I've been
using yturl and doing mplayer `yturl url` and that's worked fine, unless my
connection is spotty. If movgrab doesn't work right I'll try youtube-dl--
thanks!

