4 ms·
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 (s
by lusis 16y ago
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.
- silentbicycle 16y agoRuby 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. * e.g. http://en.wikipedia.org/wiki/Cà_phê_sữa_đá http://en.wikipedia.org/wiki/Cà_phê_sữa_đá
- lusis 16y agoFair 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.
- nvie 16y agoCucumber 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 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.
- cageface 16y agoMaybe, 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.