This started as an experiment, and turned out to be something I think could be useful. Of course, there are some (documented) shortcomings. Just wondering what you guys think. Would you use something like this? Does it need a Rails plugin?
Thanks.
Oh and BTW, we have a meeting planned for June 15th. Is that a good date for everyone? Any ideas for presentations?
do you see an advantage of this over SASS? Just curious of your reasoning
behind doing it yourself as opposed to using a very popular library that
already does something like this.
> This started as an experiment, and turned out to be something I think
> could be useful. Of course, there are some (documented) shortcomings.
> Just wondering what you guys think. Would you use something like this?
> Does it need a Rails plugin?
> Thanks.
> Oh and BTW, we have a meeting planned for June 15th. Is that a good
> date for everyone? Any ideas for presentations?
On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com> wrote:
> do you see an advantage of this over SASS? Just curious of your reasoning
> behind doing it yourself as opposed to using a very popular library that
> already does something like this.
> On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com> wrote:
>> I just put some code up on GitHub I'd like to get some feedback on...
>> This started as an experiment, and turned out to be something I think
>> could be useful. Of course, there are some (documented) shortcomings.
>> Just wondering what you guys think. Would you use something like this?
>> Does it need a Rails plugin?
>> Thanks.
>> Oh and BTW, we have a meeting planned for June 15th. Is that a good
>> date for everyone? Any ideas for presentations?
> It looks simple enough, but I have to echo Hornbeck's post. One thing I
> like about SASS is that you don't have to use curly brackets.
> On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com> wrote:
>> do you see an advantage of this over SASS? Just curious of your reasoning
>> behind doing it yourself as opposed to using a very popular library that
>> already does something like this.
>> On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com> wrote:
>>> I just put some code up on GitHub I'd like to get some feedback on...
>>> This started as an experiment, and turned out to be something I think
>>> could be useful. Of course, there are some (documented) shortcomings.
>>> Just wondering what you guys think. Would you use something like this?
>>> Does it need a Rails plugin?
>>> Thanks.
>>> Oh and BTW, we have a meeting planned for June 15th. Is that a good
>>> date for everyone? Any ideas for presentations?
I think I like the spirit of this over SASS for the same reason I like
markaby/builder over haml. It's a ruby internal dsl, not an external
dsl with a new syntax. Clearly it's not as complete as sass, but I'd
feel more at home extending this to do crazy stuff.
Justin: there's always do ... end; :)
On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> It looks simple enough, but I have to echo Hornbeck's post. One
> thing I like about SASS is that you don't have to use curly brackets.
> On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
> wrote:
> do you see an advantage of this over SASS? Just curious of your
> reasoning behind doing it yourself as opposed to using a very
> popular library that already does something like this.
> On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com> wrote:
> I just put some code up on GitHub I'd like to get some feedback on...
> This started as an experiment, and turned out to be something I think
> could be useful. Of course, there are some (documented) shortcomings.
> Just wondering what you guys think. Would you use something like this?
> Does it need a Rails plugin?
> Thanks.
> Oh and BTW, we have a meeting planned for June 15th. Is that a good
> date for everyone? Any ideas for presentations?
> I think I like the spirit of this over SASS for the same reason I like
> markaby/builder over haml. It's a ruby internal dsl, not an external
> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
> feel more at home extending this to do crazy stuff.
> Justin: there's always do ... end; :)
> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> > It looks simple enough, but I have to echo Hornbeck's post. One
> > thing I like about SASS is that you don't have to use curly brackets.
> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
> > wrote:
> > do you see an advantage of this over SASS? Just curious of your
> > reasoning behind doing it yourself as opposed to using a very
> > popular library that already does something like this.
> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com> wrote:
> > I just put some code up on GitHub I'd like to get some feedback on...
> > This started as an experiment, and turned out to be something I think
> > could be useful. Of course, there are some (documented) shortcomings.
> > Just wondering what you guys think. Would you use something like this?
> > Does it need a Rails plugin?
> > Thanks.
> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
> > date for everyone? Any ideas for presentations?
> > -Tim
> > --
> > John Hornbeck
> > Support Manager
> > Engine Yard
> > http://engineyard.com
> > “Work hard to find something that fascinates you.” - Richard Feynman
> I think I like the spirit of this over SASS for the same reason I like
> markaby/builder over haml. It's a ruby internal dsl, not an external
> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
> feel more at home extending this to do crazy stuff.
> Justin: there's always do ... end; :)
> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> > It looks simple enough, but I have to echo Hornbeck's post. One
> > thing I like about SASS is that you don't have to use curly brackets.
> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
> > wrote:
> > do you see an advantage of this over SASS? Just curious of your
> > reasoning behind doing it yourself as opposed to using a very
> > popular library that already does something like this.
> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com> wrote:
> > I just put some code up on GitHub I'd like to get some feedback on...
> > This started as an experiment, and turned out to be something I think
> > could be useful. Of course, there are some (documented) shortcomings.
> > Just wondering what you guys think. Would you use something like this?
> > Does it need a Rails plugin?
> > Thanks.
> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
> > date for everyone? Any ideas for presentations?
> > -Tim
> > --
> > John Hornbeck
> > Support Manager
> > Engine Yard
> > http://engineyard.com
> > “Work hard to find something that fascinates you.” - Richard Feynman
> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <
> jos...@josephholsten.com> wrote:
>> I think I like the spirit of this over SASS for the same reason I like
>> markaby/builder over haml. It's a ruby internal dsl, not an external
>> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
>> feel more at home extending this to do crazy stuff.
>> Justin: there's always do ... end; :)
>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
>> > It looks simple enough, but I have to echo Hornbeck's post. One
>> > thing I like about SASS is that you don't have to use curly brackets.
>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
>> > wrote:
>> > do you see an advantage of this over SASS? Just curious of your
>> > reasoning behind doing it yourself as opposed to using a very
>> > popular library that already does something like this.
>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com> wrote:
>> > I just put some code up on GitHub I'd like to get some feedback on...
>> > This started as an experiment, and turned out to be something I think
>> > could be useful. Of course, there are some (documented) shortcomings.
>> > Just wondering what you guys think. Would you use something like this?
>> > Does it need a Rails plugin?
>> > Thanks.
>> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
>> > date for everyone? Any ideas for presentations?
>> > -Tim
>> > --
>> > John Hornbeck
>> > Support Manager
>> > Engine Yard
>> > http://engineyard.com
>> > “Work hard to find something that fascinates you.” - Richard Feynman
Internal dsls implement domain specific features entirely within a
host language. Think of them more like code than data. They're a bit
like tricked out libraries. They use the host language to parse the
dsl. They're quite popular in with TCL, lisp and ruby. examples:
markaby, rails (esp migrations), rake, emacs lisp, guile, macports
portfiles, .exrc, .shrc.
External dsls require a custom parser. Think of them more like data
than code. They're popular with unix, .net, java. examples: Ant, /etc/ passwd, csv, vcard, yaml configs, xml configs. Arguably every markup
language lies in here.
> I'm not following what you mean by internal vs. external dsl. Do
> explain
> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <jos...@josephholsten.com > > wrote:
> I think I like the spirit of this over SASS for the same reason I like
> markaby/builder over haml. It's a ruby internal dsl, not an external
> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
> feel more at home extending this to do crazy stuff.
> Justin: there's always do ... end; :)
> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> > It looks simple enough, but I have to echo Hornbeck's post. One
> > thing I like about SASS is that you don't have to use curly
> brackets.
> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
> > wrote:
> > do you see an advantage of this over SASS? Just curious of your
> > reasoning behind doing it yourself as opposed to using a very
> > popular library that already does something like this.
> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com>
> wrote:
> > I just put some code up on GitHub I'd like to get some feedback
> on...
> > This started as an experiment, and turned out to be something I
> think
> > could be useful. Of course, there are some (documented)
> shortcomings.
> > Just wondering what you guys think. Would you use something like
> this?
> > Does it need a Rails plugin?
> > Thanks.
> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
> > date for everyone? Any ideas for presentations?
> > -Tim
> > --
> > John Hornbeck
> > Support Manager
> > Engine Yard
> > http://engineyard.com
> > “Work hard to find something that fascinates you.” - Richard Feynman
> Internal dsls implement domain specific features entirely within a > host language. Think of them more like code than data. They're a bit > like tricked out libraries. They use the host language to parse the > dsl. They're quite popular in with TCL, lisp and ruby. examples: > markaby, rails (esp migrations), rake, emacs lisp, guile, macports > portfiles, .exrc, .shrc.
> External dsls require a custom parser. Think of them more like data > than code. They're popular with unix, .net, java. examples: Ant, /etc/ > passwd, csv, vcard, yaml configs, xml configs. Arguably every markup > language lies in here.
> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
>> I'm not following what you mean by internal vs. external dsl. Do >> explain
>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <jos...@josephholsten.com >> > wrote:
>> I think I like the spirit of this over SASS for the same reason I like >> markaby/builder over haml. It's a ruby internal dsl, not an external >> dsl with a new syntax. Clearly it's not as complete as sass, but I'd >> feel more at home extending this to do crazy stuff.
>> Justin: there's always do ... end; :)
>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
>> > It looks simple enough, but I have to echo Hornbeck's post. One >> > thing I like about SASS is that you don't have to use curly >> brackets.
>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com> >> > wrote: >> > do you see an advantage of this over SASS? Just curious of your >> > reasoning behind doing it yourself as opposed to using a very >> > popular library that already does something like this.
>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com> >> wrote:
>> > I just put some code up on GitHub I'd like to get some feedback >> on...
>> > This started as an experiment, and turned out to be something I >> think >> > could be useful. Of course, there are some (documented) >> shortcomings. >> > Just wondering what you guys think. Would you use something like >> this? >> > Does it need a Rails plugin?
>> > Thanks.
>> > Oh and BTW, we have a meeting planned for June 15th. Is that a good >> > date for everyone? Any ideas for presentations?
>> > -Tim
>> > -- >> > John Hornbeck >> > Support Manager >> > Engine Yard >> > http://engineyard.com
>> > “Work hard to find something that fascinates you.” - Richard Feynman
>> “Work hard to find something that fascinates you.” - Richard Feynman
> --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups "Tulsa Ruby User Group" group. > To post to this group, send email to tulsarb@googlegroups.com > To unsubscribe from this group, send email to tulsarb+unsubscribe@googlegroups.com > For more options, visit this group at http://groups.google.com/
Thanks Joseph for that wonderful explanation. Yes, this library is a
bonefied DSL, meaning the code is actual Ruby. Sass, on the other
hand, is interpreted as it's own language. With the DSL approach, I'm
able to mix in regular Ruby variables, require Ruby libraries, do
color arithmetic, heck I could even pull CSS colors and font sizes out
of my database and write them directly in my CSS file.
As for why I did it... because I can. Isn't that the best reason of
all? :-) No really, it was just an experiment, and turned out to be
less than 100 lines of code. And I figure it might be useful as a part
of OneBody or another project someday.
>> Internal dsls implement domain specific features entirely within a
>> host language. Think of them more like code than data. They're a bit
>> like tricked out libraries. They use the host language to parse the
>> dsl. They're quite popular in with TCL, lisp and ruby. examples:
>> markaby, rails (esp migrations), rake, emacs lisp, guile, macports
>> portfiles, .exrc, .shrc.
>> External dsls require a custom parser. Think of them more like data
>> than code. They're popular with unix, .net, java. examples: Ant, /etc/
>> passwd, csv, vcard, yaml configs, xml configs. Arguably every markup
>> language lies in here.
>> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
>>> I'm not following what you mean by internal vs. external dsl. Do
>>> explain
>>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <jos...@josephholsten.com
>>> > wrote:
>>> I think I like the spirit of this over SASS for the same reason I like
>>> markaby/builder over haml. It's a ruby internal dsl, not an external
>>> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
>>> feel more at home extending this to do crazy stuff.
>>> Justin: there's always do ... end; :)
>>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
>>> > It looks simple enough, but I have to echo Hornbeck's post. One
>>> > thing I like about SASS is that you don't have to use curly
>>> brackets.
>>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
>>> > wrote:
>>> > do you see an advantage of this over SASS? Just curious of your
>>> > reasoning behind doing it yourself as opposed to using a very
>>> > popular library that already does something like this.
>>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com>
>>> wrote:
>>> > I just put some code up on GitHub I'd like to get some feedback
>>> on...
>>> > This started as an experiment, and turned out to be something I
>>> think
>>> > could be useful. Of course, there are some (documented)
>>> shortcomings.
>>> > Just wondering what you guys think. Would you use something like
>>> this?
>>> > Does it need a Rails plugin?
>>> > Thanks.
>>> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
>>> > date for everyone? Any ideas for presentations?
>>> > -Tim
>>> > --
>>> > John Hornbeck
>>> > Support Manager
>>> > Engine Yard
>>> > http://engineyard.com
>>> > “Work hard to find something that fascinates you.” - Richard Feynman
>>> --
>>> John Hornbeck
>>> Support Manager
>>> Engine Yard
>>> http://engineyard.com
>>> “Work hard to find something that fascinates you.” - Richard Feynman
On Wed, Jun 3, 2009 at 9:04 AM, Tim Morgan <t...@timmorgan.org> wrote:
> Thanks Joseph for that wonderful explanation. Yes, this library is a
> bonefied DSL, meaning the code is actual Ruby. Sass, on the other
> hand, is interpreted as it's own language. With the DSL approach, I'm
> able to mix in regular Ruby variables, require Ruby libraries, do
> color arithmetic, heck I could even pull CSS colors and font sizes out
> of my database and write them directly in my CSS file.
> As for why I did it... because I can. Isn't that the best reason of
> all? :-) No really, it was just an experiment, and turned out to be
> less than 100 lines of code. And I figure it might be useful as a part
> of OneBody or another project someday.
> Thanks for your feedback!
> On Wed, Jun 3, 2009 at 12:10 AM, John Hornbeck <hornb...@gmail.com> wrote:
>> Ahh, makes sense now :-)
>> On Wednesday, June 3, 2009, Joseph A Holsten <jos...@josephholsten.com> wrote:
>>> Internal dsls implement domain specific features entirely within a
>>> host language. Think of them more like code than data. They're a bit
>>> like tricked out libraries. They use the host language to parse the
>>> dsl. They're quite popular in with TCL, lisp and ruby. examples:
>>> markaby, rails (esp migrations), rake, emacs lisp, guile, macports
>>> portfiles, .exrc, .shrc.
>>> External dsls require a custom parser. Think of them more like data
>>> than code. They're popular with unix, .net, java. examples: Ant, /etc/
>>> passwd, csv, vcard, yaml configs, xml configs. Arguably every markup
>>> language lies in here.
>>> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
>>>> I'm not following what you mean by internal vs. external dsl. Do
>>>> explain
>>>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <jos...@josephholsten.com
>>>> > wrote:
>>>> I think I like the spirit of this over SASS for the same reason I like
>>>> markaby/builder over haml. It's a ruby internal dsl, not an external
>>>> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
>>>> feel more at home extending this to do crazy stuff.
>>>> Justin: there's always do ... end; :)
>>>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
>>>> > It looks simple enough, but I have to echo Hornbeck's post. One
>>>> > thing I like about SASS is that you don't have to use curly
>>>> brackets.
>>>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
>>>> > wrote:
>>>> > do you see an advantage of this over SASS? Just curious of your
>>>> > reasoning behind doing it yourself as opposed to using a very
>>>> > popular library that already does something like this.
>>>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com>
>>>> wrote:
>>>> > I just put some code up on GitHub I'd like to get some feedback
>>>> on...
>>>> > This started as an experiment, and turned out to be something I
>>>> think
>>>> > could be useful. Of course, there are some (documented)
>>>> shortcomings.
>>>> > Just wondering what you guys think. Would you use something like
>>>> this?
>>>> > Does it need a Rails plugin?
>>>> > Thanks.
>>>> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
>>>> > date for everyone? Any ideas for presentations?
>>>> > -Tim
>>>> > --
>>>> > John Hornbeck
>>>> > Support Manager
>>>> > Engine Yard
>>>> > http://engineyard.com
>>>> > “Work hard to find something that fascinates you.” - Richard Feynman
>>>> --
>>>> John Hornbeck
>>>> Support Manager
>>>> Engine Yard
>>>> http://engineyard.com
>>>> “Work hard to find something that fascinates you.” - Richard Feynman
Personally I dislike all the crazy CSS DSLs, and I actually tend to use some
simple ERB templates to generate CSS instead of a full blown CSS DSL. But o
stand up in defense of SASS.
The advantage to an external DSL is that you don't HAVE to know a lot of
details about the hosting language to be able ti use the DSL. While Tim's
code is pretty slick, it suffers from a few issues, some easy to fix, others
not.
The first being because you don't inherit from a BlankSlate (or similar)
base class, any method available on the Object class cannot be used as a
selector name without using the s() method. Try using the name 'id' as a
selector. As mentioned this is somewhat easier to fix by using BlankSlate
or something similar to undefine all the default methods.
The second is that you can't use any ruby keywords as selectors. As long as
you use instance_eval to run the raw code without doing any sort of parsing
this will remain true.
Obviously those aren't a big deal if you know Ruby, and are aware of the
limitations. But it does come with it's own set of "gotchas" that an
external DSL doesn't have to worry about.
All of that said, I've already forked this and look forward to tinkering
with it!
On Wed, Jun 3, 2009 at 9:11 AM, Tim Morgan <t...@timmorgan.org> wrote:
> Let me clarify: CascadingRubies is an internal Ruby DSL -- not an
> external interpreted one like Sass. Cuz I said that kinda funny.
> On Wed, Jun 3, 2009 at 9:04 AM, Tim Morgan <t...@timmorgan.org> wrote:
> > Thanks Joseph for that wonderful explanation. Yes, this library is a
> > bonefied DSL, meaning the code is actual Ruby. Sass, on the other
> > hand, is interpreted as it's own language. With the DSL approach, I'm
> > able to mix in regular Ruby variables, require Ruby libraries, do
> > color arithmetic, heck I could even pull CSS colors and font sizes out
> > of my database and write them directly in my CSS file.
> > As for why I did it... because I can. Isn't that the best reason of
> > all? :-) No really, it was just an experiment, and turned out to be
> > less than 100 lines of code. And I figure it might be useful as a part
> > of OneBody or another project someday.
> > Thanks for your feedback!
> > On Wed, Jun 3, 2009 at 12:10 AM, John Hornbeck <hornb...@gmail.com>
> wrote:
> >> Ahh, makes sense now :-)
> >> On Wednesday, June 3, 2009, Joseph A Holsten <jos...@josephholsten.com>
> wrote:
> >>> Internal dsls implement domain specific features entirely within a
> >>> host language. Think of them more like code than data. They're a bit
> >>> like tricked out libraries. They use the host language to parse the
> >>> dsl. They're quite popular in with TCL, lisp and ruby. examples:
> >>> markaby, rails (esp migrations), rake, emacs lisp, guile, macports
> >>> portfiles, .exrc, .shrc.
> >>> External dsls require a custom parser. Think of them more like data
> >>> than code. They're popular with unix, .net, java. examples: Ant, /etc/
> >>> passwd, csv, vcard, yaml configs, xml configs. Arguably every markup
> >>> language lies in here.
> >>> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
> >>>> I'm not following what you mean by internal vs. external dsl. Do
> >>>> explain
> >>>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <
> jos...@josephholsten.com
> >>>> > wrote:
> >>>> I think I like the spirit of this over SASS for the same reason I like
> >>>> markaby/builder over haml. It's a ruby internal dsl, not an external
> >>>> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
> >>>> feel more at home extending this to do crazy stuff.
> >>>> Justin: there's always do ... end; :)
> >>>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> >>>> > It looks simple enough, but I have to echo Hornbeck's post. One
> >>>> > thing I like about SASS is that you don't have to use curly
> >>>> brackets.
> >>>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
> >>>> > wrote:
> >>>> > do you see an advantage of this over SASS? Just curious of your
> >>>> > reasoning behind doing it yourself as opposed to using a very
> >>>> > popular library that already does something like this.
> >>>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com>
> >>>> wrote:
> >>>> > I just put some code up on GitHub I'd like to get some feedback
> >>>> on...
> >>>> > This started as an experiment, and turned out to be something I
> >>>> think
> >>>> > could be useful. Of course, there are some (documented)
> >>>> shortcomings.
> >>>> > Just wondering what you guys think. Would you use something like
> >>>> this?
> >>>> > Does it need a Rails plugin?
> >>>> > Thanks.
> >>>> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
> >>>> > date for everyone? Any ideas for presentations?
OK, I just released 0.2.0 of my gem. This version addresses a few of
the shortcomings the library had with version 0.1.0.
* Use of BlankSlate and other tricks to clean up the instance_eval
space and avoid
stepping on potential selectors and rules.
* Easily generate comma-separated selectors via the DSL.
* New optional block syntax for rcss files.
Thanks so much for your valuable feedback everyone.
On Wed, Jun 3, 2009 at 9:37 AM, Tanner Burson <tanner.bur...@gmail.com> wrote:
> Personally I dislike all the crazy CSS DSLs, and I actually tend to use some
> simple ERB templates to generate CSS instead of a full blown CSS DSL. But o
> stand up in defense of SASS.
> The advantage to an external DSL is that you don't HAVE to know a lot of
> details about the hosting language to be able ti use the DSL. While Tim's
> code is pretty slick, it suffers from a few issues, some easy to fix, others
> not.
> The first being because you don't inherit from a BlankSlate (or similar)
> base class, any method available on the Object class cannot be used as a
> selector name without using the s() method. Try using the name 'id' as a
> selector. As mentioned this is somewhat easier to fix by using BlankSlate
> or something similar to undefine all the default methods.
> The second is that you can't use any ruby keywords as selectors. As long as
> you use instance_eval to run the raw code without doing any sort of parsing
> this will remain true.
> Obviously those aren't a big deal if you know Ruby, and are aware of the
> limitations. But it does come with it's own set of "gotchas" that an
> external DSL doesn't have to worry about.
> All of that said, I've already forked this and look forward to tinkering
> with it!
> --Tanner Burson
> On Wed, Jun 3, 2009 at 9:11 AM, Tim Morgan <t...@timmorgan.org> wrote:
>> Let me clarify: CascadingRubies is an internal Ruby DSL -- not an
>> external interpreted one like Sass. Cuz I said that kinda funny.
>> On Wed, Jun 3, 2009 at 9:04 AM, Tim Morgan <t...@timmorgan.org> wrote:
>> > Thanks Joseph for that wonderful explanation. Yes, this library is a
>> > bonefied DSL, meaning the code is actual Ruby. Sass, on the other
>> > hand, is interpreted as it's own language. With the DSL approach, I'm
>> > able to mix in regular Ruby variables, require Ruby libraries, do
>> > color arithmetic, heck I could even pull CSS colors and font sizes out
>> > of my database and write them directly in my CSS file.
>> > As for why I did it... because I can. Isn't that the best reason of
>> > all? :-) No really, it was just an experiment, and turned out to be
>> > less than 100 lines of code. And I figure it might be useful as a part
>> > of OneBody or another project someday.
>> > Thanks for your feedback!
>> > On Wed, Jun 3, 2009 at 12:10 AM, John Hornbeck <hornb...@gmail.com>
>> > wrote:
>> >> Ahh, makes sense now :-)
>> >> On Wednesday, June 3, 2009, Joseph A Holsten <jos...@josephholsten.com>
>> >> wrote:
>> >>> Internal dsls implement domain specific features entirely within a
>> >>> host language. Think of them more like code than data. They're a bit
>> >>> like tricked out libraries. They use the host language to parse the
>> >>> dsl. They're quite popular in with TCL, lisp and ruby. examples:
>> >>> markaby, rails (esp migrations), rake, emacs lisp, guile, macports
>> >>> portfiles, .exrc, .shrc.
>> >>> External dsls require a custom parser. Think of them more like data
>> >>> than code. They're popular with unix, .net, java. examples: Ant, /etc/
>> >>> passwd, csv, vcard, yaml configs, xml configs. Arguably every markup
>> >>> language lies in here.
>> >>> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
>> >>>> I'm not following what you mean by internal vs. external dsl. Do
>> >>>> explain
>> >>>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten
>> >>>> <jos...@josephholsten.com
>> >>>> > wrote:
>> >>>> I think I like the spirit of this over SASS for the same reason I
>> >>>> like
>> >>>> markaby/builder over haml. It's a ruby internal dsl, not an external
>> >>>> dsl with a new syntax. Clearly it's not as complete as sass, but I'd
>> >>>> feel more at home extending this to do crazy stuff.
>> >>>> Justin: there's always do ... end; :)
>> >>>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
>> >>>> > It looks simple enough, but I have to echo Hornbeck's post. One
>> >>>> > thing I like about SASS is that you don't have to use curly
>> >>>> brackets.
>> >>>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com>
>> >>>> > wrote:
>> >>>> > do you see an advantage of this over SASS? Just curious of your
>> >>>> > reasoning behind doing it yourself as opposed to using a very
>> >>>> > popular library that already does something like this.
>> >>>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com>
>> >>>> wrote:
>> >>>> > I just put some code up on GitHub I'd like to get some feedback
>> >>>> on...
>> >>>> > This started as an experiment, and turned out to be something I
>> >>>> think
>> >>>> > could be useful. Of course, there are some (documented)
>> >>>> shortcomings.
>> >>>> > Just wondering what you guys think. Would you use something like
>> >>>> this?
>> >>>> > Does it need a Rails plugin?
>> >>>> > Thanks.
>> >>>> > Oh and BTW, we have a meeting planned for June 15th. Is that a good
>> >>>> > date for everyone? Any ideas for presentations?
That's a great point, and I'm sure there's a bunch of other standard
internal DSL issues that I don't even know to check for. I'm kinda
amazed there isn't a 'Building DSLs in Ruby' book.
has anyone gone through this:
http://obiefernandez.com/presentations/obie_fernandez-agile_dsl_devel... Seems like cascading rubies is a straightforward instatiation dsl, but
there's some other nifty examples in there too. I also learned some
tricks from:
http://www.scribd.com/doc/12709855/Advanced-DSLs-in-Ruby esp, const factories, instance_eval'ing, the fuzzy line between
internal & external. Neal ford seems to have quite a few good presos
on dsls if you need some google fu.
> Personally I dislike all the crazy CSS DSLs, and I actually tend to
> use some simple ERB templates to generate CSS instead of a full
> blown CSS DSL. But o stand up in defense of SASS.
> The advantage to an external DSL is that you don't HAVE to know a
> lot of details about the hosting language to be able ti use the
> DSL. While Tim's code is pretty slick, it suffers from a few
> issues, some easy to fix, others not.
> The first being because you don't inherit from a BlankSlate (or
> similar) base class, any method available on the Object class cannot
> be used as a selector name without using the s() method. Try using
> the name 'id' as a selector. As mentioned this is somewhat easier
> to fix by using BlankSlate or something similar to undefine all the
> default methods.
> The second is that you can't use any ruby keywords as selectors. As
> long as you use instance_eval to run the raw code without doing any
> sort of parsing this will remain true.
> Obviously those aren't a big deal if you know Ruby, and are aware of
> the limitations. But it does come with it's own set of "gotchas"
> that an external DSL doesn't have to worry about.
> All of that said, I've already forked this and look forward to
> tinkering with it!
> --Tanner Burson
> On Wed, Jun 3, 2009 at 9:11 AM, Tim Morgan <t...@timmorgan.org> wrote:
> Let me clarify: CascadingRubies is an internal Ruby DSL -- not an
> external interpreted one like Sass. Cuz I said that kinda funny.
> On Wed, Jun 3, 2009 at 9:04 AM, Tim Morgan <t...@timmorgan.org> wrote:
> > Thanks Joseph for that wonderful explanation. Yes, this library is a
> > bonefied DSL, meaning the code is actual Ruby. Sass, on the other
> > hand, is interpreted as it's own language. With the DSL approach,
> I'm
> > able to mix in regular Ruby variables, require Ruby libraries, do
> > color arithmetic, heck I could even pull CSS colors and font sizes
> out
> > of my database and write them directly in my CSS file.
> > As for why I did it... because I can. Isn't that the best reason of
> > all? :-) No really, it was just an experiment, and turned out to be
> > less than 100 lines of code. And I figure it might be useful as a
> part
> > of OneBody or another project someday.
> > Thanks for your feedback!
> > On Wed, Jun 3, 2009 at 12:10 AM, John Hornbeck
> <hornb...@gmail.com> wrote:
> >> Ahh, makes sense now :-)
> >> On Wednesday, June 3, 2009, Joseph A Holsten <jos...@josephholsten.com > > wrote:
> >>> Internal dsls implement domain specific features entirely within a
> >>> host language. Think of them more like code than data. They're a
> bit
> >>> like tricked out libraries. They use the host language to parse
> the
> >>> dsl. They're quite popular in with TCL, lisp and ruby. examples:
> >>> markaby, rails (esp migrations), rake, emacs lisp, guile, macports
> >>> portfiles, .exrc, .shrc.
> >>> External dsls require a custom parser. Think of them more like
> data
> >>> than code. They're popular with unix, .net, java. examples:
> Ant, /etc/
> >>> passwd, csv, vcard, yaml configs, xml configs. Arguably every
> markup
> >>> language lies in here.
> >>> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
> >>>> I'm not following what you mean by internal vs. external dsl. Do
> >>>> explain
> >>>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <jos...@josephholsten.com
> >>>> > wrote:
> >>>> I think I like the spirit of this over SASS for the same reason
> I like
> >>>> markaby/builder over haml. It's a ruby internal dsl, not an
> external
> >>>> dsl with a new syntax. Clearly it's not as complete as sass,
> but I'd
> >>>> feel more at home extending this to do crazy stuff.
> >>>> Justin: there's always do ... end; :)
> >>>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> >>>> > It looks simple enough, but I have to echo Hornbeck's post. > One
> >>>> > thing I like about SASS is that you don't have to use curly
> >>>> brackets.
> >>>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com
> >>>> > wrote:
> >>>> > do you see an advantage of this over SASS? Just curious of your
> >>>> > reasoning behind doing it yourself as opposed to using a very
> >>>> > popular library that already does something like this.
> >>>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com>
> >>>> wrote:
> >>>> > I just put some code up on GitHub I'd like to get some feedback
> >>>> on...
> >>>> > This started as an experiment, and turned out to be something I
> >>>> think
> >>>> > could be useful. Of course, there are some (documented)
> >>>> shortcomings.
> >>>> > Just wondering what you guys think. Would you use something
> like
> >>>> this?
> >>>> > Does it need a Rails plugin?
> >>>> > Thanks.
> >>>> > Oh and BTW, we have a meeting planned for June 15th. Is that
> a good
> >>>> > date for everyone? Any ideas for presentations?
> That's a great point, and I'm sure there's a bunch of other standard
> internal DSL issues that I don't even know to check for. I'm kinda
> amazed there isn't a 'Building DSLs in Ruby' book.
> has anyone gone through this:
> On Jun 3, 2009, at 9:37 AM, Tanner Burson wrote:
> > Personally I dislike all the crazy CSS DSLs, and I actually tend to
> > use some simple ERB templates to generate CSS instead of a full
> > blown CSS DSL. But o stand up in defense of SASS.
> > The advantage to an external DSL is that you don't HAVE to know a
> > lot of details about the hosting language to be able ti use the
> > DSL. While Tim's code is pretty slick, it suffers from a few
> > issues, some easy to fix, others not.
> > The first being because you don't inherit from a BlankSlate (or
> > similar) base class, any method available on the Object class cannot
> > be used as a selector name without using the s() method. Try using
> > the name 'id' as a selector. As mentioned this is somewhat easier
> > to fix by using BlankSlate or something similar to undefine all the
> > default methods.
> > The second is that you can't use any ruby keywords as selectors. As
> > long as you use instance_eval to run the raw code without doing any
> > sort of parsing this will remain true.
> > Obviously those aren't a big deal if you know Ruby, and are aware of
> > the limitations. But it does come with it's own set of "gotchas"
> > that an external DSL doesn't have to worry about.
> > All of that said, I've already forked this and look forward to
> > tinkering with it!
> > --Tanner Burson
> > On Wed, Jun 3, 2009 at 9:11 AM, Tim Morgan <t...@timmorgan.org> wrote:
> > Let me clarify: CascadingRubies is an internal Ruby DSL -- not an
> > external interpreted one like Sass. Cuz I said that kinda funny.
> > On Wed, Jun 3, 2009 at 9:04 AM, Tim Morgan <t...@timmorgan.org> wrote:
> > > Thanks Joseph for that wonderful explanation. Yes, this library is a
> > > bonefied DSL, meaning the code is actual Ruby. Sass, on the other
> > > hand, is interpreted as it's own language. With the DSL approach,
> > I'm
> > > able to mix in regular Ruby variables, require Ruby libraries, do
> > > color arithmetic, heck I could even pull CSS colors and font sizes
> > out
> > > of my database and write them directly in my CSS file.
> > > As for why I did it... because I can. Isn't that the best reason of
> > > all? :-) No really, it was just an experiment, and turned out to be
> > > less than 100 lines of code. And I figure it might be useful as a
> > part
> > > of OneBody or another project someday.
> > > Thanks for your feedback!
> > > On Wed, Jun 3, 2009 at 12:10 AM, John Hornbeck
> > <hornb...@gmail.com> wrote:
> > >> Ahh, makes sense now :-)
> > >> On Wednesday, June 3, 2009, Joseph A Holsten <
> jos...@josephholsten.com
> > > wrote:
> > >>> Internal dsls implement domain specific features entirely within a
> > >>> host language. Think of them more like code than data. They're a
> > bit
> > >>> like tricked out libraries. They use the host language to parse
> > the
> > >>> dsl. They're quite popular in with TCL, lisp and ruby. examples:
> > >>> markaby, rails (esp migrations), rake, emacs lisp, guile, macports
> > >>> portfiles, .exrc, .shrc.
> > >>> External dsls require a custom parser. Think of them more like
> > data
> > >>> than code. They're popular with unix, .net, java. examples:
> > Ant, /etc/
> > >>> passwd, csv, vcard, yaml configs, xml configs. Arguably every
> > markup
> > >>> language lies in here.
> > >>> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
> > >>>> I'm not following what you mean by internal vs. external dsl. Do
> > >>>> explain
> > >>>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <
> jos...@josephholsten.com
> > >>>> > wrote:
> > >>>> I think I like the spirit of this over SASS for the same reason
> > I like
> > >>>> markaby/builder over haml. It's a ruby internal dsl, not an
> > external
> > >>>> dsl with a new syntax. Clearly it's not as complete as sass,
> > but I'd
> > >>>> feel more at home extending this to do crazy stuff.
> > >>>> Justin: there's always do ... end; :)
> > >>>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> > >>>> > It looks simple enough, but I have to echo Hornbeck's post.
> > One
> > >>>> > thing I like about SASS is that you don't have to use curly
> > >>>> brackets.
> > >>>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <
> hornb...@gmail.com
> > >>>> > wrote:
> > >>>> > do you see an advantage of this over SASS? Just curious of your
> > >>>> > reasoning behind doing it yourself as opposed to using a very
> > >>>> > popular library that already does something like this.
> > >>>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com>
> > >>>> wrote:
> > >>>> > I just put some code up on GitHub I'd like to get some feedback
> > >>>> on...
> > >>>> > This started as an experiment, and turned out to be something I
> > >>>> think
> > >>>> > could be useful. Of course, there are some (documented)
> > >>>> shortcomings.
> > >>>> > Just wondering what you guys think. Would you use something
> > like
> > >>>> this?
> > >>>> > Does it need a Rails plugin?
> > >>>> > Thanks.
> > >>>> > Oh and BTW, we have a meeting planned for June 15th. Is that
> > a good
> > >>>> > date for everyone? Any ideas for presentations?
I forgot about a book I've been interested in, “Building Domain
Specific Languages in Boo,” by Ayende Rahien[1]. That's the guy who
wrote RhinoMock for c#. (If you've got to use .NET, you absolutely
need to know LINQ and RhinoMock to know the furthest edge of the
possible in the language.)
Do any of the local user groups have a relationship with Manning to
get a copy?
> On Fri, Jun 5, 2009 at 1:33 AM, Joseph A Holsten <jos...@josephholsten.com > > wrote:
> That's a great point, and I'm sure there's a bunch of other standard
> internal DSL issues that I don't even know to check for. I'm kinda
> amazed there isn't a 'Building DSLs in Ruby' book.
> has anyone gone through this:
> http://obiefernandez.com/presentations/obie_fernandez-agile_dsl_devel... > Seems like cascading rubies is a straightforward instatiation dsl, but
> there's some other nifty examples in there too. I also learned some
> tricks from:
> http://www.scribd.com/doc/12709855/Advanced-DSLs-in-Ruby > esp, const factories, instance_eval'ing, the fuzzy line between
> internal & external. Neal ford seems to have quite a few good presos
> on dsls if you need some google fu.
> On Jun 3, 2009, at 9:37 AM, Tanner Burson wrote:
> > Personally I dislike all the crazy CSS DSLs, and I actually tend to
> > use some simple ERB templates to generate CSS instead of a full
> > blown CSS DSL. But o stand up in defense of SASS.
> > The advantage to an external DSL is that you don't HAVE to know a
> > lot of details about the hosting language to be able ti use the
> > DSL. While Tim's code is pretty slick, it suffers from a few
> > issues, some easy to fix, others not.
> > The first being because you don't inherit from a BlankSlate (or
> > similar) base class, any method available on the Object class cannot
> > be used as a selector name without using the s() method. Try using
> > the name 'id' as a selector. As mentioned this is somewhat easier
> > to fix by using BlankSlate or something similar to undefine all the
> > default methods.
> > The second is that you can't use any ruby keywords as selectors. As
> > long as you use instance_eval to run the raw code without doing any
> > sort of parsing this will remain true.
> > Obviously those aren't a big deal if you know Ruby, and are aware of
> > the limitations. But it does come with it's own set of "gotchas"
> > that an external DSL doesn't have to worry about.
> > All of that said, I've already forked this and look forward to
> > tinkering with it!
> > --Tanner Burson
> > On Wed, Jun 3, 2009 at 9:11 AM, Tim Morgan <t...@timmorgan.org>
> wrote:
> > Let me clarify: CascadingRubies is an internal Ruby DSL -- not an
> > external interpreted one like Sass. Cuz I said that kinda funny.
> > On Wed, Jun 3, 2009 at 9:04 AM, Tim Morgan <t...@timmorgan.org>
> wrote:
> > > Thanks Joseph for that wonderful explanation. Yes, this library
> is a
> > > bonefied DSL, meaning the code is actual Ruby. Sass, on the other
> > > hand, is interpreted as it's own language. With the DSL approach,
> > I'm
> > > able to mix in regular Ruby variables, require Ruby libraries, do
> > > color arithmetic, heck I could even pull CSS colors and font sizes
> > out
> > > of my database and write them directly in my CSS file.
> > > As for why I did it... because I can. Isn't that the best reason
> of
> > > all? :-) No really, it was just an experiment, and turned out to
> be
> > > less than 100 lines of code. And I figure it might be useful as a
> > part
> > > of OneBody or another project someday.
> > > Thanks for your feedback!
> > > On Wed, Jun 3, 2009 at 12:10 AM, John Hornbeck
> > <hornb...@gmail.com> wrote:
> > >> Ahh, makes sense now :-)
> > >> On Wednesday, June 3, 2009, Joseph A Holsten <jos...@josephholsten.com
> > > wrote:
> > >>> Internal dsls implement domain specific features entirely
> within a
> > >>> host language. Think of them more like code than data. They're a
> > bit
> > >>> like tricked out libraries. They use the host language to parse
> > the
> > >>> dsl. They're quite popular in with TCL, lisp and ruby. examples:
> > >>> markaby, rails (esp migrations), rake, emacs lisp, guile,
> macports
> > >>> portfiles, .exrc, .shrc.
> > >>> External dsls require a custom parser. Think of them more like
> > data
> > >>> than code. They're popular with unix, .net, java. examples:
> > Ant, /etc/
> > >>> passwd, csv, vcard, yaml configs, xml configs. Arguably every
> > markup
> > >>> language lies in here.
> > >>> On Jun 2, 2009, at 11:12 PM, John Hornbeck wrote:
> > >>>> I'm not following what you mean by internal vs. external
> dsl. Do
> > >>>> explain
> > >>>> On Tue, Jun 2, 2009 at 11:08 PM, Joseph A Holsten <jos...@josephholsten.com
> > >>>> > wrote:
> > >>>> I think I like the spirit of this over SASS for the same reason
> > I like
> > >>>> markaby/builder over haml. It's a ruby internal dsl, not an
> > external
> > >>>> dsl with a new syntax. Clearly it's not as complete as sass,
> > but I'd
> > >>>> feel more at home extending this to do crazy stuff.
> > >>>> Justin: there's always do ... end; :)
> > >>>> On Jun 2, 2009, at 10:55 PM, Justin Richter wrote:
> > >>>> > It looks simple enough, but I have to echo Hornbeck's post.
> > One
> > >>>> > thing I like about SASS is that you don't have to use curly
> > >>>> brackets.
> > >>>> > On Tue, Jun 2, 2009 at 10:09 PM, John Hornbeck <hornb...@gmail.com
> > >>>> > wrote:
> > >>>> > do you see an advantage of this over SASS? Just curious of
> your
> > >>>> > reasoning behind doing it yourself as opposed to using a very
> > >>>> > popular library that already does something like this.
> > >>>> > On Tue, Jun 2, 2009 at 10:05 PM, Tim Morgan <seve...@gmail.com
> > >>>> wrote:
> > >>>> > I just put some code up on GitHub I'd like to get some
> feedback
> > >>>> on...
> > >>>> > This started as an experiment, and turned out to be
> something I
> > >>>> think
> > >>>> > could be useful. Of course, there are some (documented)
> > >>>> shortcomings.
> > >>>> > Just wondering what you guys think. Would you use something
> > like
> > >>>> this?
> > >>>> > Does it need a Rails plugin?
> > >>>> > Thanks.
> > >>>> > Oh and BTW, we have a meeting planned for June 15th. Is that
> > a good
> > >>>> > date for everyone? Any ideas for presentations?