Arc Forumnew | comments | leaders | submitlogin
1 point by evanrmurphy 4850 days ago | link | parent

> Common Lisp's wise design decision to separate the variable namespace from the function namespace eliminates an entire dimension of unwanted variable capture problems. [...] when programming sophisticated macros it can be hard enough to keep track of symbols in a single, isolated namespace. Having any cross-pollination of names to consider just makes macro writing more difficult than it needs to be.

I still haven't run into any problems re: Arc being a lisp-1 with unhygienic macros. Has anybody else?



2 points by rocketnia 4849 days ago | link

I have here and there, but renaming something is easy enough in a small codebase.

Still, when I'm writing code I don't know how I'll use in practice, I try to plug up abstraction leaks whenever I can, in the "why write programs with small bugs when you can write programs with no bugs" spirit.

I've been discovering that my purer utilities are useful in unexpected places, where what once was future-proofing is now essential to their newfound role. I don't think this is a particular advantage of hygienic/minimalistic stuff over more off-the-cuff or bundle-of-features systems, but I do enjoy being able to justify the "shape" of a utility completely in terms of its original motive.

...Whoops, you weren't asking about hygiene in general. XD Pretend I'm starting this post from scratch! * whoosh, changes costume*

I'm not sure what being a lisp-1 has to do with it, really. well, actually...

I suppose it's a little less likely for someone to need a local function than a local anything-else, but when they do need that, the local functions can still be captured by conventional gensym-savvy macros, right? So a lisp-2 can develop a culture of "don't use macros inside an 'flet unless you know what they expand to," whereas a lisp-1's corresponding "don't use macros except at global scope unless you know what they expand to" isn't quite as tractable.

When it comes to this kind of variable capture, I haven't encountered the problem or bothered writing code in a way that avoids it, even though I put up some possible techniques in a recent Semi-Arc thread. (This is exactly the issue Semi-Arc's hygiene should eliminate.) At this point, I almost consider my code to be better future-proofed if it's Penknife code that uses hygiene, and I'm just crossing my fingers that the Arc code will never capture in practice.

-----

1 point by akkartik 4849 days ago | link

Not me. Though I see 'rationally' that a single namespace adds more pressure on names, and I see that rocketnia is concerned about accidental lexical capture with his patterns like do.foo.

Perhaps dozens of programmers contributing code simultaneously makes collisions more likely. I doubt any of us have that sort of experience with lisp.

-----