Re:Survey: Python vs Ruby Test Ecosystems
by lusis on Tuesday November 16, 2010 @09:19PM
(#1912637)
I know he made a little "bait" comment but at least he admits the simple inability for python to seriously host DSLs. If you look at any python port of a DSL (sinatra clone, cucumber clone, whatever) it's just simply ugly. It's STILL python code.
[ Parent
| on HN ]
Re:Survey: Python vs Ruby Test Ecosystems
by silentbicycle on Tuesday November 16, 2010 @11:01PM
(#1912849)
Ruby DSLs still look like Ruby code, too; it just has a laxer lexer. For a reality check, look at DSLs in Forth or Prolog sometime. Many Ruby DSLs are :covered with? accent "marks", though, like Romanized Vietnamese* . You're probably just used to it.
Fair enough. Sinatra and Chef are good examples of "ruby code" DSLs.
In contrast, however, I give you Cucumber scenario files. Yes, Given/When/Then are methods but it's still a very elegant DSL.
I'll do some poking into prolog and forth-based DSLs. You've peaked my interest.
Re:Survey: Python vs Ruby Test Ecosystems
by nvie on Wednesday November 17, 2010 @03:48AM
(#1913506)
Cucumber is not really a native DSL. The scenario files are simply text files that are parsed (pattern matched) by Cucumber, which is a parser that's written in Ruby. It could well be written in Python, too.
If you look at Steak (https://github.com/cavalle/steak), however, this is a real native Ruby DSL, and such a thing is impossible to ever do as elegant in Python.
Re:Survey: Python vs Ruby Test Ecosystems
by cageface on Wednesday November 17, 2010 @09:04AM
(#1914219)
Maybe, but my enthusiasm for DSLs in ruby has diminished a lot in the 6+ years I've been doing ruby work. DSLs don't compose well and it's usually easier to learn a new api than yet another new mini-language.