3 ms·
Rails is a web framework. It's an easy one to use, and often the way to express something is concise enough that I would feel okay saying that "Rails is a DSL f
by sethrin 8y ago
Rails is a web framework. It's an easy one to use, and often the way to express something is concise enough that I would feel okay saying that "Rails is a DSL for web applications". That would be a simile, however, and not literally correct. It would be more literally correct to suggest that Rails was composed of several DSLs, but that probably stretches the definition as well.
The routing system in Rails is definitely a DSL. You might say that defining model properties was a DSL. You can probably call an ORM query interface a DSL. The controller and view layers are going to look like just about any other framework. Rails is a full-featured framework, which can be configured with a minimum of fuss, bother, and actual code-writing. For toy apps I don't think there's anything else that's faster for development, and for real apps I'm pretty sure that all frameworks are roughly equivalent.
There are Ruby projects which do provide a "DSL for web apps", of which I believe Sinatra is the most popular. Rails incorporates some DSL-like features, and I would agree with anyone who said that it "is basically a DSL for web apps", but I would consider that a figure of speech.