Django for Python is the most recently announced of what is becoming a long line of web frameworks inspired by Ruby on Rails. Others that have popped up include MonoRail for .NET & Mono, Subway for Python, Trails for Java, Catalyst and Maypole for Perl. In the context of all these rails derivatives, this article on “Could Rails have been built without Ruby?” is an interesting read.
Django: Another “Rails” Web Framework
2005-07-16 9:25 pmsmitty_one_each
>Maybe this is because of the learning curve, the need to adapt to different ways of thinking (see the discussion on OOP from Paul graham’s site, for instance), the lack of hype from the media, etc.
I think Lisp was ahead of its time, in terms of hardware requirements.
Besides performance, though, the fact that C and ilk have always been about binaries and enough header files to get you in the door, which supports a business model more obviously, has been IMO crucial.
What made me laugh the other day was seeing a pitch on OWL and Semantic Web stuff and having visions of functional programming and Prolog in XML.
this is the best technology for do web applications
in pure python style i guess.
Rails is a great framework. I think the more dynamic the language, the better chance it has at being able to pull off what Ruby on Rails is able to do. However, languages like C# and Java are completely ill-suited for Rails. As much as I like Tapestry, Trails seems like just a hack to get scaffolding in Java, which is only a small part of the many things that makes Rails a joy to work with. Ruby is perfectly suited for the Rails framework. Its syntax is far from verbose, and its dynamic languages allow plenty of “behind-the-scenes” tricks that make programming in Rails so straightforward. I just simply don’t see how that can be duplicated in less flexible languages (especially languages that are statically typed). That said, I think Python probably has the best chance at duplicating Rails, but the duplication seems needless when standard Rails already has momentum (including several upcoming books). The Python vs. Ruby debate seems pointless. The differences between the two are so small that it comes down to personal taste. Why duplicate an entire community and project for that?
I noticed while looking through the links that there’s a “Rails” framework for .NET.
It looks hideous…I agree with zpinter…it’s entirely ill-suited for Java or .NET….it would appear to completely trash the rules of application layer separation.
Yeah we’ll have to see if the .NET and Java rails frameworks might be more usable with languages that are more dynamic or flexible like groovy (http://docs.codehaus.org/display/GROOVY/Grails), jython, ironpython, nemerle, and boo (see http://groups-beta.google.com/group/boolang/browse_frm/thread/5e604…).
MonoRail is also interested in creating a ruby-like language for .NET called Rook: http://www.castleproject.org/index.php/Rook
What does it actually mean when a language is ‘on rails’? Is the code compatible between them? Is it a different discipline in how one writes their code? Can c++ be on rails? Please try and explain in laymens terms if you can instead of linking to a faq. I’ve heard good things about ruby on rails and I am just starting to learn python, and I’m just curious what this brings to the table and would like to understand the distinction of when a language is ‘on rails’
2005-07-17 12:37 amRonald Vos
What does it actually mean when a language is ‘on rails’?
Languages aren’t ‘on rails’, it’s just the name given to this particular framework. The idea is that development goes in one direction from the start, and is so fast, that it’s like being on a moving train.
Basically what it does is making writing sites from the ground up much easier by automating a lot of the parts, and using defaults for a lot of things you were going to do anyway.
Quite possibly one of the greatest frameworks I’ve ever seen.
fscotsman already said Seaside for Smalltalk which is very good.
Also take a look at UnCommon Web for lisp: http://common-lisp.net/project/ucw/
Another nice project is Portable AllegroServe, a lisp web server with many nice features for web programming. You can use it with UnCommon Web:
Seaside is really exceptional. It’s heavily inspired by WebObjects, but add continuation and leverage the dynamic nature of Smalltalk environments. The end result is just great ! 🙂
Try it (grab Squeak, get a Seaside image), it’s worth your time..
AFAIK (and I don’t really know, but here goes …)
Ruby is a language, Rails is a web framework. I guess web frameworks work just like GUI frameworks. For example, WX Widgets is a GUI written in C++. Rails is a web framework written in Ruby … ?
If you want to learn about Ruby on Rails, go to their website and download the intro video.
It’s really amazing.
So, they reinvented SQL <again>. Just use ASP.NET already.
Ummm… hate to sound so ignorant, but what exactly is “rails”?
2005-07-16 8:12 pmAnonymous
The reason for the name Rails is because it would be like if you were doing J2EE after snorting rails of coke.
So… Would you favor Ruby on Rails over Django?
I’ll tell you what – I just built my first basic Ruby-on-Rails web app, and it IS really really simple and powerful. But it still requires you to know Ruby for it to give you the full flexibility. Until then, I can write and manipulate PHP much faster, it’s typing the damned interface that takes so long. And you still need to do most of that with RoR.
At some point in the near future, these framework type applications are going to be very pervasive and they will learn how to scale well. And that point, I think knowing the intimate corners of your code will become a lost art in some ways, as people begin to find out that frameworks can do almost all of the heavy lifting.
How about an editorial describing how to set up a framework? that would be great.
Why do i need rails when I have drupal?
That’s awesome! I will try this.
I find it amazing how the features of Lisp, the grandaddy of computer languages, are still being copied in today’s new computer languages. And still these languages don’t hold a candle to Lisp. I think the only reason Lisp is not more widely used is that it has a steep learning curve. Novices coming from “mainstream” languages find it weird and difficult. Once you “get” it though, Lisp is a revelation…too bad most people wimp out before they do.
Django was developed independently over two years for a newspaper web operation:
They developed a news-publishing CMS using mod_python. The underlying web framework was extracted from this CMS and saw use on other sites such as:
This framework is what has become Django.
It is really nice and easy to deploy websites. You can get a simple, useless website going quickly. It’s not “10x” faster, as some like to hype about it, though improving upon that website is straightforward and fun to do.
Some thoughts beyond the hype:
* Ruby has a fraction of the support of most languages we’d be interested in, esp. Java/C#, or Python/PHP on the dynamic side.
* Ruby has performance problems. A lot of people say this isn’t important, I’m not one of them.
* Complex database designs do not lend themselves to ActiveRecord. Once you hit a certain point of complexity, it just gets in the way and needs to be punted on.
* I really don’t like eRuby (the templating mechanism). It’s slow to render (C based templating systems are around 25-50x faster) and doesn’t provide any security between MVC layers (important for some organizations). Thankfully, ripping out eRuby is very straightforward with Rails (2 lines of code).
* Don’t even bother trying to use Rails on Windows, it has serious performance and configuration issues.
What I’ve found is that it’s really fun to write small/simple sites in Rails. But once I got past a certain point, I ripped it apart until all I was left with was the controller.
2005-07-17 9:47 amAnonymous
>Don’t even bother trying to use Rails on Windows, it has
>serious performance and configuration issues.
What do you mean with “using Rails on Windows” if you are talking about production systems it may be true. But if you are talking about developing you couldn’t be fearther from the trueth.
To set up RoR for development on windows. Get ruby (one klick installer) use gem (included in one klick installer) to install ruby on rails, gem takes care of dependencies. Get a database, if you use mysql you are set, if postgresql or another, you will need to install a wraper to the DB. If you want a gui for the DB you can get one. You don’t need a webserver since there is one in ruby.
It’s easy to get runing with ruby on rails on windows for development, and for deployment let your host take care of that.
2005-07-18 2:09 amAnonymous
> What do you mean with “using Rails on Windows”
> if you are talking about production systems it
> may be true.
Exactly — that’s what I am talking about. My work’s servers are WS2003. FastCGI/Apache/Rails is a PITA on Windows, and even when you’re done, it won’t work right. The only way to get a reliable server on windows is to either use the built in server or to use CGI.
Also, I like to see some performance indicators even for development. I like to have _some_ idea of what kind of performance I’ll get out of a system. RoR does not allow for that on Windows.
From the tutorials pointed by Lumbergh, it seems like Rails apps mixes presentation (HTML) with app code..is there a way to avoid that? Otherwise it would be hell to work with it in a team environment.
actually, eRuby is the C version of ERb.
Rails uses ERb, which, according to line one of erb.rb is “tiny eruby”.
So If you want to become fast I think you can teorically just use eruby instead of ERb, precompile your templates and so on.
Thanks god, once you set up caching corrctly, the template rendering becomes a small problem in almost any system
Anyway, I really prefer the template system used in Nitro (www.nitrohq.com), and even the persistence layer seem much better that rails’ ActiveRecord, IMNSHO.
But sadly the Nitro guys seem to massively lack thge marketing abilities of David H. H.
I love the Ruby language, so I took a look at Ruby on Rails some time ago. I’ll pass. For building small, simple web sites I think these “Rails” frameworks will do just fine, but I don’t think they scale well, and they produce some profoundly ugly database code.
The author of RoR is outspoken in his criticisms of tag libraries and database gurus. He’s absolutely full of crap. RoR’s reliance on autogenerated surrogate keys in database tables is naive, since many developers unfamiliar with proper database design will foolishly cluster on this surrogate key when some other column or set of columns might be more appropriate for clustering. It’s particularly frustrating when a natural key — possibly consisting of more than one column — is staring you in the face, yet RoR forces you to put an ugly autogenerated integer key on your table. No thanks!
The other thing the author hates is tag libraries. I understand his criticisms to a point, but no further. It’s true that tag libraries have limited cross-project utility, but within a project they have been indispensible for modularization. Whether I’m using ASP.NET or JSP, it certainly beats the spaghetti code model of PHP and ASP, and to a lesser extent, Rails. I suppose it’s a personal preference.
All these “Rails” frameworks are strictly for amateurs, in my opinion. If you don’t know what a surrogate key is and why it’s not a good idea, have fun with Rails.
2005-07-18 12:22 pmRodrigo
I agree with your points on spaghetti code and RoR not being suited (by now) for big, enterprise-wide apps.
But not on the surrogate keys part…at least from my experience buildind data warehousing and integration apps, natural keys can be hell too. I’d recommend you reading this:
2005-07-18 12:39 pmRodrigo
I would like to edit and add a bit more on my comments regarding surrogate x natural keys, but since I can’t edit here at OSNews, here it goes:
This debate is very, very old, and you might find smart and well-fundamented points on both sides. It’s a bit like religious debates, you can’t really put an end on it, just listen to all the sides, make your own decision and live with it. So to put everyone who uses surrogate keys as “amateurs” and “naive” is IMHO like calling everyone who decides for this or that religion dumb.
Personally I prefer to use natural keys on small apps, but when it comes to huge apps, they created more problems than solved, for example on performance and on team development. But then again, it’s just me, and I’ve seen great apps using one option or another, and crappy apps using one system or another.
This article is interesting too:
PS: Sorry of the off-topic
2005-07-18 2:59 pmPhuqker
I’m firmly in the natural key camp, but I won’t get into a religious war about them here. I don’t want to suggest that I never use surrogate keys: I do, but only when the underlying data is non-relational, such as a table that holds a sequential log of events. The author of http://builder.com.com/5100-6388-1045050.html is wrong in one very important respect. He confuses a row with a record. Adding a surrogate key may make your row unique, but it does not necessarily make your record unique. And unique records, not rows, are what make data relational. That’s the whole point! And, on topic, that’s why Rails and in particular ActiveRecord, simply didn’t work for me. I’m a database power user, and I felt Rails dumbed it down too much for me.
As for the data warehousing article, it looks like surrogate keys are an implementation detail of warehousing and have nothing directly to do with the debate about surrogate keys.
What Python framework would you suggest for the web?
This is an XML web framework, backed by Java, with alot of XSLT.
It’s one big XML pipeline, anything XML can be thrown in and integrated into your webapp. An XML platform.
Yes, the debate about natural/surrogate keys has been around forever, but the sensible argument is that the choice should be dictated by your business concerns and your database model, not by an application environment or it’s mechanisms. Once the application framework starts driving the database model, you will never be able to apply real database design concepts. The same goes for so-called “object-relational” modeling (ORM).
2005-07-18 1:58 pmRodrigo
Some ORM frameworks, such as NHibernate, support both surrogate and natural/composite keys, don’t they?
I think that as long as the constraints added by the framework are not crazy, IMHO it’s OK to compromise a bit of personal preferences on the design to be able to use it, since a truly generic, “do whatever you want” framework would probably be too complex to develop. As people say, “you can’t eat the cake and have it”.
Yeah it might not be fantastic, but anyone can live with a GUID-based PK, for example, especially if you get your whole DAL working (and working well) in 1 hour, in return for that. I’ve seen a lot of people who dismiss new technologies like NHibernate and RoR saying they don’t like the underlying design, which might be true for some, but others didn’t even take a serious look on it, they’re just lazy or scared of learning new stuff and leave the “comfort zone”.
You forgot to mention Cake  and Biscuit  as examples for rails-like frameworks in PHP.
A few quotes from the article: “First, new languages may be trending towards LISP (…) Two decades have passed since I looked at LISP code, and I’m wondering if I like Ruby because it’s as powerful as that language in my distant memory.”
Enough: here’s a web framework written in Common Lisp:
No hype, no O’Reilly book.
Here’s a site built with it: http://www.eboy.com/eboy
There’s other stuff: you might want to check the Common Lisp community wiki, which, by the way, is written in Common Lisp and runs in a server written in Common Lisp (Araneida). A world unto itself:
The CL community is much smaller than the Ps and the Rs. Maybe this is because of the learning curve, the need to adapt to different ways of thinking (see the discussion on OOP from Paul graham’s site, for instance), the lack of hype from the media, etc. In terms of Open Source, this is really a hacker’s realm: lots of stuff, but lots not documented. Must read the code very often. No pain, no gain (this needn’t be so).
The rewards are great if you tread that path. Lisp has always been an inspiration, as the article said.