Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Mixing Our Way Out Of Instance Eval? (hackety.org)
14 points by sant0sk1 on Oct 6, 2008 | hide | past | favorite | 2 comments


I like this post a lot, but I'm going to make the point that while instance_eval DSLs may be on the outs in library code (where they screw up your current variable scope and cause bugs), they can work just fine in programs built around ad hoc DSLs --- where variable scope doesn't matter.

I'm glad he's thinking about ways that the Ruby standard library can help build "safe" DSLs --- and I'm glad he's doing it with library code, rather than advocating a dive down the sanitary-macros rathole --- but I can't help but think that the real problem here is that DSLs are a crappy abstraction for library code.

If you want your app to be built on and around DSLs, build DSLs. But libraries shouldn't dictate them, any more than they should dictate user interface.


I saw this a couple days ago in _why's github.

http://github.com/why/mixico/tree/master

You can install it and try out mixing in and out different modules




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: